AjaykumarPilla commited on
Commit
bd41d80
·
verified ·
1 Parent(s): 2da76aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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", map_location=device)
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):