azhongai666666 commited on
Commit
819769a
·
verified ·
1 Parent(s): e3f9696

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 = './model_danger_pose.pth'
16
- num_classes = 10
17
- label_name_list = ['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9']
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=["./pic1.jpg"],
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)