added normalization code
Browse files
app.py
CHANGED
|
@@ -26,7 +26,11 @@ def inference(input_img, transparency = 0.5, target_layer_number = -1, num_top_c
|
|
| 26 |
top: Top Classes and Confidence level of the prediction
|
| 27 |
visualization: Grad Cam output
|
| 28 |
"""
|
| 29 |
-
transform = transforms.ToTensor()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
org_img = input_img
|
| 31 |
input_img = transform(input_img)
|
| 32 |
# input_img = input_img
|
|
|
|
| 26 |
top: Top Classes and Confidence level of the prediction
|
| 27 |
visualization: Grad Cam output
|
| 28 |
"""
|
| 29 |
+
# transform = transforms.ToTensor()
|
| 30 |
+
transform = transforms.Compose([
|
| 31 |
+
transforms.ToTensor(),
|
| 32 |
+
transforms.Normalize((0.1307,), (0.3081,))
|
| 33 |
+
])
|
| 34 |
org_img = input_img
|
| 35 |
input_img = transform(input_img)
|
| 36 |
# input_img = input_img
|