Spaces:
Runtime error
Runtime error
deployment opencv fix
Browse files- inference.py +4 -4
- pre-requeriments.txt +2 -2
inference.py
CHANGED
@@ -133,10 +133,10 @@ classes_is_human_id = [i for i, x in enumerate(classes_is_human) if x == 1]
|
|
133 |
classes_is_unknown_id = [i for i, x in enumerate(classes_is_unknown) if x == 1]
|
134 |
|
135 |
|
136 |
-
if not os.path.exists('model'):
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
|
141 |
# Choose to use a config and initialize the detectorN
|
142 |
config_file ='model/mask2former_swin-t-p4-w7-224_8xb2-lsj-50e_coco-panoptic/mask2former_swin-t-p4-w7-224_8xb2-lsj-50e_coco-panoptic.py'
|
|
|
133 |
classes_is_unknown_id = [i for i, x in enumerate(classes_is_unknown) if x == 1]
|
134 |
|
135 |
|
136 |
+
#if not os.path.exists('model'):
|
137 |
+
REPO_ID = "SharkSpace/maskformer_model"
|
138 |
+
FILENAME = "mask2former"
|
139 |
+
snapshot_download(repo_id=REPO_ID, token= os.environ.get('SHARK_MODEL'),local_dir='model/')
|
140 |
|
141 |
# Choose to use a config and initialize the detectorN
|
142 |
config_file ='model/mask2former_swin-t-p4-w7-224_8xb2-lsj-50e_coco-panoptic/mask2former_swin-t-p4-w7-224_8xb2-lsj-50e_coco-panoptic.py'
|
pre-requeriments.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
|
2 |
numpy==1.22.4
|
3 |
-
opencv-python-headless
|
4 |
openmim==0.1.5
|
5 |
torch==1.11.0
|
6 |
-
torchvision==0.12.0
|
|
|
1 |
|
2 |
numpy==1.22.4
|
3 |
+
opencv-python-headless
|
4 |
openmim==0.1.5
|
5 |
torch==1.11.0
|
6 |
+
torchvision==0.12.0
|