GeorgeIbrahim commited on
Commit
d7e002e
·
1 Parent(s): 4e32c1e
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -127,14 +127,14 @@ def save_annotation(caption, session_data):
127
  return gr.update(visible=False), gr.update(value="All images have been annotated!"), gr.update(value="")
128
 
129
  with lock:
130
- match = re.search(r'_(\d+)\.', image_path)
131
  image_id = session_data["current_image"]
132
  print("Image ID before: ", image_id)
133
-
 
134
  image_id_2 = match.group(1).lstrip('0')
135
  split = "dev" if image_id_2 in results else "train"
136
  print("Image ID after: ", image_id_2)
137
-
138
  # Save caption or "skipped" based on user input
139
  if caption.strip().lower() == "skip":
140
  caption = "skipped"
 
127
  return gr.update(visible=False), gr.update(value="All images have been annotated!"), gr.update(value="")
128
 
129
  with lock:
 
130
  image_id = session_data["current_image"]
131
  print("Image ID before: ", image_id)
132
+
133
+ match = re.search(r'_(\d+)\.', image_id)
134
  image_id_2 = match.group(1).lstrip('0')
135
  split = "dev" if image_id_2 in results else "train"
136
  print("Image ID after: ", image_id_2)
137
+
138
  # Save caption or "skipped" based on user input
139
  if caption.strip().lower() == "skip":
140
  caption = "skipped"