Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -97,7 +97,10 @@ if uploaded_file is not None:
|
|
| 97 |
image_bytes = query({
|
| 98 |
"inputs": 'A picture without text about: ' + summary[0]['summary_text']
|
| 99 |
})
|
| 100 |
-
|
|
|
|
|
|
|
|
|
|
| 101 |
temp_img_path = tempfile.NamedTemporaryFile(delete=False, suffix=".png").name
|
| 102 |
image.save(temp_img_path)
|
| 103 |
|
|
|
|
| 97 |
image_bytes = query({
|
| 98 |
"inputs": 'A picture without text about: ' + summary[0]['summary_text']
|
| 99 |
})
|
| 100 |
+
image_width = 800 # Set the desired width
|
| 101 |
+
image_height = 600 # Set the desired height
|
| 102 |
+
image = Image.open(io.BytesIO(image_bytes)).resize((image_width, image_height))
|
| 103 |
+
|
| 104 |
temp_img_path = tempfile.NamedTemporaryFile(delete=False, suffix=".png").name
|
| 105 |
image.save(temp_img_path)
|
| 106 |
|