未验证 提交 51da41ce 编写于 作者: J Jason 提交者: GitHub

Merge pull request #16 from SunAhong1993/develop

fix the cpu memory bug
......@@ -40,6 +40,10 @@ class Compose:
raise ValueError('The length of transforms ' + \
'must be equal or larger than 1!')
self.transforms = transforms
self.use_mixup = False
for t in self.transforms:
if t.__class__.__name__ == 'MixupImage':
self.use_mixup = True
def __call__(self, im, im_info=None, label_info=None):
"""
......@@ -85,6 +89,9 @@ class Compose:
# copy augment_shape from origin_shape
im_info['augment_shape'] = np.array([im.shape[0],
im.shape[1]]).astype('int32')
if not self.use_mixup:
if 'mixup' in im_info:
del im_info['mixup']
# decode mixup image
if 'mixup' in im_info:
im_info['mixup'] = \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册