Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -363,17 +363,15 @@ def process_line(img_path='./input', outdir='./output'):
|
|
| 363 |
if __name__ == '__main__':
|
| 364 |
# Gradio 接口代码
|
| 365 |
import gradio as gr
|
| 366 |
-
from PIL import Image
|
| 367 |
|
| 368 |
def gradio_process_line(img):
|
| 369 |
-
|
| 370 |
-
|
| 371 |
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
output_image_path = './output/teed_imgs/processed_image.png' # 更新为实际输出路径
|
| 375 |
-
return Image.open(output_image_path)
|
| 376 |
|
|
|
|
|
|
|
| 377 |
|
| 378 |
# 定义 Gradio 接口
|
| 379 |
iface = gr.Interface(
|
|
@@ -386,7 +384,6 @@ if __name__ == '__main__':
|
|
| 386 |
|
| 387 |
# 启动 Gradio 应用
|
| 388 |
iface.launch()
|
| 389 |
-
|
| 390 |
|
| 391 |
|
| 392 |
|
|
|
|
| 363 |
if __name__ == '__main__':
|
| 364 |
# Gradio 接口代码
|
| 365 |
import gradio as gr
|
|
|
|
| 366 |
|
| 367 |
def gradio_process_line(img):
|
| 368 |
+
img_path = './temp_input.png'
|
| 369 |
+
img.save(img_path)
|
| 370 |
|
| 371 |
+
process_line(img_path, './output')
|
|
|
|
|
|
|
|
|
|
| 372 |
|
| 373 |
+
output_image_path = './output/teed_imgs/processed_image.png' # 更新为实际输出路径
|
| 374 |
+
return Image.open(output_image_path)
|
| 375 |
|
| 376 |
# 定义 Gradio 接口
|
| 377 |
iface = gr.Interface(
|
|
|
|
| 384 |
|
| 385 |
# 启动 Gradio 应用
|
| 386 |
iface.launch()
|
|
|
|
| 387 |
|
| 388 |
|
| 389 |
|