Spaces:
Running
Running
load model and config files from hub
Browse files
app.py
CHANGED
@@ -7,7 +7,10 @@ import random
|
|
7 |
from utils import sahi_mmdet_inference
|
8 |
from streamlit_image_comparison import image_comparison
|
9 |
|
10 |
-
|
|
|
|
|
|
|
11 |
|
12 |
IMAGE_TO_URL = {
|
13 |
"apple_tree.jpg": "https://user-images.githubusercontent.com/34196005/142730935-2ace3999-a47b-49bb-83e0-2bdd509f1c90.jpg",
|
@@ -33,13 +36,13 @@ def download_comparison_images():
|
|
33 |
|
34 |
@st.cache(allow_output_mutation=True, show_spinner=False)
|
35 |
def get_model():
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
model_path,
|
40 |
)
|
41 |
-
|
42 |
-
|
|
|
43 |
)
|
44 |
|
45 |
detection_model = AutoDetectionModel.from_pretrained(
|
|
|
7 |
from utils import sahi_mmdet_inference
|
8 |
from streamlit_image_comparison import image_comparison
|
9 |
|
10 |
+
MMDET_YOLOX_TINY_MODEL_URL = "https://huggingface.co/fcakyon/mmdet-yolox-tiny/resolve/main/yolox_tiny_8x8_300e_coco_20211124_171234-b4047906.pth"
|
11 |
+
MMDET_YOLOX_TINY_MODEL_PATH = "yolox.pt"
|
12 |
+
MMDET_YOLOX_TINY_CONFIG_URL = "https://huggingface.co/fcakyon/mmdet-yolox-tiny/raw/main/yolox_tiny_8x8_300e_coco.py"
|
13 |
+
MMDET_YOLOX_TINY_CONFIG_PATH = "config.py"
|
14 |
|
15 |
IMAGE_TO_URL = {
|
16 |
"apple_tree.jpg": "https://user-images.githubusercontent.com/34196005/142730935-2ace3999-a47b-49bb-83e0-2bdd509f1c90.jpg",
|
|
|
36 |
|
37 |
@st.cache(allow_output_mutation=True, show_spinner=False)
|
38 |
def get_model():
|
39 |
+
sahi.utils.file.download_from_url(
|
40 |
+
MMDET_YOLOX_TINY_MODEL_URL,
|
41 |
+
MMDET_YOLOX_TINY_MODEL_PATH,
|
|
|
42 |
)
|
43 |
+
sahi.utils.file.download_from_url(
|
44 |
+
MMDET_YOLOX_TINY_CONFIG_URL,
|
45 |
+
MMDET_YOLOX_TINY_CONFIG_PATH,
|
46 |
)
|
47 |
|
48 |
detection_model = AutoDetectionModel.from_pretrained(
|