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 DetectionRandomAffine target-size to be in row-column format #2012

Merged
Merged
Changes from 1 commit
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
4 changes: 2 additions & 2 deletions src/super_gradients/training/transforms/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ def apply_to_sample(self, sample: DetectionSample) -> DetectionSample:
targets=targets,
targets_seg=None,
crowd_targets=crowd_targets,
target_size=self.target_size or tuple(reversed(sample.image.shape[:2])),
target_size=self.target_size or tuple(sample.image.shape[:2]),
degrees=self.degrees,
translate=self.translate,
scales=self.scale,
Expand Down Expand Up @@ -1510,7 +1510,7 @@ def random_affine(

M = get_affine_matrix(img.shape[:2], target_size, degrees, translate, scales, shear)

img = cv2.warpAffine(img, M, dsize=target_size, borderValue=(border_value, border_value, border_value))
img = cv2.warpAffine(img, M, dsize=target_size[::-1], borderValue=(border_value, border_value, border_value))
cansik marked this conversation as resolved.
Show resolved Hide resolved

# Transform label coordinates
if len(targets) > 0:
Expand Down