Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,9 +12,9 @@ import json
|
|
| 12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 13 |
print(f"Using {device} device")
|
| 14 |
|
| 15 |
-
model_path = './
|
| 16 |
-
num_classes =
|
| 17 |
-
label_name_list =
|
| 18 |
|
| 19 |
# step1: 创建并加载模型
|
| 20 |
resnet18 = models.resnet18(pretrained=False)
|
|
@@ -71,7 +71,7 @@ demo = gr.Interface(fn=predict,
|
|
| 71 |
inputs=gr.Image(type="pil"),
|
| 72 |
|
| 73 |
outputs="text",
|
| 74 |
-
examples=["./
|
| 75 |
)
|
| 76 |
|
| 77 |
# demo.launch(debug=True)
|
|
|
|
| 12 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 13 |
print(f"Using {device} device")
|
| 14 |
|
| 15 |
+
model_path = './resnet18.pth'
|
| 16 |
+
num_classes = 4
|
| 17 |
+
label_name_list =['glioma_tumor', 'meningioma_tumor', 'no_tumor', 'pituitary_tumor']
|
| 18 |
|
| 19 |
# step1: 创建并加载模型
|
| 20 |
resnet18 = models.resnet18(pretrained=False)
|
|
|
|
| 71 |
inputs=gr.Image(type="pil"),
|
| 72 |
|
| 73 |
outputs="text",
|
| 74 |
+
examples=["./image_glioma_tumor.jpg"],
|
| 75 |
)
|
| 76 |
|
| 77 |
# demo.launch(debug=True)
|