Update app.py
Browse files
app.py
CHANGED
@@ -175,9 +175,9 @@ def main():
|
|
175 |
# Save the image and load it again to match the original Kosmos-2 demo.
|
176 |
# (https://github.com/microsoft/unilm/blob/f4695ed0244a275201fff00bee495f76670fbe70/kosmos-2/demo/gradio_app.py#L345-L346)
|
177 |
user_image_path = "/tmp/user_input_test_image.jpg"
|
178 |
-
|
179 |
# This might give different results from the original argument `image_input`
|
180 |
-
|
181 |
|
182 |
if text_input == "Brief":
|
183 |
text_input = "<grounding>An image of"
|
|
|
175 |
# Save the image and load it again to match the original Kosmos-2 demo.
|
176 |
# (https://github.com/microsoft/unilm/blob/f4695ed0244a275201fff00bee495f76670fbe70/kosmos-2/demo/gradio_app.py#L345-L346)
|
177 |
user_image_path = "/tmp/user_input_test_image.jpg"
|
178 |
+
image_input.save(user_image_path)
|
179 |
# This might give different results from the original argument `image_input`
|
180 |
+
image_input = Image.open(user_image_path)
|
181 |
|
182 |
if text_input == "Brief":
|
183 |
text_input = "<grounding>An image of"
|