GeorgeIbrahim commited on
Commit
3dde2a6
·
1 Parent(s): 9473a08
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -113,12 +113,12 @@ def get_next_image(session_data):
113
  # Match and extract the image_id from the filename
114
  match = re.search(r'_(\d+)\.', img)
115
  if match:
116
- image_id = match.group(1).lstrip('0') # Remove leading zeros
117
 
118
  # Apply the filtering conditions
119
  if (img not in annotation_counts or
120
- (image_id in results and annotation_counts.get(img, 0) < 2) or
121
- (image_id not in results and annotation_counts.get(img, 0) == 0)):
122
  available_images.append(img)
123
 
124
  print("Available images:", available_images) # Debugging line
 
113
  # Match and extract the image_id from the filename
114
  match = re.search(r'_(\d+)\.', img)
115
  if match:
116
+ image_id_2 = match.group(1).lstrip('0') # Remove leading zeros
117
 
118
  # Apply the filtering conditions
119
  if (img not in annotation_counts or
120
+ (image_id_2 in results and annotation_counts.get(img, 0) < 2) or
121
+ (image_id_2 not in results and annotation_counts.get(img, 0) == 0)):
122
  available_images.append(img)
123
 
124
  print("Available images:", available_images) # Debugging line