Skip to content

Commit

Permalink
download_images fix divide by zero when user can download all
Browse files Browse the repository at this point in the history
  • Loading branch information
dale-wahl committed May 30, 2024
1 parent 3580fc9 commit e0c55a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions processors/visualisation/download_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def process(self):
downloaded_images = 0
processed_urls = 0
failures = []
total_images = len(urls) if amount == 0 else amount
for url in urls:
if amount != 0 and downloaded_images >= amount:
break
Expand All @@ -273,8 +274,8 @@ def process(self):

processed_urls += 1
self.dataset.update_status("Downloaded %i/%i images; downloading from %s" %
(downloaded_images, amount, url))
self.dataset.update_progress(downloaded_images / amount)
(downloaded_images, total_images, url))
self.dataset.update_progress(downloaded_images / total_images)

try:
# acquire image
Expand Down

0 comments on commit e0c55a8

Please sign in to comment.