Skip to content

Commit

Permalink
fix(back): Fix converting BBox coords to float
Browse files Browse the repository at this point in the history
  • Loading branch information
cpvannier committed Dec 8, 2023
1 parent 351dced commit b1e936a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pixano_inference/pytorch_models/maskrcnnv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ def preannotate(
"item_id": batch["id"][x].as_py(),
"view_id": view,
"bbox": BBox.from_xyxy(
[float(coord) for coord in output["boxes"][i]],
confidence=float(output["scores"][i]),
[coord.item() for coord in output["boxes"][i]],
confidence=output["scores"][i].item(),
)
.normalize(h, w)
.to_dict(),
Expand Down
4 changes: 2 additions & 2 deletions pixano_inference/pytorch_models/yolov5.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def preannotate(
"item_id": batch["id"][x].as_py(),
"view_id": view,
"bbox": BBox.from_xyxy(
[float(coord) for coord in pred[0:4]],
confidence=float(pred[4]),
[coord.item() for coord in pred[0:4]],
confidence=pred[4].item(),
)
.normalize(h, w)
.to_dict(),
Expand Down
4 changes: 2 additions & 2 deletions pixano_inference/segment_anything/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ def preannotate(
"item_id": batch["id"][x].as_py(),
"view_id": view,
"bbox": BBox.from_xywh(
[float(coord) for coord in output[i]["bbox"]],
confidence=float(output[i]["predicted_iou"]),
[coord.item() for coord in output[i]["bbox"]],
confidence=output[i]["predicted_iou"].item(),
)
.normalize(h, w)
.to_dict(),
Expand Down

0 comments on commit b1e936a

Please sign in to comment.