未验证 提交 ecc33160 编写于 作者: W wangxinxin08 提交者: GitHub

modify gridmask op (#2692)

上级 085791a2
......@@ -45,7 +45,8 @@ class Gridmask(object):
self.prob = self.st_prob * min(1, 1.0 * curr_iter / self.upper_iter)
if np.random.rand() > self.prob:
return x
h, w, _ = x.shape
# image should be C, H, W format
_, h, w = x.shape
hh = int(1.5 * h)
ww = int(1.5 * w)
d = np.random.randint(2, h)
......
......@@ -45,7 +45,8 @@ class GridMask(object):
self.prob = self.st_prob * min(1, 1.0 * curr_iter / self.upper_iter)
if np.random.rand() > self.prob:
return x
h, w, _ = x.shape
# image should be C, H, W format
_, h, w = x.shape
hh = int(1.5 * h)
ww = int(1.5 * w)
d = np.random.randint(2, h)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册