Romain Graux commited on
Commit
25a8030
·
1 Parent(s): e3e9ce0

Add basic progress bar for images

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -56,13 +56,14 @@ def inf(img, n_species, threshold, architecture):
56
  return img, results
57
 
58
 
59
- def batch_fn(files, n_species, threshold, architecture, block_state):
 
60
  block_state = {}
61
  if not files:
62
  raise ValueError("No files were uploaded")
63
 
64
  gallery = []
65
- for file in files:
66
  error_physical_metadata = None
67
  try:
68
  physical_metadata = extract_physical_metadata(file.name)
 
56
  return img, results
57
 
58
 
59
+ def batch_fn(files, n_species, threshold, architecture, block_state, progress=gr.Progress()):
60
+ # progress(0, desc="Starting...")
61
  block_state = {}
62
  if not files:
63
  raise ValueError("No files were uploaded")
64
 
65
  gallery = []
66
+ for file in progress.tqdm(files, desc="Processing images"):
67
  error_physical_metadata = None
68
  try:
69
  physical_metadata = extract_physical_metadata(file.name)