Update image_processing_minicpmv.py

#6
by pranay-ar - opened
Files changed (1) hide show
  1. image_processing_minicpmv.py +7 -2
image_processing_minicpmv.py CHANGED
@@ -393,8 +393,13 @@ class MiniCPMVImageProcessor(BaseImageProcessor):
393
  image_patches = self.get_sliced_images(image, max_slice_nums)
394
  image_patches = [to_numpy_array(image).astype(np.float32) / 255 for image in image_patches]
395
  image_patches = [
396
- self.normalize(image=image, mean=self.mean, std=self.std, input_data_format=input_data_format)
397
- for image in image_patches
 
 
 
 
 
398
  ]
399
  image_patches = [
400
  to_channel_dimension_format(image, ChannelDimension.FIRST, input_channel_dim=input_data_format)
 
393
  image_patches = self.get_sliced_images(image, max_slice_nums)
394
  image_patches = [to_numpy_array(image).astype(np.float32) / 255 for image in image_patches]
395
  image_patches = [
396
+ self.normalize(
397
+ image=image,
398
+ mean=np.array(self.mean).flatten(), # Flatten the mean array
399
+ std=np.array(self.std).flatten(), # Flatten the std array
400
+ input_data_format=input_data_format
401
+ )
402
+ for image in image_patches
403
  ]
404
  image_patches = [
405
  to_channel_dimension_format(image, ChannelDimension.FIRST, input_channel_dim=input_data_format)