Update app.py
Browse files
app.py
CHANGED
|
@@ -223,8 +223,9 @@ def main():
|
|
| 223 |
|
| 224 |
def generate_predictions(image_input, text_input, do_sample, sampling_topp, sampling_temperature):
|
| 225 |
|
|
|
|
|
|
|
| 226 |
user_image_path = "/tmp/user_input_test_image.jpg"
|
| 227 |
-
# This will be of `.jpg` format
|
| 228 |
image_input.save(user_image_path)
|
| 229 |
# This might give different results from the original argument `image_input`
|
| 230 |
image_input = Image.open(user_image_path)
|
|
|
|
| 223 |
|
| 224 |
def generate_predictions(image_input, text_input, do_sample, sampling_topp, sampling_temperature):
|
| 225 |
|
| 226 |
+
# Save the image and load it again to match the original Kosmos-2 demo.
|
| 227 |
+
# (https://github.com/microsoft/unilm/blob/f4695ed0244a275201fff00bee495f76670fbe70/kosmos-2/demo/gradio_app.py#L345-L346)
|
| 228 |
user_image_path = "/tmp/user_input_test_image.jpg"
|
|
|
|
| 229 |
image_input.save(user_image_path)
|
| 230 |
# This might give different results from the original argument `image_input`
|
| 231 |
image_input = Image.open(user_image_path)
|