aje6 commited on
Commit
7ccf16b
·
verified ·
1 Parent(s): 07be95f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -252,7 +252,7 @@ def predict(image):
252
  # Reshape the image to match the model's input shape
253
  image = image.reshape(3, 640, 640)
254
 
255
- # Normalize the image
256
  mean = [0.485, 0.456, 0.406]
257
  std = [0.229, 0.224, 0.225]
258
  mean = np.expand_dims(mean, axis=(1,2))
@@ -277,15 +277,15 @@ def predict(image):
277
  # Postprocess output image
278
 
279
  annotated_img = output[0]
280
-
281
- print("Output[0] image shape:", annotated_img.shape)
282
 
283
  # annotated_img = (output[0] / 255.0 - mean)/std
284
  # annotated_img = classes[output[0][0].argmax(0)]
285
- print("Annotated image type:", type(annotated_img))
286
- print("Annotated image:", annotated_img)
287
- print("Min value of image:", np.min(annotated_img))
288
- print("Max value of image:", np.max(annotated_img))
 
 
289
 
290
  # # Normalize output image using ImageNet-style normalization (again)
291
  # annotated_img = (annotated_img / 255.0 - mean)/std
@@ -297,7 +297,8 @@ def predict(image):
297
 
298
  print("Min value of image after normalization:", np.min(annotated_img))
299
  print("Max value of image after normalization:", np.max(annotated_img))
300
- print("Type of annotated_img after normalization:", type(annotated_img))
 
301
 
302
  # Convert to PIL Image
303
  # annotated_img = Image.fromarray(annotated_img)
 
252
  # Reshape the image to match the model's input shape
253
  image = image.reshape(3, 640, 640)
254
 
255
+ # Normalize output image using ImageNet-style normalization
256
  mean = [0.485, 0.456, 0.406]
257
  std = [0.229, 0.224, 0.225]
258
  mean = np.expand_dims(mean, axis=(1,2))
 
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))
289
 
290
  # # Normalize output image using ImageNet-style normalization (again)
291
  # annotated_img = (annotated_img / 255.0 - mean)/std
 
297
 
298
  print("Min value of image after normalization:", np.min(annotated_img))
299
  print("Max value of image after normalization:", np.max(annotated_img))
300
+ print("annotated_img type after normalization:", type(annotated_img))
301
+ print("annotated_img shape after normalization:", annotated_img.shape)
302
 
303
  # Convert to PIL Image
304
  # annotated_img = Image.fromarray(annotated_img)