ymcmy commited on
Commit
8ec9307
·
verified ·
1 Parent(s): 1adb073

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +1 -2
utils.py CHANGED
@@ -8,10 +8,9 @@ def RGB2gray(rgb):
8
  gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
9
  return gray
10
 
11
- # Update img_to_patches to handle direct image input
12
  def img_to_patches(img: PIL.Image.Image) -> tuple:
13
  patch_size = 16
14
- img = img.convert('RGB') # Ensure image is in RGB format
15
 
16
  grayscale_imgs = []
17
  imgs = []
 
8
  gray = 0.2989 * r + 0.5870 * g + 0.1140 * b
9
  return gray
10
 
 
11
  def img_to_patches(img: PIL.Image.Image) -> tuple:
12
  patch_size = 16
13
+ img = img.convert('RGB')
14
 
15
  grayscale_imgs = []
16
  imgs = []