aje6 commited on
Commit
a1f32fc
·
verified ·
1 Parent(s): c76d781

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -244,8 +244,11 @@ def predict(image):
244
  input_name = model.get_inputs()[0].name
245
  input_shape = model.get_inputs()[0].shape
246
 
 
 
247
  # Resize the image to the model's input shape
248
- image = cv2.resize(image, (640, 640))
 
249
 
250
  # Convert the image to a numpy array and add a batch dimension
251
  image = np.expand_dims(image, axis=0).astype(np.float32)
 
244
  input_name = model.get_inputs()[0].name
245
  input_shape = model.get_inputs()[0].shape
246
 
247
+ print(input_shape)
248
+
249
  # Resize the image to the model's input shape
250
+ # image = cv2.resize(image, (640, 640))
251
+ image = cv2.resize(image, (input_shape[2], input_shape[3]))
252
 
253
  # Convert the image to a numpy array and add a batch dimension
254
  image = np.expand_dims(image, axis=0).astype(np.float32)