Spaces:
Build error
Build error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,9 @@ import spaces
|
|
| 15 |
tiny_model_dir = snapshot_download('wanderkid/unimernet_tiny', local_dir='./models/unimernet_tiny')
|
| 16 |
small_model_dir = snapshot_download('wanderkid/unimernet_small', local_dir='./models/unimernet_small')
|
| 17 |
base_model_dir = snapshot_download('wanderkid/unimernet_base', local_dir='./models/unimernet_base')
|
|
|
|
|
|
|
|
|
|
| 18 |
# == download weights ==
|
| 19 |
|
| 20 |
sys.path.insert(0, os.path.join(os.getcwd(), ".."))
|
|
@@ -122,10 +125,13 @@ def gradio_reset():
|
|
| 122 |
if __name__ == "__main__":
|
| 123 |
root_path = os.path.abspath(os.getcwd())
|
| 124 |
# == load model ==
|
|
|
|
| 125 |
model_tiny, vis_processor = load_model_and_processor(os.path.join(root_path, "cfg_tiny.yaml"))
|
|
|
|
| 126 |
model_small, vis_processor = load_model_and_processor(os.path.join(root_path, "cfg_small.yaml"))
|
|
|
|
| 127 |
model_base, vis_processor = load_model_and_processor(os.path.join(root_path, "cfg_base.yaml"))
|
| 128 |
-
print("== load all models ==")
|
| 129 |
# == load model ==
|
| 130 |
|
| 131 |
with open("header.html", "r") as file:
|
|
|
|
| 15 |
tiny_model_dir = snapshot_download('wanderkid/unimernet_tiny', local_dir='./models/unimernet_tiny')
|
| 16 |
small_model_dir = snapshot_download('wanderkid/unimernet_small', local_dir='./models/unimernet_small')
|
| 17 |
base_model_dir = snapshot_download('wanderkid/unimernet_base', local_dir='./models/unimernet_base')
|
| 18 |
+
os.system("ls -l models/unimernet_tiny")
|
| 19 |
+
os.system("ls -l models/unimernet_small")
|
| 20 |
+
os.system("ls -l models/unimernet_base")
|
| 21 |
# == download weights ==
|
| 22 |
|
| 23 |
sys.path.insert(0, os.path.join(os.getcwd(), ".."))
|
|
|
|
| 125 |
if __name__ == "__main__":
|
| 126 |
root_path = os.path.abspath(os.getcwd())
|
| 127 |
# == load model ==
|
| 128 |
+
print("load tiny model ...")
|
| 129 |
model_tiny, vis_processor = load_model_and_processor(os.path.join(root_path, "cfg_tiny.yaml"))
|
| 130 |
+
print("load small model ...")
|
| 131 |
model_small, vis_processor = load_model_and_processor(os.path.join(root_path, "cfg_small.yaml"))
|
| 132 |
+
print("load base model ...")
|
| 133 |
model_base, vis_processor = load_model_and_processor(os.path.join(root_path, "cfg_base.yaml"))
|
| 134 |
+
print("== load all models done. ==")
|
| 135 |
# == load model ==
|
| 136 |
|
| 137 |
with open("header.html", "r") as file:
|