Update app.py
Browse files
app.py
CHANGED
|
@@ -24,8 +24,8 @@ STUMP_WIDTH = 0.2286 # Stump width (including bails)
|
|
| 24 |
|
| 25 |
# Load model
|
| 26 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 27 |
-
model = attempt_load("best.pt"
|
| 28 |
-
model.eval()
|
| 29 |
|
| 30 |
# Function to process video and detect ball
|
| 31 |
def process_video(video_path):
|
|
|
|
| 24 |
|
| 25 |
# Load model
|
| 26 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 27 |
+
model = attempt_load("best.pt") # Load without map_location
|
| 28 |
+
model.to(device).eval() # Move model to device and set to evaluation mode
|
| 29 |
|
| 30 |
# Function to process video and detect ball
|
| 31 |
def process_video(video_path):
|