rsortino commited on
Commit
4803b10
·
verified ·
1 Parent(s): fa2ea88

Update tasks/image.py

Browse files
Files changed (1) hide show
  1. tasks/image.py +3 -3
tasks/image.py CHANGED
@@ -96,8 +96,8 @@ async def evaluate_image(request: ImageEvaluationRequest):
96
  test_dataset = train_test["test"]
97
 
98
  model = YOLOv10("best.pt")
99
- device = "cuda" if torch.cuda.is_available() else "cpu"
100
- model = model.to(device)
101
 
102
  # Start tracking emissions
103
  tracker.start()
@@ -122,7 +122,7 @@ async def evaluate_image(request: ImageEvaluationRequest):
122
  # Make prediction with model
123
  image = example['image']
124
  with torch.inference_mode():
125
- pred = model(image, conf=0.03)[0]
126
  smoke_detected = pred.boxes.xywhn.shape[0] > 0
127
  predictions.append(int(smoke_detected))
128
 
 
96
  test_dataset = train_test["test"]
97
 
98
  model = YOLOv10("best.pt")
99
+ #device = "cuda" if torch.cuda.is_available() else "cpu"
100
+ #model = model.to(device)
101
 
102
  # Start tracking emissions
103
  tracker.start()
 
122
  # Make prediction with model
123
  image = example['image']
124
  with torch.inference_mode():
125
+ pred = model(image, conf=0.03, imgsz=1280)[0]
126
  smoke_detected = pred.boxes.xywhn.shape[0] > 0
127
  predictions.append(int(smoke_detected))
128