End to End Machine Learning Project on Fuel Consumption Prediction of 70s and 80s vehicles.
demo_fastapi's Introduction
demo_fastapi's People
Forkers
coolhimanshu-verma vishwa360 sony1974 jk-vishwanath cmehta duttagoutam bhagyashreekoragi monasheeba-source er-vivekkumar raparama tinumr jsheikabdullah saloni22-ml nikhiltiwari1 rb-s bharathrajagajula deenam fashflash16demo_fastapi's Issues
This may be just me but I get an error downloading every file
#. Here is my code, my Colab repository is https://colab.research.google.com/drive/1jFis0PX3FJy3DmWpbpbhIdjKD-r4Hzlf#scrollTo=QLfFzeIrMXLY
every file has an error downloading
Code
import urllib3
from urllib.parse import urlparse
import pandas as pd
import itertools
import shutil
from urllib3.util import Retry
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
classes = ["cat", "fish"]
set_types = ["train", "test", "val"]
def download_image(url, klass, data_type):
basename = os.path.basename(urlparse(url).path)
filename = "{}/{}/{}".format(data_type, klass, basename)
if not os.path.exists(filename):
try:
http = urllib3.PoolManager(retries=Retry(connect=1, read=1, redirect=2))
with http.request("GET", url, preload_content=False) as resp, open(
filename, "wb"
) as out_file:
if resp.status == 200:
shutil.copyfileobj(resp, out_file)
else:
print("Error downloading {}".format(url))
resp.release_conn()
except:
print("Error downloading {}".format(url))
if name == "main":
if not os.path.exists("images.csv"):
print("Error: can't find images.csv!")
sys.exit(0)
# get args and create output directory
imagesDF = pd.read_csv("images.csv")
for set_type, klass in list(itertools.product(set_types, classes)):
path = "./{}/{}".format(set_type, klass)
if not os.path.exists(path):
print("Creating directory {}".format(path))
os.makedirs(path)
print("Downloading {} images".format(len(imagesDF)))
result = [
download_image(url, klass, data_type)
for url, klass, data_type in zip(
imagesDF["url"], imagesDF["class"], imagesDF["type"]
)
]
sys.exit(0)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.