Skip to content

Commit

Permalink
[Fix] Fix RandomCrop bug (open-mmlab#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezra-Yu authored Jul 11, 2023
1 parent ae7a7b7 commit 78d0ddc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmpretrain/datasets/transforms/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def rand_crop_params(self, img: np.ndarray):
return 0, 0, h, w
elif w < target_w or h < target_h:
target_w = min(w, target_w)
target_h = min(w, target_h)
target_h = min(h, target_h)

offset_h = np.random.randint(0, h - target_h + 1)
offset_w = np.random.randint(0, w - target_w + 1)
Expand Down

0 comments on commit 78d0ddc

Please sign in to comment.