Skip to content

Commit 91333dc

Browse files
authored
Update image_batch.py
fix int8 bugs
1 parent 8c9189e commit 91333dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

image_batch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def resize_pad(image, pad_color=(0, 0, 0)):
151151
sys.exit(1)
152152
if self.format == "NCHW":
153153
image = np.transpose(image, (2, 0, 1))
154-
return image, scale
154+
return image/255., scale
155155

156156
def get_batch(self):
157157
"""
@@ -169,4 +169,4 @@ def get_batch(self):
169169
self.image_index += 1
170170
batch_data[i], batch_scales[i] = self.preprocess_image(image)
171171
self.batch_index += 1
172-
yield batch_data, batch_images, batch_scales
172+
yield batch_data, batch_images, batch_scales

0 commit comments

Comments
 (0)