Update app.py
Browse files
app.py
CHANGED
|
@@ -9,12 +9,12 @@ try:
|
|
| 9 |
model = YOLO("comic-panels-and-text-detect.pt")
|
| 10 |
except Exception as e:
|
| 11 |
model = None
|
| 12 |
-
print(f"Failed to load model. Please ensure '
|
| 13 |
|
| 14 |
# 2. Define AI Inference Logic
|
| 15 |
def predict_comic(input_image):
|
| 16 |
if model is None:
|
| 17 |
-
return None, "Error: '
|
| 18 |
|
| 19 |
if input_image is None:
|
| 20 |
return None, "Please upload an image first."
|
|
|
|
| 9 |
model = YOLO("comic-panels-and-text-detect.pt")
|
| 10 |
except Exception as e:
|
| 11 |
model = None
|
| 12 |
+
print(f"Failed to load model. Please ensure 'comic-panels-and-text-detect.pt' is uploaded. Error: {e}")
|
| 13 |
|
| 14 |
# 2. Define AI Inference Logic
|
| 15 |
def predict_comic(input_image):
|
| 16 |
if model is None:
|
| 17 |
+
return None, "Error: 'comic-panels-and-text-detect.pt' weights file not found. Please upload it to your Space root."
|
| 18 |
|
| 19 |
if input_image is None:
|
| 20 |
return None, "Please upload an image first."
|