Spaces:
Runtime error
Runtime error
Commit
β’
8ad7701
1
Parent(s):
c06886a
Update inference.py
Browse files- inference.py +2 -2
inference.py
CHANGED
@@ -297,8 +297,8 @@ def do_confidence_boost(inference, safe_preds, gp=None, batch_size=BATCH_SIZE, b
|
|
297 |
def boost_frame(safe_frame, base_frame, dt, power=1, decay=1):
|
298 |
safe_boxes = safe_frame[:, :4]
|
299 |
boxes = xywh2xyxy(base_frame[:, :4]) # center_x, center_y, width, height) to (x1, y1, x2, y2)β
|
300 |
-
ious = box_iou(boxes.double(), safe_boxes)
|
301 |
-
score = torch.matmul(ious
|
302 |
# score = iou(safe_box, base_box) * confidence(safe_box)
|
303 |
base_frame[:, 4] *= 1 + power*(score)*math.exp(-decay*(dt*dt-1))
|
304 |
return base_frame
|
|
|
297 |
def boost_frame(safe_frame, base_frame, dt, power=1, decay=1):
|
298 |
safe_boxes = safe_frame[:, :4]
|
299 |
boxes = xywh2xyxy(base_frame[:, :4]) # center_x, center_y, width, height) to (x1, y1, x2, y2)β
|
300 |
+
ious = box_iou(boxes.double(), safe_boxes).float()
|
301 |
+
score = torch.matmul(ious, safe_frame[:, 4])
|
302 |
# score = iou(safe_box, base_box) * confidence(safe_box)
|
303 |
base_frame[:, 4] *= 1 + power*(score)*math.exp(-decay*(dt*dt-1))
|
304 |
return base_frame
|