Spaces:
Sleeping
Sleeping
Commit
·
fbc8f33
1
Parent(s):
09aa473
updates
Browse files
app.py
CHANGED
|
@@ -139,9 +139,7 @@ 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 |
-
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
|
|
@@ -151,6 +149,7 @@ def get_next_image(session_data):
|
|
| 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
|
|
@@ -203,7 +202,7 @@ def save_annotation(caption, session_data):
|
|
| 203 |
print("Pushed updated dataset")
|
| 204 |
|
| 205 |
# Clear user's current image if the validation image has been annotated twice
|
| 206 |
-
if ("
|
| 207 |
session_data["current_image"] = None
|
| 208 |
|
| 209 |
# Fetch the next image
|
|
|
|
| 139 |
match = re.search(r'_(\d+)\.', img)
|
| 140 |
if match:
|
| 141 |
image_id_2 = match.group(1).lstrip('0') # Remove leading zeros
|
| 142 |
+
|
|
|
|
|
|
|
| 143 |
|
| 144 |
# Apply the filtering conditions
|
| 145 |
if (img not in annotation_counts or
|
|
|
|
| 149 |
|
| 150 |
# print("Available images:", available_images) # Debugging line
|
| 151 |
|
| 152 |
+
|
| 153 |
# Check if the user already has an image
|
| 154 |
if session_data["current_image"] is None and available_images:
|
| 155 |
# Assign a new random image to the user
|
|
|
|
| 202 |
print("Pushed updated dataset")
|
| 203 |
|
| 204 |
# Clear user's current image if the validation image has been annotated twice
|
| 205 |
+
if (split == "train" and annotation_count > 1) or (split == "dev" and annotation_count > 2):
|
| 206 |
session_data["current_image"] = None
|
| 207 |
|
| 208 |
# Fetch the next image
|