Browse Source

!12312 Add requirements and docker file in ssd, update the config of num_ssd_boxes

From: @c_34
Reviewed-by: @oacjiewen,@liangchenghui
Signed-off-by: @liangchenghui
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
31598d522e
5 changed files with 20 additions and 5 deletions
  1. +6
    -0
      model_zoo/official/cv/ssd/Dockerfile
  2. +4
    -0
      model_zoo/official/cv/ssd/requirements.txt
  3. +7
    -0
      model_zoo/official/cv/ssd/src/config.py
  4. +0
    -1
      model_zoo/official/cv/ssd/src/config_ssd300.py
  5. +3
    -4
      model_zoo/official/cv/ssd/src/config_ssd_mobilenet_v1_fpn.py

+ 6
- 0
model_zoo/official/cv/ssd/Dockerfile View File

@@ -0,0 +1,6 @@
ARG FROM_IMAGE_NAME
FROM ${FROM_IMAGE_NAME}

RUN apt install libgl1-mesa-glx -y
COPY requirements.txt .
RUN pip3.7 install -r requirements.txt

+ 4
- 0
model_zoo/official/cv/ssd/requirements.txt View File

@@ -0,0 +1,4 @@
pycocotools
opencv-python
xml-python
Pillow

+ 7
- 0
model_zoo/official/cv/ssd/src/config.py View File

@@ -27,3 +27,10 @@ config_map = {
}

config = config_map[using_model]

if config.num_ssd_boxes == -1:
num = 0
h, w = config.img_shape
for i in range(len(config.steps)):
num += (h // config.steps[i]) * (w // config.steps[i]) * config.num_default[i]
config.num_ssd_boxes = num

+ 0
- 1
model_zoo/official/cv/ssd/src/config_ssd300.py View File

@@ -21,7 +21,6 @@ config = ed({
"model": "ssd300",
"img_shape": [300, 300],
"num_ssd_boxes": 1917,
"neg_pre_positive": 3,
"match_threshold": 0.5,
"nms_threshold": 0.6,
"min_score": 0.1,


+ 3
- 4
model_zoo/official/cv/ssd/src/config_ssd_mobilenet_v1_fpn.py View File

@@ -20,8 +20,7 @@ from easydict import EasyDict as ed
config = ed({
"model": "ssd_mobilenet_v1_fpn",
"img_shape": [640, 640],
"num_ssd_boxes": 51150,
"neg_pre_positive": 3,
"num_ssd_boxes": -1,
"match_threshold": 0.5,
"nms_threshold": 0.6,
"min_score": 0.1,
@@ -32,8 +31,8 @@ config = ed({
"lr_init": 0.01333,
"lr_end_rate": 0.0,
"warmup_epochs": 2,
"weight_decay": 4e-5,
"momentum": 0.9,
"weight_decay": 1.5e-4,

# network
"num_default": [6, 6, 6, 6, 6],
@@ -48,7 +47,7 @@ config = ed({
"steps": (8, 16, 32, 64, 128),
"prior_scaling": (0.1, 0.2),
"gamma": 2.0,
"alpha": 0.75,
"alpha": 0.25,
"num_addition_layers": 4,
"use_anchor_generator": True,
"use_global_norm": True,


Loading…
Cancel
Save