Spaces:
Sleeping
Sleeping
Commit
·
c5ec5d8
1
Parent(s):
7de933f
updates
Browse files
app.py
CHANGED
|
@@ -40,9 +40,9 @@ except Exception as e:
|
|
| 40 |
'image_id': Value(dtype='string'),
|
| 41 |
'caption': Value(dtype='string'),
|
| 42 |
'annotation_count': Value(dtype='int32'),
|
| 43 |
-
'
|
| 44 |
})
|
| 45 |
-
dataset = Dataset.from_dict({'image_id': [], 'caption': [], 'annotation_count': [], '
|
| 46 |
annotation_counts = {}
|
| 47 |
dataset.push_to_hub(dataset_name) # Push the empty dataset to Hugging Face
|
| 48 |
|
|
@@ -122,12 +122,12 @@ def save_annotation(caption, session_data):
|
|
| 122 |
"image_id": [image_id],
|
| 123 |
"caption": [caption],
|
| 124 |
"annotation_count": [annotation_count + 1],
|
| 125 |
-
"
|
| 126 |
}, features=Features({
|
| 127 |
'image_id': Value(dtype='string'),
|
| 128 |
'caption': Value(dtype='string'),
|
| 129 |
'annotation_count': Value(dtype='int32'),
|
| 130 |
-
'
|
| 131 |
}))
|
| 132 |
|
| 133 |
# Update the annotation count in the dictionary
|
|
|
|
| 40 |
'image_id': Value(dtype='string'),
|
| 41 |
'caption': Value(dtype='string'),
|
| 42 |
'annotation_count': Value(dtype='int32'),
|
| 43 |
+
'spl': Value(dtype='string')
|
| 44 |
})
|
| 45 |
+
dataset = Dataset.from_dict({'image_id': [], 'caption': [], 'annotation_count': [], 'spl': []}, features=features)
|
| 46 |
annotation_counts = {}
|
| 47 |
dataset.push_to_hub(dataset_name) # Push the empty dataset to Hugging Face
|
| 48 |
|
|
|
|
| 122 |
"image_id": [image_id],
|
| 123 |
"caption": [caption],
|
| 124 |
"annotation_count": [annotation_count + 1],
|
| 125 |
+
"spl": [split]
|
| 126 |
}, features=Features({
|
| 127 |
'image_id': Value(dtype='string'),
|
| 128 |
'caption': Value(dtype='string'),
|
| 129 |
'annotation_count': Value(dtype='int32'),
|
| 130 |
+
'spl': Value(dtype='string')
|
| 131 |
}))
|
| 132 |
|
| 133 |
# Update the annotation count in the dictionary
|