Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions downloadutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
p.add_argument('--downloadImages', help='Should download images', action='store_true', default=False)
p.add_argument('--downloadOriginalImages', help='Should download original images', action='store_true', default=False)
p.add_argument('--downloadBoundingBox', help='Should download bouding box annotation files', action='store_true', default=False)
p.add_argument('-n', '--numImages', help='Max number of images to download from each category', type=int, default=-1)
# p.add_argument('--jobs', '-j', type=int, default=1, help='Number of parallel threads to download')
# p.add_argument('--timeout', '-t', type=int, default=10, help='Timeout per image in seconds')
# p.add_argument('--retry', '-r', type=int, default=10, help='Max count of retry for each image')
Expand All @@ -32,6 +33,8 @@
if args.downloadImages is True:
for id in args.wnid:
list = downloader.getImageURLsOfWnid(id)
# Only keep the first n results if specified
list = list[:args.numImages] if args.numImages != -1 else list
downloader.downloadImagesByURLs(id, list)

if args.downloadBoundingBox is True:
Expand Down