Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing filename in _reimport_poses #10

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions dagshub_annotation_converter/formats/label_studio/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
category: Optional[str] = None
image_width: Optional[int] = None
image_height: Optional[int] = None
filename: Optional[str] = None
if maybe_bbox is None:
logger.warning(
f"Bounding box of pose with annotation ID {bbox_id} "
Expand All @@ -155,6 +156,7 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
category = bbox.ensure_has_one_category()
image_height = bbox.image_height
image_width = bbox.image_width
filename = bbox.filename
annotations_to_remove.add(bbox_id)
# Fetch the points
points: List[IRPosePoint] = []
Expand All @@ -176,6 +178,8 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
image_width = maybe_point.image_width
if image_height is None:
image_height = maybe_point.image_height
if filename is None:
filename = maybe_point.filename
points.extend(maybe_point.points)
annotations_to_remove.add(point_id)

Expand All @@ -193,6 +197,7 @@ def _reimport_poses(self, annotations: List[IRImageAnnotationBase]) -> List[IRIm
coordinate_style=CoordinateStyle.NORMALIZED,
image_width=image_width,
image_height=image_height,
filename=filename,
)
if bbox is not None:
sum_annotation.width = bbox.width
Expand Down