hasibzunair commited on
Commit
00a9f3d
ยท
1 Parent(s): b59fa64

update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,7 +30,7 @@ if not os.path.exists("./models/masksupnyu39.31d.pth"):
30
 
31
  # Load model
32
  model = NestedUNet(num_classes=40)
33
- checkpoint = torch.load("./models/masksupnyu39.31d.pth")
34
  model.load_state_dict(checkpoint)
35
  model = model.to(DEVICE)
36
  model.eval()
@@ -64,8 +64,8 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2210.009
64
 
65
  gr.Interface(
66
  inference,
67
- gr.inputs.Image(type='file', label="Input Image"),
68
- gr.outputs.Image(type="file", label="Predicted Output"),
69
  examples=["./sample_images/a.png", "./sample_images/b.png",
70
  "./sample_images/c.png", "./sample_images/d.png"],
71
  title=title,
 
30
 
31
  # Load model
32
  model = NestedUNet(num_classes=40)
33
+ checkpoint = torch.load("./models/masksupnyu39.31d.pth", map_location=torch.device('cpu'))
34
  model.load_state_dict(checkpoint)
35
  model = model.to(DEVICE)
36
  model.eval()
 
64
 
65
  gr.Interface(
66
  inference,
67
+ gr.inputs.Image(type='filepath', label="Input Image"),
68
+ gr.outputs.Image(type="filepath", label="Predicted Output"),
69
  examples=["./sample_images/a.png", "./sample_images/b.png",
70
  "./sample_images/c.png", "./sample_images/d.png"],
71
  title=title,