Skip to content

Commit

Permalink
fix random resized crop part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewilyas committed Feb 28, 2023
1 parent 0445722 commit 25c9700
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ffcv/transforms/utils/fast_crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def resize_crop(source, start_row, end_row, start_col, end_col, destination):
@njit(parallel=False, fastmath=True, inline='always')
def get_random_crop(height, width, scale, ratio):
area = height * width
log_ratio = np.log(np.array(ratio))
log_ratio = np.log(ratio)
for _ in range(10):
target_area = area * np.random.uniform(scale[0], scale[1])
aspect_ratio = np.exp(np.random.uniform(log_ratio[0], log_ratio[1]))
Expand Down Expand Up @@ -48,4 +48,4 @@ def get_center_crop(height, width, ratio):
delta_h = (height - c) // 2
delta_w = (width - c) // 2

return delta_h, delta_w, c, c
return delta_h, delta_w, c, c

0 comments on commit 25c9700

Please sign in to comment.