Update README

This commit is contained in:
SWHL committed 2022-11-20 16:16:37 +08:00
1 parent 67972d1437
commit 7ee2ac834c
5 files changed
+15 -15

No files matched your search

+1 -5
View File
@@ -132,15 +132,11 @@ class NormalizeImage(object):
class ToCHWImage(object):
""" convert hwc image to chw image
"""
def __init__(self, **kwargs):
pass
def __call__(self, data):
img = data['image']
from PIL import Image
if isinstance(img, Image.Image):
img = np.array(img)
img = np.array(data['image'])
data['image'] = img.transpose((2, 0, 1))
return data