Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -280,8 +280,13 @@ def predict(image):
|
|
280 |
print("Min value of image:", np.min(annotated_img))
|
281 |
print("Max value of image:", np.max(annotated_img))
|
282 |
|
283 |
-
# Normalize output image (again)
|
284 |
-
annotated_img = (annotated_img / 255.0 - mean)/std
|
|
|
|
|
|
|
|
|
|
|
285 |
|
286 |
print("Min value of image after normalization:", np.min(annotated_img))
|
287 |
print("Max value of image after normalization:", np.max(annotated_img))
|
|
|
280 |
print("Min value of image:", np.min(annotated_img))
|
281 |
print("Max value of image:", np.max(annotated_img))
|
282 |
|
283 |
+
# # Normalize output image using ImageNet-style normalization (again)
|
284 |
+
# annotated_img = (annotated_img / 255.0 - mean)/std
|
285 |
+
|
286 |
+
# Normalize output image using Min-Max normalization
|
287 |
+
min_val = np.min(annotated_img)
|
288 |
+
max_val = np.max(annotated_img)
|
289 |
+
annotated_img = (annotated_img - min_val) / (max_val - min_val)
|
290 |
|
291 |
print("Min value of image after normalization:", np.min(annotated_img))
|
292 |
print("Max value of image after normalization:", np.max(annotated_img))
|