add initial app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import torch
|
2 |
+
import timm
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
"""
|
6 |
+
from ViT.ViT_new import vit_base_patch16_224 as vit
|
7 |
+
|
8 |
+
model = vit(pretrained=True).cuda()
|
9 |
+
model.eval()
|
10 |
+
model_finetuned = vit().cuda()
|
11 |
+
checkpoint = torch.load('ar_base.tar')
|
12 |
+
model_finetuned.load_state_dict(checkpoint['state_dict'])
|
13 |
+
model_finetuned.eval()
|
14 |
+
|
15 |
+
iface_orig = gr.Interface(
|
16 |
+
)
|
17 |
+
"""
|
18 |
+
|
19 |
+
def image_classifier(inp):
|
20 |
+
pass # image classifier model defined here
|
21 |
+
|
22 |
+
demo = gr.Interface(image_classifier, "image", "label")
|
23 |
+
demo.launch(share=True)
|