You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.py 3.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright 2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. #" ============================================================================
  15. """Config parameters for SSD models."""
  16. from easydict import EasyDict as ed
  17. config = ed({
  18. "img_shape": [300, 300],
  19. "num_ssd_boxes": 1917,
  20. "neg_pre_positive": 3,
  21. "match_thershold": 0.5,
  22. "nms_thershold": 0.6,
  23. "min_score": 0.1,
  24. "max_boxes": 100,
  25. # learing rate settings
  26. "global_step": 0,
  27. "lr_init": 0.001,
  28. "lr_end_rate": 0.001,
  29. "warmup_epochs": 2,
  30. "momentum": 0.9,
  31. "weight_decay": 1.5e-4,
  32. # network
  33. "num_default": [3, 6, 6, 6, 6, 6],
  34. "extras_in_channels": [256, 576, 1280, 512, 256, 256],
  35. "extras_out_channels": [576, 1280, 512, 256, 256, 128],
  36. "extras_srides": [1, 1, 2, 2, 2, 2],
  37. "extras_ratio": [0.2, 0.2, 0.2, 0.25, 0.5, 0.25],
  38. "feature_size": [19, 10, 5, 3, 2, 1],
  39. "min_scale": 0.2,
  40. "max_scale": 0.95,
  41. "aspect_ratios": [(2,), (2, 3), (2, 3), (2, 3), (2, 3), (2, 3)],
  42. "steps": (16, 32, 64, 100, 150, 300),
  43. "prior_scaling": (0.1, 0.2),
  44. "gamma": 2.0,
  45. "alpha": 0.75,
  46. # `mindrecord_dir` and `coco_root` are better to use absolute path.
  47. "mindrecord_dir": "/data/MindRecord_COCO",
  48. "coco_root": "/data/coco2017",
  49. "train_data_type": "train2017",
  50. "val_data_type": "val2017",
  51. "instances_set": "annotations/instances_{}.json",
  52. "coco_classes": ('background', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
  53. 'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
  54. 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
  55. 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra',
  56. 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie',
  57. 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball',
  58. 'kite', 'baseball bat', 'baseball glove', 'skateboard',
  59. 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup',
  60. 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
  61. 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza',
  62. 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed',
  63. 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote',
  64. 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
  65. 'refrigerator', 'book', 'clock', 'vase', 'scissors',
  66. 'teddy bear', 'hair drier', 'toothbrush'),
  67. "num_classes": 81,
  68. # The annotation.json position of voc validation dataset.
  69. "voc_root": "",
  70. # voc original dataset.
  71. "voc_dir": "",
  72. # if coco or voc used, `image_dir` and `anno_path` are useless.
  73. "image_dir": "",
  74. "anno_path": "",
  75. })