Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,15 +3,24 @@ import matplotlib.pyplot as plt
|
|
| 3 |
import pandas as pd
|
| 4 |
import seaborn as sns
|
| 5 |
from ultralytics import YOLO
|
|
|
|
| 6 |
|
| 7 |
# Path to your model file
|
| 8 |
-
MODEL_PATH = "
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
# Load YOLO model
|
| 11 |
model = YOLO(MODEL_PATH)
|
| 12 |
|
| 13 |
-
# Example prediction
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Print results
|
| 17 |
for r in results:
|
|
|
|
| 3 |
import pandas as pd
|
| 4 |
import seaborn as sns
|
| 5 |
from ultralytics import YOLO
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
# Path to your model file
|
| 9 |
+
MODEL_PATH = "Model/EvoSEGA/evoSEGA.pt" # Update path to match your repo
|
| 10 |
+
|
| 11 |
+
# Check if model exists
|
| 12 |
+
if not os.path.exists(MODEL_PATH):
|
| 13 |
+
raise FileNotFoundError(f"Model file not found at {MODEL_PATH}")
|
| 14 |
|
| 15 |
# Load YOLO model
|
| 16 |
model = YOLO(MODEL_PATH)
|
| 17 |
|
| 18 |
+
# Example prediction
|
| 19 |
+
TEST_IMAGE = "test.jpg"
|
| 20 |
+
if not os.path.exists(TEST_IMAGE):
|
| 21 |
+
raise FileNotFoundError(f"Test image not found at {TEST_IMAGE}")
|
| 22 |
+
|
| 23 |
+
results = model(TEST_IMAGE)
|
| 24 |
|
| 25 |
# Print results
|
| 26 |
for r in results:
|