Spaces:
Sleeping
Sleeping
Commit
·
3f9d0e4
1
Parent(s):
f7cc1b3
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,7 +49,12 @@ print(f"CUDA available: {torch.cuda.is_available()}")
|
|
| 49 |
# Load custom YOLO model
|
| 50 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 51 |
print(f"Using device: {device}")
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
if device == "cuda":
|
| 54 |
model.half() # Use half-precision (FP16)
|
| 55 |
print(f"Model classes: {model.names}")
|
|
|
|
| 49 |
# Load custom YOLO model
|
| 50 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 51 |
print(f"Using device: {device}")
|
| 52 |
+
|
| 53 |
+
# Model paths
|
| 54 |
+
model_path = '/mnt/data/best.pt' # Path to the custom-trained model
|
| 55 |
+
|
| 56 |
+
# Load the model
|
| 57 |
+
model = YOLO(model_path).to(device) # Updated model path
|
| 58 |
if device == "cuda":
|
| 59 |
model.half() # Use half-precision (FP16)
|
| 60 |
print(f"Model classes: {model.names}")
|