Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -153,12 +153,13 @@ def predict(input_img, ver):
|
|
| 153 |
# Optionally enhance the brightness slightly if the image is still too dark
|
| 154 |
brightness_enhancer = ImageEnhance.Brightness(output_img)
|
| 155 |
output_img = brightness_enhancer.enhance(1.0) # Keep brightness the same, adjust if needed
|
|
|
|
| 156 |
# 将图像存储为字节流
|
| 157 |
img_byte_arr = BytesIO()
|
| 158 |
output_img.save(img_byte_arr, format='PNG')
|
| 159 |
-
img_byte_arr.seek(0)
|
| 160 |
|
| 161 |
-
return img_byte_arr
|
| 162 |
|
| 163 |
|
| 164 |
# 📝 Title for the Gradio interface
|
|
|
|
| 153 |
# Optionally enhance the brightness slightly if the image is still too dark
|
| 154 |
brightness_enhancer = ImageEnhance.Brightness(output_img)
|
| 155 |
output_img = brightness_enhancer.enhance(1.0) # Keep brightness the same, adjust if needed
|
| 156 |
+
|
| 157 |
# 将图像存储为字节流
|
| 158 |
img_byte_arr = BytesIO()
|
| 159 |
output_img.save(img_byte_arr, format='PNG')
|
| 160 |
+
img_byte_arr.seek(0) # 重新定位到流的开始
|
| 161 |
|
| 162 |
+
return img_byte_arr.getvalue() # 返回字节内容,而非 BytesIO 对象
|
| 163 |
|
| 164 |
|
| 165 |
# 📝 Title for the Gradio interface
|