Skip to content

Commit

Permalink
Update random_erasing.py
Browse files Browse the repository at this point in the history
  • Loading branch information
layumi authored Dec 2, 2021
1 parent f11eab0 commit 1515290
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions random_erasing.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
from __future__ import absolute_import
import torch

from torchvision.transforms import *

#from PIL import Image
import random
import math
#import numpy as np
#import torch

class RandomErasing(object):
""" Randomly selects a rectangle region in an image and erases its pixels.
Expand Down Expand Up @@ -74,7 +72,7 @@ def __init__(self, probability: float = 0.2, sl: float = 0.02, sh: float = 0.4,
self.sh = sh
self.r1 = r1

def __call__(self, img: torch.Tensor) -> torch.Tensor:
def __call__(self, img):
"""
Args:
img: after ToTensor() and Normalize([...]), img's type is Tensor
Expand Down

0 comments on commit 1515290

Please sign in to comment.