aje6 commited on
Commit
827caed
·
verified ·
1 Parent(s): b1b22e2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -277,12 +277,16 @@ def predict(image):
277
  # Postprocess output image
278
 
279
  annotated_img = output[0]
 
 
 
 
280
 
281
  # annotated_img = (output[0] / 255.0 - mean)/std
282
  # annotated_img = classes[output[0][0].argmax(0)]
283
 
284
  print("Annotated image type before normalization:", type(annotated_img))
285
- print("annotated_img shape before normalization:", annotated_img.shape)
286
  # print("Annotated image before normalization:", annotated_img)
287
  print("Min value of image before normalization:", np.min(annotated_img))
288
  print("Max value of image before normalization:", np.max(annotated_img))
 
277
  # Postprocess output image
278
 
279
  annotated_img = output[0]
280
+
281
+ # Reshape the image to match the PIL Image input shape
282
+ annotated_img = annotated_img.reshape(640, 640, 3)
283
+ print("annotated_img shape after reshape:", annotated_img.shape)
284
 
285
  # annotated_img = (output[0] / 255.0 - mean)/std
286
  # annotated_img = classes[output[0][0].argmax(0)]
287
 
288
  print("Annotated image type before normalization:", type(annotated_img))
289
+ # print("annotated_img shape before normalization:", annotated_img.shape)
290
  # print("Annotated image before normalization:", annotated_img)
291
  print("Min value of image before normalization:", np.min(annotated_img))
292
  print("Max value of image before normalization:", np.max(annotated_img))