Spaces:
Sleeping
Sleeping
neoguojing
commited on
Commit
·
ccba85f
1
Parent(s):
68d34d0
up
Browse files- inference.py +6 -6
- requirements.txt +1 -0
inference.py
CHANGED
@@ -192,7 +192,7 @@ class ModelFactory:
|
|
192 |
|
193 |
cfg = ModelConfig(ModelCategory.ONE_STEP_OBJECT_DETECTION,
|
194 |
model_path="COCO-Detection/retinanet_R_101_FPN_3x.yaml",
|
195 |
-
cfg_path="
|
196 |
p = self.get_instance(ModelCategory.ONE_STEP_OBJECT_DETECTION,cfg)
|
197 |
|
198 |
if input_image is None and image_path is not None:
|
@@ -209,7 +209,7 @@ class ModelFactory:
|
|
209 |
"""
|
210 |
cfg = ModelConfig(ModelCategory.OBJECT_DETECTION,
|
211 |
model_path="COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml",
|
212 |
-
cfg_path="
|
213 |
p = self.get_instance(ModelCategory.IMAGE_FEATURE_EXTRACT, cfg)
|
214 |
if input_image is None and image_path is not None:
|
215 |
input_image = p.read_image(image_path)
|
@@ -225,7 +225,7 @@ class ModelFactory:
|
|
225 |
"""
|
226 |
cfg = ModelConfig(ModelCategory.INSTANCE_SEGMENTATION,
|
227 |
model_path="COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml",
|
228 |
-
cfg_path="
|
229 |
p = self.get_instance(ModelCategory.INSTANCE_SEGMENTATION,cfg)
|
230 |
if input_image is None and image_path is not None:
|
231 |
input_image = p.read_image(image_path)
|
@@ -242,7 +242,7 @@ class ModelFactory:
|
|
242 |
|
243 |
cfg = ModelConfig(ModelCategory.SEMANTIC_SEGMENTATION,
|
244 |
model_path=None,
|
245 |
-
cfg_path="
|
246 |
|
247 |
p = self.get_instance(ModelCategory.SEMANTIC_SEGMENTATION,cfg)
|
248 |
|
@@ -260,7 +260,7 @@ class ModelFactory:
|
|
260 |
|
261 |
cfg = ModelConfig(ModelCategory.INSTANCE_SEGMENTATION,
|
262 |
model_path="COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml",
|
263 |
-
cfg_path="
|
264 |
p = self.get_instance(ModelCategory.INSTANCE_SEGMENTATION,cfg)
|
265 |
if input_image is None and image_path is not None:
|
266 |
input_image = p.read_image(image_path)
|
@@ -278,7 +278,7 @@ class ModelFactory:
|
|
278 |
|
279 |
cfg = ModelConfig(ModelCategory.KEYPOINTS,
|
280 |
model_path="COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml",
|
281 |
-
cfg_path="
|
282 |
p = self.get_instance(ModelCategory.KEYPOINTS,cfg)
|
283 |
if input_image is None and image_path is not None:
|
284 |
input_image = p.read_image(image_path)
|
|
|
192 |
|
193 |
cfg = ModelConfig(ModelCategory.ONE_STEP_OBJECT_DETECTION,
|
194 |
model_path="COCO-Detection/retinanet_R_101_FPN_3x.yaml",
|
195 |
+
cfg_path="./configs/COCO-Detection/retinanet_R_101_FPN_3x.yaml").get_cfg()
|
196 |
p = self.get_instance(ModelCategory.ONE_STEP_OBJECT_DETECTION,cfg)
|
197 |
|
198 |
if input_image is None and image_path is not None:
|
|
|
209 |
"""
|
210 |
cfg = ModelConfig(ModelCategory.OBJECT_DETECTION,
|
211 |
model_path="COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml",
|
212 |
+
cfg_path="./configs/COCO-Detection/faster_rcnn_R_101_FPN_3x.yaml").get_cfg()
|
213 |
p = self.get_instance(ModelCategory.IMAGE_FEATURE_EXTRACT, cfg)
|
214 |
if input_image is None and image_path is not None:
|
215 |
input_image = p.read_image(image_path)
|
|
|
225 |
"""
|
226 |
cfg = ModelConfig(ModelCategory.INSTANCE_SEGMENTATION,
|
227 |
model_path="COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml",
|
228 |
+
cfg_path="./configs/COCO-InstanceSegmentation/mask_rcnn_R_101_FPN_3x.yaml").get_cfg()
|
229 |
p = self.get_instance(ModelCategory.INSTANCE_SEGMENTATION,cfg)
|
230 |
if input_image is None and image_path is not None:
|
231 |
input_image = p.read_image(image_path)
|
|
|
242 |
|
243 |
cfg = ModelConfig(ModelCategory.SEMANTIC_SEGMENTATION,
|
244 |
model_path=None,
|
245 |
+
cfg_path="./configs/PascalVOC-Detection/faster_rcnn_R_50_FPN.yaml").get_cfg()
|
246 |
|
247 |
p = self.get_instance(ModelCategory.SEMANTIC_SEGMENTATION,cfg)
|
248 |
|
|
|
260 |
|
261 |
cfg = ModelConfig(ModelCategory.INSTANCE_SEGMENTATION,
|
262 |
model_path="COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml",
|
263 |
+
cfg_path="./configs/COCO-PanopticSegmentation/panoptic_fpn_R_101_3x.yaml").get_cfg()
|
264 |
p = self.get_instance(ModelCategory.INSTANCE_SEGMENTATION,cfg)
|
265 |
if input_image is None and image_path is not None:
|
266 |
input_image = p.read_image(image_path)
|
|
|
278 |
|
279 |
cfg = ModelConfig(ModelCategory.KEYPOINTS,
|
280 |
model_path="COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml",
|
281 |
+
cfg_path="./configs/COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml").get_cfg()
|
282 |
p = self.get_instance(ModelCategory.KEYPOINTS,cfg)
|
283 |
if input_image is None and image_path is not None:
|
284 |
input_image = p.read_image(image_path)
|
requirements.txt
CHANGED
@@ -10,4 +10,5 @@ fvcore==0.1.5.post20221221
|
|
10 |
omegaconf==2.3.0
|
11 |
pycocotools==2.0.7
|
12 |
gradio_image_prompter==0.1.0
|
|
|
13 |
git+https://github.com/facebookresearch/segment-anything.git
|
|
|
10 |
omegaconf==2.3.0
|
11 |
pycocotools==2.0.7
|
12 |
gradio_image_prompter==0.1.0
|
13 |
+
cloudpickle==2.2.1
|
14 |
git+https://github.com/facebookresearch/segment-anything.git
|