Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -54,19 +54,18 @@ def teed_process_image(image):
|
|
| 54 |
temp_image_path = './teed_tmp/temp_image.png'
|
| 55 |
cv2.imwrite(temp_image_path, np.array(image))
|
| 56 |
|
| 57 |
-
|
|
|
|
| 58 |
args.input_val_dir = './teed_tmp' # 临时目录
|
| 59 |
args.output_dir = './output/teed_imgs' # 输出目录
|
| 60 |
|
| 61 |
-
#
|
| 62 |
-
|
| 63 |
-
teed.main(args)
|
| 64 |
-
else:
|
| 65 |
-
print("TEED module does not have a main function.")
|
| 66 |
|
| 67 |
shutil.rmtree('./teed_tmp')
|
| 68 |
return cv2.imread(os.path.join('./output/teed_imgs', 'processed_image.png'))
|
| 69 |
|
|
|
|
| 70 |
# 处理单个图像
|
| 71 |
def process_single_image(image):
|
| 72 |
depth_result = depth_anything_image(image, 'vitl')
|
|
|
|
| 54 |
temp_image_path = './teed_tmp/temp_image.png'
|
| 55 |
cv2.imwrite(temp_image_path, np.array(image))
|
| 56 |
|
| 57 |
+
# 获取解析后的参数
|
| 58 |
+
args, train_info = parse_args(is_testing=True, pl_opt_dir='./output/teed_imgs')
|
| 59 |
args.input_val_dir = './teed_tmp' # 临时目录
|
| 60 |
args.output_dir = './output/teed_imgs' # 输出目录
|
| 61 |
|
| 62 |
+
# 调用 TEED 主函数进行处理
|
| 63 |
+
teed.main(args, train_info)
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
shutil.rmtree('./teed_tmp')
|
| 66 |
return cv2.imread(os.path.join('./output/teed_imgs', 'processed_image.png'))
|
| 67 |
|
| 68 |
+
|
| 69 |
# 处理单个图像
|
| 70 |
def process_single_image(image):
|
| 71 |
depth_result = depth_anything_image(image, 'vitl')
|