Drazcat-AI commited on
Commit
7d0cab7
·
verified ·
1 Parent(s): cfab5c3

Update handler.py

Browse files
Files changed (1) hide show
  1. handler.py +10 -0
handler.py CHANGED
@@ -17,6 +17,15 @@ class EndpointHandler():
17
  cords = [round(x) for x in cords]
18
  conf = box.conf[0].item()
19
  prediction = {
 
 
 
 
 
 
 
 
 
20
  "x": round(cords[0]),
21
  "y": round(cords[1]),
22
  "width": round(cords[2]),
@@ -24,6 +33,7 @@ class EndpointHandler():
24
  "confidence": conf,
25
  "class": class_id
26
  }
 
27
  predictions.append(prediction)
28
  predictions_array = {"predictions": predictions}
29
 
 
17
  cords = [round(x) for x in cords]
18
  conf = box.conf[0].item()
19
  prediction = {
20
+ "x": round(cords[0]*image_size_m[0]),
21
+ "y": round(cords[1]*image_size_m[1]),
22
+ "width": round(cords[2]*image_size_m[0]),
23
+ "height": round(cords[3]*image_size_m[1]),
24
+ "confidence": conf,
25
+ "class": class_id
26
+ }
27
+ """
28
+ prediction = {
29
  "x": round(cords[0]),
30
  "y": round(cords[1]),
31
  "width": round(cords[2]),
 
33
  "confidence": conf,
34
  "class": class_id
35
  }
36
+ """
37
  predictions.append(prediction)
38
  predictions_array = {"predictions": predictions}
39