Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import os
|
2 |
os.system("pip install git+https://github.com/facebookresearch/detectron2.git")
|
3 |
os.system("git clone https://github.com/Visual-AI/Mr.DETR.git MrDETR && cd MrDETR && rm -f requirements.txt && cd ..")
|
@@ -12,11 +13,15 @@ from detectron2.config import LazyConfig, instantiate
|
|
12 |
import numpy as np
|
13 |
from PIL import Image
|
14 |
|
|
|
15 |
if __name__ == "__main__":
|
16 |
gr.close_all()
|
17 |
cfg = LazyConfig.load("MrDETR/projects/mr_detr_align/configs/deformable_detr_swinl_two_stage_12ep_plusplus.py")
|
18 |
cfg["model"].device = "cuda"
|
19 |
cfg["train"].device = "cuda"
|
|
|
|
|
|
|
20 |
model = instantiate(cfg.model)
|
21 |
checkpointer = DetectionCheckpointer(model)
|
22 |
checkpointer.load("https://github.com/Visual-AI/Mr.DETR/releases/download/weights/MrDETR_align_swinL_12ep_900q_safe.pth")
|
|
|
1 |
+
import spaces
|
2 |
import os
|
3 |
os.system("pip install git+https://github.com/facebookresearch/detectron2.git")
|
4 |
os.system("git clone https://github.com/Visual-AI/Mr.DETR.git MrDETR && cd MrDETR && rm -f requirements.txt && cd ..")
|
|
|
13 |
import numpy as np
|
14 |
from PIL import Image
|
15 |
|
16 |
+
|
17 |
if __name__ == "__main__":
|
18 |
gr.close_all()
|
19 |
cfg = LazyConfig.load("MrDETR/projects/mr_detr_align/configs/deformable_detr_swinl_two_stage_12ep_plusplus.py")
|
20 |
cfg["model"].device = "cuda"
|
21 |
cfg["train"].device = "cuda"
|
22 |
+
|
23 |
+
# @spaces.GPU(duration=40, progress=gr.Progress(track_tqdm=True))
|
24 |
+
# def
|
25 |
model = instantiate(cfg.model)
|
26 |
checkpointer = DetectionCheckpointer(model)
|
27 |
checkpointer.load("https://github.com/Visual-AI/Mr.DETR/releases/download/weights/MrDETR_align_swinL_12ep_900q_safe.pth")
|