Skip to content

Commit ad1f94b

Browse files
committed
modify data format
1 parent 87ddc84 commit ad1f94b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

paddlex/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@
5353

5454
from . import interpret
5555

56-
__version__ = '1.0.1.github'
56+
__version__ = '1.0.2.github'

paddlex/cv/transforms/cls_transforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,8 +259,8 @@ def __call__(self, im, label=None):
259259
im_short_size = min(im.shape[0], im.shape[1])
260260
im_long_size = max(im.shape[0], im.shape[1])
261261
scale = float(self.short_size) / im_short_size
262-
if self.max_size > 0 and np.round(
263-
scale * im_long_size) > self.max_size:
262+
if self.max_size > 0 and np.round(scale *
263+
im_long_size) > self.max_size:
264264
scale = float(self.max_size) / float(im_long_size)
265265
resized_width = int(round(im.shape[1] * scale))
266266
resized_height = int(round(im.shape[0] * scale))
@@ -455,7 +455,7 @@ def __call__(self, im, label=None):
455455
tuple: 当mode为'train'或'eval'时,返回(im, label),分别对应图像np.ndarray数据、
456456
图像类别id;当mode为'test'或'quant'时,返回(im, ),对应图像np.ndarray数据。
457457
"""
458-
im = permute(im, False)
458+
im = permute(im, False).astype('float32')
459459
if self.mode == 'train' or self.mode == 'eval':
460460
outputs = (im, label)
461461
else:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
setuptools.setup(
2121
name="paddlex",
22-
version='1.0.1',
22+
version='1.0.2',
2323
author="paddlex",
2424
author_email="[email protected]",
2525
description=long_description,

0 commit comments

Comments
 (0)