Skip to content

Commit

Permalink
Fix: update random_rain.py (kornia#2514)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-amerehi authored and cjpurackal committed Oct 20, 2023
1 parent fd98626 commit 8669a67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kornia/augmentation/_2d/intensity/random_rain.py
Expand Up @@ -63,7 +63,7 @@ def apply_transform(
bool(torch.all(torch.abs(params['drop_width_factor']) <= image.shape[3])),
"Width of drop should be less than image width.",
)

modeified_img = image.clone()
for i in range(image.shape[0]):
number_of_drops: int = int(params['number_of_drops_factor'][i])
# We generate tensor with maximum number of drops, and then remove unnecessary drops.
Expand All @@ -87,5 +87,5 @@ def apply_transform(
y = torch.linspace(start=0, end=width_of_drop, steps=size_of_line, dtype=torch.long).to(image.device)
# Draw lines
for k in range(x.shape[0]):
image[i, :, coords[0] + x[k], coords[1] + y[k]] = 200 / 255
return image
modeified_img[i, :, coords[0] + x[k], coords[1] + y[k]] = 200 / 255
return modeified_img

0 comments on commit 8669a67

Please sign in to comment.