diff --git a/pixano_inference/pytorch_models/maskrcnnv2.py b/pixano_inference/pytorch_models/maskrcnnv2.py index 7d90d77..a096166 100644 --- a/pixano_inference/pytorch_models/maskrcnnv2.py +++ b/pixano_inference/pytorch_models/maskrcnnv2.py @@ -128,7 +128,7 @@ def preannotate( "item_id": batch["id"][x].as_py(), "view_id": view, "bbox": BBox.from_xyxy( - list(output["boxes"][i]), + [float(coord) for coord in output["boxes"][i]], confidence=float(output["scores"][i]), ) .normalize(h, w) diff --git a/pixano_inference/pytorch_models/yolov5.py b/pixano_inference/pytorch_models/yolov5.py index 8642450..32fcdd0 100644 --- a/pixano_inference/pytorch_models/yolov5.py +++ b/pixano_inference/pytorch_models/yolov5.py @@ -98,7 +98,8 @@ def preannotate( "item_id": batch["id"][x].as_py(), "view_id": view, "bbox": BBox.from_xyxy( - list(pred[0:4]), confidence=float(pred[4]) + [float(coord) for coord in pred[0:4]], + confidence=float(pred[4]), ) .normalize(h, w) .to_dict(), diff --git a/pixano_inference/segment_anything/sam.py b/pixano_inference/segment_anything/sam.py index 25dba06..4fc22de 100644 --- a/pixano_inference/segment_anything/sam.py +++ b/pixano_inference/segment_anything/sam.py @@ -114,7 +114,7 @@ def preannotate( "item_id": batch["id"][x].as_py(), "view_id": view, "bbox": BBox.from_xywh( - output[i]["bbox"], + [float(coord) for coord in output[i]["bbox"]], confidence=float(output[i]["predicted_iou"]), ) .normalize(h, w) diff --git a/pixano_inference/tensorflow_models/efficientdet.py b/pixano_inference/tensorflow_models/efficientdet.py index e2cff33..e882ebe 100644 --- a/pixano_inference/tensorflow_models/efficientdet.py +++ b/pixano_inference/tensorflow_models/efficientdet.py @@ -93,10 +93,10 @@ def preannotate( "view_id": view, "bbox": BBox.from_xyxy( [ - output["detection_boxes"][0][i][1], - output["detection_boxes"][0][i][0], - output["detection_boxes"][0][i][3], - output["detection_boxes"][0][i][2], + float(output["detection_boxes"][0][i][1]), + float(output["detection_boxes"][0][i][0]), + float(output["detection_boxes"][0][i][3]), + float(output["detection_boxes"][0][i][2]), ], confidence=float(output["detection_scores"][0][i]), ).to_dict(), diff --git a/pixano_inference/tensorflow_models/fasterrcnn.py b/pixano_inference/tensorflow_models/fasterrcnn.py index f010629..9389c8a 100644 --- a/pixano_inference/tensorflow_models/fasterrcnn.py +++ b/pixano_inference/tensorflow_models/fasterrcnn.py @@ -95,10 +95,10 @@ def preannotate( "view_id": view, "bbox": BBox.from_xyxy( [ - output["detection_boxes"][0][i][1], - output["detection_boxes"][0][i][0], - output["detection_boxes"][0][i][3], - output["detection_boxes"][0][i][2], + float(output["detection_boxes"][0][i][1]), + float(output["detection_boxes"][0][i][0]), + float(output["detection_boxes"][0][i][3]), + float(output["detection_boxes"][0][i][2]), ], confidence=float(output["detection_scores"][0][i]), ).to_dict(),