Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -343,6 +343,7 @@ def process_images(input_folder='./output/merged_imgs'):
|
|
| 343 |
print(f"Error processing file {image_file}: {e}")
|
| 344 |
|
| 345 |
def process_line(img, outdir='./output'):
|
|
|
|
| 346 |
img_path = "./input"
|
| 347 |
|
| 348 |
# 确保 img 是一个有效的 NumPy 数组
|
|
@@ -386,11 +387,12 @@ if __name__ == '__main__':
|
|
| 386 |
|
| 387 |
if __name__ == '__main__':
|
| 388 |
# 创建 Gradio 接口
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
|
|
|
| 394 |
|
| 395 |
# 启动 Gradio 接口
|
| 396 |
interface.launch()
|
|
|
|
| 343 |
print(f"Error processing file {image_file}: {e}")
|
| 344 |
|
| 345 |
def process_line(img, outdir='./output'):
|
| 346 |
+
print(f"Received img type: {type(img)}")
|
| 347 |
img_path = "./input"
|
| 348 |
|
| 349 |
# 确保 img 是一个有效的 NumPy 数组
|
|
|
|
| 387 |
|
| 388 |
if __name__ == '__main__':
|
| 389 |
# 创建 Gradio 接口
|
| 390 |
+
interface = gr.Interface(fn=process_line,
|
| 391 |
+
inputs=gr.Image(type="numpy", label="Upload Image"),
|
| 392 |
+
outputs=gr.Image(label="Output Image"),
|
| 393 |
+
title="Image Processing",
|
| 394 |
+
description="Upload an image to process it using depth-anything and TEED.")
|
| 395 |
+
|
| 396 |
|
| 397 |
# 启动 Gradio 接口
|
| 398 |
interface.launch()
|