Kalbe-x-Bangkit commited on
Commit
bd4caee
·
verified ·
1 Parent(s): 1cf1002

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -54,7 +54,9 @@ def load_model_detection():
54
 
55
  def preprocess_image(image):
56
  """ Preprocess the image to the required size and normalization. """
57
- image = cv2.resize(image, (W==320, H==320))
 
 
58
  image = (image - 127.5) / 127.5 # Normalize to [-1, +1]
59
  image = np.expand_dims(image, axis=0).astype(np.float32)
60
  return image
 
54
 
55
  def preprocess_image(image):
56
  """ Preprocess the image to the required size and normalization. """
57
+ W = 320
58
+ H = 320
59
+ image = cv2.resize(image, (W, H))
60
  image = (image - 127.5) / 127.5 # Normalize to [-1, +1]
61
  image = np.expand_dims(image, axis=0).astype(np.float32)
62
  return image