Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import torch
|
2 |
-
|
3 |
-
model.eval()
|
4 |
# Download an example image from the pytorch website
|
5 |
import urllib
|
6 |
url, filename = ("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
|
@@ -13,6 +12,10 @@ import gradio as gr
|
|
13 |
import matplotlib.pyplot as plt
|
14 |
|
15 |
|
|
|
|
|
|
|
|
|
16 |
def inference(input_image):
|
17 |
preprocess = transforms.Compose([
|
18 |
transforms.ToTensor(),
|
|
|
1 |
import torch
|
2 |
+
|
|
|
3 |
# Download an example image from the pytorch website
|
4 |
import urllib
|
5 |
url, filename = ("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
|
|
|
12 |
import matplotlib.pyplot as plt
|
13 |
|
14 |
|
15 |
+
|
16 |
+
model = torch.hub.load('pytorch/vision:v0.9.0', 'fcn_resnet101', pretrained=True)
|
17 |
+
|
18 |
+
|
19 |
def inference(input_image):
|
20 |
preprocess = transforms.Compose([
|
21 |
transforms.ToTensor(),
|