Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -347,6 +347,13 @@ def process_line(img, outdir='./output'):
|
|
| 347 |
|
| 348 |
# 检查输入是否为字符串路径
|
| 349 |
if isinstance(img, str):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 350 |
img = cv2.imread(img) # 读取图像文件
|
| 351 |
if img is None:
|
| 352 |
raise ValueError("Failed to read the image. Check the file path.")
|
|
|
|
| 347 |
|
| 348 |
# 检查输入是否为字符串路径
|
| 349 |
if isinstance(img, str):
|
| 350 |
+
# 打印尝试读取的路径
|
| 351 |
+
print(f"Trying to read image from: {img}")
|
| 352 |
+
|
| 353 |
+
# 检查文件是否存在
|
| 354 |
+
if not os.path.isfile(img):
|
| 355 |
+
raise ValueError(f"The file {img} does not exist.")
|
| 356 |
+
|
| 357 |
img = cv2.imread(img) # 读取图像文件
|
| 358 |
if img is None:
|
| 359 |
raise ValueError("Failed to read the image. Check the file path.")
|