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 2.9 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. class ConfigSSD:
  17. """
  18. Config parameters for SSD.
  19. Examples:
  20. ConfigSSD().
  21. """
  22. IMG_SHAPE = [300, 300]
  23. NUM_SSD_BOXES = 1917
  24. NEG_PRE_POSITIVE = 3
  25. MATCH_THRESHOLD = 0.5
  26. NMS_THRESHOLD = 0.6
  27. MIN_SCORE = 0.05
  28. TOP_K = 100
  29. NUM_DEFAULT = [3, 6, 6, 6, 6, 6]
  30. EXTRAS_IN_CHANNELS = [256, 576, 1280, 512, 256, 256]
  31. EXTRAS_OUT_CHANNELS = [576, 1280, 512, 256, 256, 128]
  32. EXTRAS_STRIDES = [1, 1, 2, 2, 2, 2]
  33. EXTRAS_RATIO = [0.2, 0.2, 0.2, 0.25, 0.5, 0.25]
  34. FEATURE_SIZE = [19, 10, 5, 3, 2, 1]
  35. MIN_SCALE = 0.2
  36. MAX_SCALE = 0.95
  37. ASPECT_RATIOS = [(2,), (2, 3), (2, 3), (2, 3), (2, 3), (2, 3)]
  38. STEPS = (16, 32, 64, 100, 150, 300)
  39. PRIOR_SCALING = (0.1, 0.2)
  40. # `MINDRECORD_DIR` and `COCO_ROOT` are better to use absolute path.
  41. MINDRECORD_DIR = "/data/MindRecord_COCO"
  42. COCO_ROOT = "/data/coco2017"
  43. TRAIN_DATA_TYPE = "train2017"
  44. VAL_DATA_TYPE = "val2017"
  45. INSTANCES_SET = "annotations/instances_{}.json"
  46. COCO_CLASSES = ('background', 'person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
  47. 'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
  48. 'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
  49. 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra',
  50. 'giraffe', 'backpack', 'umbrella', 'handbag', 'tie',
  51. 'suitcase', 'frisbee', 'skis', 'snowboard', 'sports ball',
  52. 'kite', 'baseball bat', 'baseball glove', 'skateboard',
  53. 'surfboard', 'tennis racket', 'bottle', 'wine glass', 'cup',
  54. 'fork', 'knife', 'spoon', 'bowl', 'banana', 'apple',
  55. 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza',
  56. 'donut', 'cake', 'chair', 'couch', 'potted plant', 'bed',
  57. 'dining table', 'toilet', 'tv', 'laptop', 'mouse', 'remote',
  58. 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink',
  59. 'refrigerator', 'book', 'clock', 'vase', 'scissors',
  60. 'teddy bear', 'hair drier', 'toothbrush')
  61. NUM_CLASSES = len(COCO_CLASSES)