Spaces:
Sleeping
Sleeping
Commit ·
09aa473
1
Parent(s): 4254bd0
updates
Browse files
app.py
CHANGED
|
@@ -139,6 +139,9 @@ def get_next_image(session_data):
|
|
| 139 |
match = re.search(r'_(\d+)\.', img)
|
| 140 |
if match:
|
| 141 |
image_id_2 = match.group(1).lstrip('0') # Remove leading zeros
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
# Apply the filtering conditions
|
| 144 |
if (img not in annotation_counts or
|
|
@@ -146,13 +149,13 @@ def get_next_image(session_data):
|
|
| 146 |
(image_id_2 not in results and annotation_counts.get(img, 0) == 0)):
|
| 147 |
available_images.append(img)
|
| 148 |
|
| 149 |
-
print("Available images:", available_images) # Debugging line
|
| 150 |
|
| 151 |
# Check if the user already has an image
|
| 152 |
if session_data["current_image"] is None and available_images:
|
| 153 |
# Assign a new random image to the user
|
| 154 |
session_data["current_image"] = random.choice(available_images)
|
| 155 |
-
print("Current image_id:", session_data["current_image"]) # Print the current image_id
|
| 156 |
|
| 157 |
return os.path.join(image_folder, session_data["current_image"]) if session_data["current_image"] else None
|
| 158 |
|
|
|
|
| 139 |
match = re.search(r'_(\d+)\.', img)
|
| 140 |
if match:
|
| 141 |
image_id_2 = match.group(1).lstrip('0') # Remove leading zeros
|
| 142 |
+
print(image_id_2)
|
| 143 |
+
print(image_id_2 in results)
|
| 144 |
+
print(annotation_counts.get(img, 0))
|
| 145 |
|
| 146 |
# Apply the filtering conditions
|
| 147 |
if (img not in annotation_counts or
|
|
|
|
| 149 |
(image_id_2 not in results and annotation_counts.get(img, 0) == 0)):
|
| 150 |
available_images.append(img)
|
| 151 |
|
| 152 |
+
# print("Available images:", available_images) # Debugging line
|
| 153 |
|
| 154 |
# Check if the user already has an image
|
| 155 |
if session_data["current_image"] is None and available_images:
|
| 156 |
# Assign a new random image to the user
|
| 157 |
session_data["current_image"] = random.choice(available_images)
|
| 158 |
+
# print("Current image_id:", session_data["current_image"]) # Print the current image_id
|
| 159 |
|
| 160 |
return os.path.join(image_folder, session_data["current_image"]) if session_data["current_image"] else None
|
| 161 |
|