Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ import traceback
|
|
| 10 |
# -----------------------------
|
| 11 |
YOLO_MODEL_PATH = "best.pt"
|
| 12 |
yolo_model = YOLO(YOLO_MODEL_PATH)
|
| 13 |
-
|
| 14 |
|
| 15 |
# -----------------------------
|
| 16 |
# 2. Reference alphabet image (WebP)
|
|
@@ -29,7 +29,7 @@ def predict_asl(image):
|
|
| 29 |
|
| 30 |
img = image.copy()
|
| 31 |
|
| 32 |
-
results =
|
| 33 |
pred_idx = results[0].probs.top1
|
| 34 |
pred_label = results[0].names[pred_idx]
|
| 35 |
confidence = results[0].probs.top1conf.item() * 100
|
|
|
|
| 10 |
# -----------------------------
|
| 11 |
YOLO_MODEL_PATH = "best.pt"
|
| 12 |
yolo_model = YOLO(YOLO_MODEL_PATH)
|
| 13 |
+
|
| 14 |
|
| 15 |
# -----------------------------
|
| 16 |
# 2. Reference alphabet image (WebP)
|
|
|
|
| 29 |
|
| 30 |
img = image.copy()
|
| 31 |
|
| 32 |
+
results = yolo_model.predict(str(img_path), imgsz=300, verbose=False)
|
| 33 |
pred_idx = results[0].probs.top1
|
| 34 |
pred_label = results[0].names[pred_idx]
|
| 35 |
confidence = results[0].probs.top1conf.item() * 100
|