Skip to content

Commit 8d05522

Browse files
committed
Fixing bbox import
1 parent 99217b9 commit 8d05522

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

backend/src/app/core/data/crud/bbox_annotation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def create_bulk(
8282
BBoxAnnotationCreateIntern(
8383
x_max=create_dto.x_max,
8484
y_max=create_dto.y_max,
85-
x_min=create_dto.y_min,
85+
x_min=create_dto.x_min,
8686
y_min=create_dto.y_min,
8787
code_id=create_dto.code_id,
8888
annotation_document_id=adoc_id_by_user_sdoc[

backend/src/app/core/data/import_/import_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def _import_project(
720720
x_min=row["bbox_x_min"],
721721
y_min=row["bbox_y_min"],
722722
x_max=row["bbox_x_max"],
723-
y_max=row["bbox_x_max"],
723+
y_max=row["bbox_y_max"],
724724
user_id=user_email_id_mapping[row["user_email"]],
725725
)
726726
bboxes_for_sdoc.add(bbox)

backend/src/app/preprocessing/pipeline/steps/image/run_object_detection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from loguru import logger
2+
13
from app.core.data.crud.user import SYSTEM_USER_ID
24
from app.preprocessing.pipeline.model.image.autobbox import AutoBBox
35
from app.preprocessing.pipeline.model.image.preproimagedoc import PreProImageDoc
@@ -13,6 +15,7 @@ def run_object_detection(cargo: PipelineCargo) -> PipelineCargo:
1315

1416
input = DETRFilePathInput(image_fp=str(ppid.filepath))
1517
result = rms.detr_object_detection(input)
18+
logger.info(f"Bounding boxes already found are: {ppid.bboxes}")
1619
for box in result.bboxes:
1720
code_name = box.label
1821
bbox = AutoBBox(
@@ -23,8 +26,10 @@ def run_object_detection(cargo: PipelineCargo) -> PipelineCargo:
2326
y_max=box.y_max,
2427
user_id=SYSTEM_USER_ID,
2528
)
29+
logger.info(f" Found bbox by detr with {bbox.model_dump_json(indent=4)}")
2630
if code_name not in ppid.bboxes:
2731
ppid.bboxes[code_name] = set()
2832
ppid.bboxes[code_name].add(bbox)
33+
logger.info(f"Resulted in {ppid.bboxes}")
2934

3035
return cargo

0 commit comments

Comments
 (0)