Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import subprocess
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
|
| 7 |
|
| 8 |
|
|
@@ -10,9 +10,9 @@ import gradio as gr
|
|
| 10 |
|
| 11 |
from UniVAD.tools import process_image
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
import torch
|
| 18 |
import torchvision.transforms as transforms
|
|
@@ -33,7 +33,7 @@ from UniVAD.models.grounded_sam import (
|
|
| 33 |
|
| 34 |
|
| 35 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 36 |
-
image_size =
|
| 37 |
univad_model = UniVAD(image_size=image_size).to(device)
|
| 38 |
|
| 39 |
|
|
|
|
| 1 |
import subprocess
|
| 2 |
|
| 3 |
+
subprocess.run(["pip", "install", "-e", "./models/GroundingDINO"])
|
| 4 |
+
subprocess.run(["pip", "install", "gradio==4.21.0"])
|
| 5 |
+
subprocess.run(["pip", "install", "fastapi==0.108.0"])
|
| 6 |
|
| 7 |
|
| 8 |
|
|
|
|
| 10 |
|
| 11 |
from UniVAD.tools import process_image
|
| 12 |
|
| 13 |
+
subprocess.run(["wget", "-q","https://github.com/IDEA-Research/GroundingDINO/releases/download/v0.1.0-alpha/groundingdino_swint_ogc.pth"], check=True)
|
| 14 |
+
subprocess.run(["wget", "-q","https://huggingface.co/xinyu1205/recognize-anything-plus-model/resolve/main/ram_plus_swin_large_14m.pth"], check=True)
|
| 15 |
+
subprocess.run(["wget", "-q","https://huggingface.co/lkeab/hq-sam/resolve/main/sam_hq_vit_h.pth"], check=True)
|
| 16 |
|
| 17 |
import torch
|
| 18 |
import torchvision.transforms as transforms
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 36 |
+
image_size = 335
|
| 37 |
univad_model = UniVAD(image_size=image_size).to(device)
|
| 38 |
|
| 39 |
|