Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
UltralyticsAssistant committed Sep 5, 2024
1 parent 7dfa826 commit 24596fc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion utils/clean_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def scan_one_file(f):
if remove and os.path.exists(f[j]):
os.remove(f[j])
print(f"Duplicate images {f[i]} {[f[j] for j in duplicates]}")
print("Found %g duplicates." % len(removed))
print(f"Found {len(removed):g} duplicates.")


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions utils/multithread_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def fetch_url(url):
results = ThreadPool(8).imap_unordered(fetch_url, urls) # 8 threads
pbar = tqdm(enumerate(results), total=len(urls))
for i, (url, resp) in pbar:
pbar.desc = "%g %r %s" % (i, url, resp)
pbar.desc = f"{i:g} {url!r} {resp}"
print("Done multi-thread (%.2fs)\n" % (timer() - t))

# Single-thread
t = timer()
pbar = tqdm(range(len(urls)))
for i in pbar:
url, resp = fetch_url(urls[i])
pbar.desc = "%g %r %s" % (i, url, resp)
pbar.desc = f"{i:g} {url!r} {resp}"
print("Done single-thread (%.2fs)\n" % (timer() - t))

0 comments on commit 24596fc

Please sign in to comment.