Spaces:
Running
Running
Brightttttt
commited on
Commit
•
9694153
1
Parent(s):
f01ec5b
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ classes=["Other","Anger","Contempt","Happiness","Surprise"]
|
|
14 |
# load a resnet18 model pretrained on ImageNet
|
15 |
# and turn off autograd on model's parameters
|
16 |
def load_model(idx):
|
17 |
-
model = torch.jit.load('
|
18 |
for param in model.parameters():
|
19 |
param.requires_grad = False
|
20 |
return model
|
@@ -68,7 +68,7 @@ def main():
|
|
68 |
with gr.Box():
|
69 |
input_image = gr.Image(type="pil", label="Input Image")
|
70 |
example_images = gr.Dataset(components=[input_image],
|
71 |
-
samples=[['
|
72 |
,type="index")
|
73 |
|
74 |
with gr.Row():
|
|
|
14 |
# load a resnet18 model pretrained on ImageNet
|
15 |
# and turn off autograd on model's parameters
|
16 |
def load_model(idx):
|
17 |
+
model = torch.jit.load('model_2_60acc.pt',map_location=torch.device('cpu')).eval()
|
18 |
for param in model.parameters():
|
19 |
param.requires_grad = False
|
20 |
return model
|
|
|
68 |
with gr.Box():
|
69 |
input_image = gr.Image(type="pil", label="Input Image")
|
70 |
example_images = gr.Dataset(components=[input_image],
|
71 |
+
samples=[['ogtest0.png'],['ogtest1.png'],['ogtest2.png'],['ogtest3.png'],['ogtest4.png'],['ogtest5.png']]
|
72 |
,type="index")
|
73 |
|
74 |
with gr.Row():
|