lightalchemist / facescrub Goto Github PK
View Code? Open in Web Editor NEWPython script for downloading the FaceScrub face dataset.
Home Page: http://vintage.winklerbros.net/facescrub.html
Python script for downloading the FaceScrub face dataset.
Home Page: http://vintage.winklerbros.net/facescrub.html
Similar to my previous query, while downloading the FaceScrub dataset for the actresses' images as follows:
$ python python2_download_facescrub.py facescrub_actresses.txt actresses/ --crop_face --logfile=actresses.log --timeout=30
The python script terminates, while downloading some file related to "Jessica Biel", giving the following error:
... [rest of the terminal output] ...
Downloading http://www.scienceandsupermodels.com/http://www.scienceandsupermodels.com/pictures//2009/04/jessica-biel-001.jpg
Traceback (most recent call last):
File "python2_download_facescrub.py", line 308, in
main()
File "python2_download_facescrub.py", line 302, in main
save_image(counter, response, args.datasetpath, name.replace(' ', '_'), image_id, face_id, bbox, save_face=args.crop_face)
File "python2_download_facescrub.py", line 274, in save_image
logger.error("Line {number}: {error}: {url}".format(number=counter, error=e, url=url.encode("utf-8", "ignore")))
NameError: global name 'url' is not defined
Can someone please help me resolve this?
Thanks in advance.
I ran the script to download FaceScrub dataset along with the cropped-up faces of actors as follows:
$ python python2_download_facescrub.py facescrub_actors.txt actors/ --crop_face --logfile=actors.log --timeout=30
It crashes in between while downloading some file related to "Steve Carell" giving the following error:
... [rest of the terminal output] ...
Downloading http://www.moviecitizens.com/wp-content/uploads/2012/06/Steve-Carell-Brick-Tamland-MC.png
Traceback (most recent call last):
File "python2_download_facescrub.py", line 308, in
main()
File "python2_download_facescrub.py", line 298, in main
response = download_image(counter, url, sha256, args.timeout)
File "python2_download_facescrub.py", line 144, in download_image
response = requests.get(url, headers=headers, timeout=timeout)
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/api.py", line 69, in get
return request('get', url, params=params, *_kwargs)
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/api.py", line 50, in request
response = session.request(method=method, url=url, *_kwargs)
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/sessions.py", line 605, in send
r.content
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/models.py", line 750, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/models.py", line 673, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 303, in stream
for line in self.read_chunked(amt, decode_content=decode_content):
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 450, in read_chunked
chunk = self._handle_chunk(amt)
File "/home/adarshc/anaconda/lib/python2.7/site-packages/requests/packages/urllib3/response.py", line 420, in _handle_chunk
returned_chunk = self._fp._safe_read(self.chunk_left)
File "/home/adarshc/anaconda/lib/python2.7/httplib.py", line 705, in _safe_read
raise IncompleteRead(''.join(s), amt)
httplib.IncompleteRead: IncompleteRead(5162 bytes read, 2934 more expected)
Can someone please help me resolve this?
Thanks in advance.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.