Update base.py

This commit is contained in:
PENGUINLIONG 2025-04-24 09:01:18 +08:00 committed by GitHub
parent fdedf86e56
commit 112e76d3cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -41,7 +41,7 @@ class BaseSession:
im = img.convert("RGB").resize(size, Image.Resampling.LANCZOS)
im_ary = np.array(im)
im_ary = im_ary / np.max(im_ary)
im_ary = im_ary / max(np.max(im_ary), 1e-6)
tmpImg = np.zeros((im_ary.shape[0], im_ary.shape[1], 3))
tmpImg[:, :, 0] = (im_ary[:, :, 0] - mean[0]) / std[0]