Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 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")
|
| 4 |
-
os.system("cd MrDETR && pip install .")
|
| 5 |
import sys
|
| 6 |
sys.path.append("MrDETR/")
|
| 7 |
|
|
@@ -13,7 +12,7 @@ import numpy as np
|
|
| 13 |
|
| 14 |
if __name__ == "__main__":
|
| 15 |
gr.close_all()
|
| 16 |
-
cfg = LazyConfig.load("
|
| 17 |
model = instantiate(cfg.model)
|
| 18 |
checkpointer = DetectionCheckpointer(model)
|
| 19 |
checkpointer.load("https://huggingface.co/allencbzhang/Mr.DETR/blob/main/MrDETR_align_swinL_12ep_900q.pth")
|
|
@@ -40,8 +39,8 @@ if __name__ == "__main__":
|
|
| 40 |
],
|
| 41 |
outputs="image",
|
| 42 |
examples=[
|
| 43 |
-
["
|
| 44 |
-
["
|
| 45 |
]
|
| 46 |
)
|
| 47 |
demo.launch()
|
|
|
|
| 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")
|
|
|
|
| 4 |
import sys
|
| 5 |
sys.path.append("MrDETR/")
|
| 6 |
|
|
|
|
| 12 |
|
| 13 |
if __name__ == "__main__":
|
| 14 |
gr.close_all()
|
| 15 |
+
cfg = LazyConfig.load("MrDETR/projects/mr_detr_align/configs/deformable_detr_swinl_two_stage_12ep_plusplus.py")
|
| 16 |
model = instantiate(cfg.model)
|
| 17 |
checkpointer = DetectionCheckpointer(model)
|
| 18 |
checkpointer.load("https://huggingface.co/allencbzhang/Mr.DETR/blob/main/MrDETR_align_swinL_12ep_900q.pth")
|
|
|
|
| 39 |
],
|
| 40 |
outputs="image",
|
| 41 |
examples=[
|
| 42 |
+
["MrDETR/assets/000000014226.jpg"],
|
| 43 |
+
["MrDETR/assets/000000028449.jpg"]
|
| 44 |
]
|
| 45 |
)
|
| 46 |
demo.launch()
|