Ahsen Khaliq
commited on
Commit
•
c12ec0f
1
Parent(s):
71b54d1
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,5 @@
|
|
1 |
import os
|
2 |
os.system("git clone https://github.com/facebookresearch/omnivore.git")
|
3 |
-
os.system("pwd")
|
4 |
import json
|
5 |
from typing import List
|
6 |
|
@@ -16,9 +15,10 @@ import gradio as gr
|
|
16 |
# Device on which to run the model
|
17 |
# Set to cuda to load on GPU
|
18 |
device = "cpu"
|
|
|
19 |
# Pick a pretrained model
|
20 |
-
|
21 |
-
model = torch.hub.load("
|
22 |
|
23 |
# Set to eval mode and move to desired device
|
24 |
model = model.to(device)
|
@@ -69,3 +69,4 @@ article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2201.083
|
|
69 |
|
70 |
|
71 |
gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=[['library.jpg']]).launch(enable_queue=True,cache_examples=True)
|
|
|
|
1 |
import os
|
2 |
os.system("git clone https://github.com/facebookresearch/omnivore.git")
|
|
|
3 |
import json
|
4 |
from typing import List
|
5 |
|
|
|
15 |
# Device on which to run the model
|
16 |
# Set to cuda to load on GPU
|
17 |
device = "cpu"
|
18 |
+
|
19 |
# Pick a pretrained model
|
20 |
+
model_name = "omnivore_swinB"
|
21 |
+
model = torch.hub.load("omnivore",source='local', model=model_name,pretrained=False)
|
22 |
|
23 |
# Set to eval mode and move to desired device
|
24 |
model = model.to(device)
|
|
|
69 |
|
70 |
|
71 |
gr.Interface(inference, inputs, outputs, title=title, description=description, article=article, examples=[['library.jpg']]).launch(enable_queue=True,cache_examples=True)
|
72 |
+
|