Spaces:
Runtime error
Runtime error
Commit ·
fa98a90
1
Parent(s): caaa3f7
Update app.py
Browse files
app.py
CHANGED
|
@@ -52,6 +52,7 @@ def get_gradcam_image(input_tensor, label, target_layer):
|
|
| 52 |
def image_classifier(input_image, top_classes=3, show_cam=True, target_layers=[2, 3], transparency=0.5):
|
| 53 |
input_image = transform(image=input_image)
|
| 54 |
#aug(image=image)
|
|
|
|
| 55 |
output = model(input_image)
|
| 56 |
output = F.softmax(output.flatten(), dim=-1)
|
| 57 |
|
|
|
|
| 52 |
def image_classifier(input_image, top_classes=3, show_cam=True, target_layers=[2, 3], transparency=0.5):
|
| 53 |
input_image = transform(image=input_image)
|
| 54 |
#aug(image=image)
|
| 55 |
+
input_image = input_image.unsqueeze(0)
|
| 56 |
output = model(input_image)
|
| 57 |
output = F.softmax(output.flatten(), dim=-1)
|
| 58 |
|