cella110n commited on
Commit
93a047b
·
verified ·
1 Parent(s): 3537130

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -96,7 +96,7 @@ def preprocess_image(image: Image.Image, target_size=(448, 448)):
96
  img_array = np.array(image_resized, dtype=np.float32) / 255.0
97
  img_array = img_array.transpose(2, 0, 1) # HWC -> CHW
98
  # Assuming model expects RGB based on original code, no BGR conversion here
99
- # img_array = img_array[::-1, :, :] # BGR conversion if needed
100
  mean = np.array([0.5, 0.5, 0.5], dtype=np.float32).reshape(3, 1, 1)
101
  std = np.array([0.5, 0.5, 0.5], dtype=np.float32).reshape(3, 1, 1)
102
  img_array = (img_array - mean) / std
 
96
  img_array = np.array(image_resized, dtype=np.float32) / 255.0
97
  img_array = img_array.transpose(2, 0, 1) # HWC -> CHW
98
  # Assuming model expects RGB based on original code, no BGR conversion here
99
+ img_array = img_array[::-1, :, :] # BGR conversion if needed - UNCOMMENTED based on user feedback
100
  mean = np.array([0.5, 0.5, 0.5], dtype=np.float32).reshape(3, 1, 1)
101
  std = np.array([0.5, 0.5, 0.5], dtype=np.float32).reshape(3, 1, 1)
102
  img_array = (img_array - mean) / std