Spaces:
Sleeping
Sleeping
GeorgeSherif commited on
Commit ·
d8b1a57
1
Parent(s): 6e3b3d1
updates
Browse files
app.py
CHANGED
|
@@ -98,11 +98,11 @@ def save_annotation(caption, session_data):
|
|
| 98 |
def skip_image(session_data):
|
| 99 |
return save_annotation("skip", session_data)
|
| 100 |
|
| 101 |
-
# Function to initialize the interface
|
| 102 |
def initialize_interface(session_data):
|
| 103 |
next_image = get_next_image(session_data)
|
| 104 |
if next_image:
|
| 105 |
-
next_caption = get_caption_for_image_id(
|
|
|
|
| 106 |
return gr.update(value=next_image), gr.update(value=next_caption or "")
|
| 107 |
else:
|
| 108 |
return gr.update(visible=False), gr.update(value="All images have been annotated!")
|
|
|
|
| 98 |
def skip_image(session_data):
|
| 99 |
return save_annotation("skip", session_data)
|
| 100 |
|
|
|
|
| 101 |
def initialize_interface(session_data):
|
| 102 |
next_image = get_next_image(session_data)
|
| 103 |
if next_image:
|
| 104 |
+
next_caption = get_caption_for_image_id(os.path.basename(next_image)) # Retrieve caption for initial image
|
| 105 |
+
print(next_caption)
|
| 106 |
return gr.update(value=next_image), gr.update(value=next_caption or "")
|
| 107 |
else:
|
| 108 |
return gr.update(visible=False), gr.update(value="All images have been annotated!")
|