Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -94,7 +94,7 @@ def predict_answer(video, image, question):
|
|
94 |
use_cache=True)[0]
|
95 |
answer = tokenizer.decode(output_ids[input_ids.shape[1]:], skip_special_tokens=True).strip()
|
96 |
|
97 |
-
return
|
98 |
# # Process as a video
|
99 |
# frames = video_to_frames(video)
|
100 |
# answers = []
|
@@ -158,8 +158,21 @@ promt_bus_people = """
|
|
158 |
provide me the answers as a dictionary with key as the string value of the variable value on top and its value should be boolean value
|
159 |
"""
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
promt_video = """
|
162 |
-
Annotate this image
|
163 |
{
|
164 |
“description”: “Is the person standing?”,
|
165 |
“value”: “standing”,
|
@@ -168,8 +181,11 @@ promt_video = """
|
|
168 |
“description”: “Is the person's hands free?”,
|
169 |
“value”: “Hands-Free”,
|
170 |
},
|
171 |
-
|
|
|
172 |
"""
|
|
|
|
|
173 |
test_examples = [[None, "Images/cat_dog.jpeg", promt_cat_dog],
|
174 |
[None,"Images/bus_people.jpeg", promt_bus_people],
|
175 |
["videos/v2.mp4",None,promt_video],
|
|
|
94 |
use_cache=True)[0]
|
95 |
answer = tokenizer.decode(output_ids[input_ids.shape[1]:], skip_special_tokens=True).strip()
|
96 |
|
97 |
+
return answer
|
98 |
# # Process as a video
|
99 |
# frames = video_to_frames(video)
|
100 |
# answers = []
|
|
|
158 |
provide me the answers as a dictionary with key as the string value of the variable value on top and its value should be boolean value
|
159 |
"""
|
160 |
|
161 |
+
# promt_video = """
|
162 |
+
# Annotate this image with this schema:
|
163 |
+
# {
|
164 |
+
# “description”: “Is the person standing?”,
|
165 |
+
# “value”: “standing”,
|
166 |
+
# },
|
167 |
+
# {
|
168 |
+
# “description”: “Is the person's hands free?”,
|
169 |
+
# “value”: “Hands-Free”,
|
170 |
+
# },
|
171 |
+
# provide me the answers as a dictionary with key as the string value of the variable value on top and its value should be boolean value
|
172 |
+
# """
|
173 |
+
|
174 |
promt_video = """
|
175 |
+
Annotate this image by indicating the presence or absence of specific objects.
|
176 |
{
|
177 |
“description”: “Is the person standing?”,
|
178 |
“value”: “standing”,
|
|
|
181 |
“description”: “Is the person's hands free?”,
|
182 |
“value”: “Hands-Free”,
|
183 |
},
|
184 |
+
Provide your answers as a dictionary with the object type as the key and a boolean value indicating its presence in the image, Use 'true' for objects present in the image and 'false' for objects not present.
|
185 |
+
|
186 |
"""
|
187 |
+
|
188 |
+
|
189 |
test_examples = [[None, "Images/cat_dog.jpeg", promt_cat_dog],
|
190 |
[None,"Images/bus_people.jpeg", promt_bus_people],
|
191 |
["videos/v2.mp4",None,promt_video],
|