Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,7 @@ def inference(input_img, transparency=0.5, target_layer_number=-1, grad_cam_opti
|
|
54 |
confidences = {classes[i]: float(o[i]) for i in range(10)}
|
55 |
confidences = dict(list(confidences.items())[:top_classes])
|
56 |
_, prediction = torch.max(outputs, 1)
|
|
|
57 |
target_layers = [model.layer2[target_layer_number]]
|
58 |
cam = GradCAM(model=model, target_layers=target_layers)
|
59 |
grayscale_cam = cam(input_tensor=input_img, targets=None)
|
|
|
54 |
confidences = {classes[i]: float(o[i]) for i in range(10)}
|
55 |
confidences = dict(list(confidences.items())[:top_classes])
|
56 |
_, prediction = torch.max(outputs, 1)
|
57 |
+
print('Prediction ',prediction)
|
58 |
target_layers = [model.layer2[target_layer_number]]
|
59 |
cam = GradCAM(model=model, target_layers=target_layers)
|
60 |
grayscale_cam = cam(input_tensor=input_img, targets=None)
|