Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,6 +8,7 @@ from pytorch_grad_cam import GradCAM
|
|
| 8 |
from pytorch_grad_cam.utils.image import show_cam_on_image
|
| 9 |
from resnet_lightning import ResNet18Model
|
| 10 |
import gradio as gr
|
|
|
|
| 11 |
|
| 12 |
model = ResNet18Model.load_from_checkpoint("epoch=19-step=3920.ckpt")
|
| 13 |
|
|
@@ -55,7 +56,7 @@ def inference(input_img, transparancy = 0.5, target_layer_number = -1):
|
|
| 55 |
|
| 56 |
return classes[prediction[0].item(),visualization,confidences]
|
| 57 |
|
| 58 |
-
demo =
|
| 59 |
inference,
|
| 60 |
inputs = [
|
| 61 |
gr.Image(width=256,height=256,label="input image"),
|
|
|
|
| 8 |
from pytorch_grad_cam.utils.image import show_cam_on_image
|
| 9 |
from resnet_lightning import ResNet18Model
|
| 10 |
import gradio as gr
|
| 11 |
+
from gradio import Inference
|
| 12 |
|
| 13 |
model = ResNet18Model.load_from_checkpoint("epoch=19-step=3920.ckpt")
|
| 14 |
|
|
|
|
| 56 |
|
| 57 |
return classes[prediction[0].item(),visualization,confidences]
|
| 58 |
|
| 59 |
+
demo = Inference(
|
| 60 |
inference,
|
| 61 |
inputs = [
|
| 62 |
gr.Image(width=256,height=256,label="input image"),
|