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.

README.md 28 kB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517
  1. # Contents
  2. - [CenterNet Description](#CenterNet-description)
  3. - [Model Architecture](#model-architecture)
  4. - [Dataset](#dataset)
  5. - [Environment Requirements](#environment-requirements)
  6. - [Quick Start](#quick-start)
  7. - [Script Description](#script-description)
  8. - [Script and Sample Code](#script-and-sample-code)
  9. - [Script Parameters](#script-parameters)
  10. - [Training Process](#training-process)
  11. - [Training](#training)
  12. - [Distributed Training](#distributed-training)
  13. - [Testing Process](#testing-process)
  14. - [Testing and Evaluation](#testing-and-evaluation)
  15. - [Convert Process](#convert-process)
  16. - [Convert](#convert)
  17. - [Model Description](#model-description)
  18. - [Performance](#performance)
  19. - [Training Performance](#training-performance)
  20. - [Inference Performance](#inference-performance)
  21. - [ModelZoo Homepage](#modelzoo-homepage)
  22. # [CenterNet Description](#contents)
  23. CenterNet is a novel practical anchor-free method for object detection, 3D detection, and pose estimation, which detect identifies objects as axis-aligned boxes in an image. The detector uses keypoint estimation to find center points and regresses to all other object properties, such as size, 3D location, orientation, and even pose. In nature, it's a one-stage method to simultaneously predict center location and bboxes with real-time speed and higher accuracy than corresponding bounding box based detectors.
  24. We support training and evaluation on Ascend910.
  25. [Paper](https://arxiv.org/pdf/1904.07850.pdf): Objects as Points. 2019.
  26. Xingyi Zhou(UT Austin) and Dequan Wang(UC Berkeley) and Philipp Krahenbuhl(UT Austin)
  27. # [Model Architecture](#contents)
  28. In the current model, we use CenterNet to estimate multi-person pose. The DLA(Deep Layer Aggregation) net was adopted as backbone, a 3x3 convolutional layer with 256 channel was added before each output head, and a final 1x1 convolution then produced the desired output. Six losses are presented, and the total loss is their weighted mean.
  29. # [Dataset](#contents)
  30. Note that you can run the scripts based on the dataset mentioned in original paper or widely used in relevant domain/network architecture. In the following sections, we will introduce how to run the scripts using the related dataset below.
  31. Dataset used: [COCO2017](https://cocodataset.org/)
  32. - Dataset size:26G
  33. - Train:19G,118000 images
  34. - Val:0.8G,5000 images
  35. - Test: 6.3G, 40000 images
  36. - Annotations:808M,instances,captions,person_keypoints etc
  37. - Data format:image and json files
  38. - Note:Data will be processed in dataset.py
  39. - The directory structure is as follows, name of directory and file is user defined:
  40. ```path
  41. .
  42. ├── dataset
  43. ├── centernet
  44. ├── annotations
  45. │ ├─ train.json
  46. │ └─ val.json
  47. └─ images
  48. ├─ train
  49. │ └─images
  50. │ ├─class1_image_folder
  51. │ ├─ ...
  52. │ └─classn_image_folder
  53. └─ val
  54. │ └─images
  55. │ ├─class1_image_folder
  56. │ ├─ ...
  57. │ └─classn_image_folder
  58. └─ test
  59. └─images
  60. ├─class1_image_folder
  61. ├─ ...
  62. └─classn_image_folder
  63. ```
  64. # [Environment Requirements](#contents)
  65. - Hardware(Ascend)
  66. - Prepare hardware environment with Ascend processor.
  67. - Framework
  68. - [MindSpore](https://www.mindspore.cn/install/en)
  69. - For more information, please check the resources below:
  70. - [MindSpore tutorials](https://www.mindspore.cn/tutorial/training/en/master/index.html)
  71. - [MindSpore Python API](https://www.mindspore.cn/doc/api_python/en/master/index.html)
  72. - Download the dataset COCO2017.
  73. - We use COCO2017 as training dataset in this example by default, and you can also use your own datasets.
  74. 1. If coco dataset is used. **Select dataset to coco when run script.**
  75. Install Cython and pycocotool, and you can also install mmcv to process data.
  76. ```pip
  77. pip install Cython
  78. pip install pycocotools
  79. pip install mmcv==0.2.14
  80. ```
  81. And change the COCO_ROOT and other settings you need in `config.py`. The directory structure is as follows:
  82. ```path
  83. .
  84. └─cocodataset
  85. ├─annotations
  86. ├─instance_train2017.json
  87. └─instance_val2017.json
  88. ├─val2017
  89. └─train2017
  90. ```
  91. 2. If your own dataset is used. **Select dataset to other when run script.**
  92. Organize the dataset information the same format as COCO.
  93. # [Quick Start](#contents)
  94. After installing MindSpore via the official website, you can start training and evaluation as follows:
  95. Note: 1.the first run of training will generate the mindrecord file, which will take a long time.
  96. 2.MINDRECORD_DATASET_PATH is the mindrecord dataset directory.
  97. 3.LOAD_CHECKPOINT_PATH is the pretrained checkpoint file directory, if no just set ""
  98. 4.RUN_MODE support validation and testing, set to be "val"/"test"
  99. ```shell
  100. # create dataset in mindrecord format
  101. bash scripts/convert_dataset_to_mindrecord.sh [COCO_DATASET_DIR] [MINDRECORD_DATASET_DIR]
  102. # standalone training on Ascend
  103. bash scripts/run_standalone_train_ascend.sh [DEVICE_ID] [MINDRECORD_DATASET_PATH] [LOAD_CHECKPOINT_PATH](optional)
  104. # standalone training on CPU
  105. bash scripts/run_standalone_train_cpu.sh [MINDRECORD_DATASET_PATH] [LOAD_CHECKPOINT_PATH](optional)
  106. # distributed training on Ascend
  107. bash scripts/run_distributed_train_ascend.sh [MINDRECORD_DATASET_PATH] [RANK_TABLE_FILE] [LOAD_CHECKPOINT_PATH](optional)
  108. # eval on Ascend
  109. bash scripts/run_standalone_eval_ascend.sh [DEVICE_ID] [RUN_MODE] [DATA_DIR] [LOAD_CHECKPOINT_PATH]
  110. # eval on CPU
  111. bash scripts/run_standalone_eval_cpu.sh [RUN_MODE] [DATA_DIR] [LOAD_CHECKPOINT_PATH]
  112. ```
  113. # [Script Description](#contents)
  114. ## [Script and Sample Code](#contents)
  115. ```path
  116. .
  117. ├── cv
  118. ├── centernet
  119. ├── train.py // training scripts
  120. ├── eval.py // testing and evaluation outputs
  121. ├── export.py // convert mindspore model to air model
  122. ├── README.md // descriptions about CenterNet
  123. ├── scripts
  124. │ ├── ascend_distributed_launcher
  125. │ │ ├──__init__.py
  126. │ │ ├──hyper_parameter_config.ini // hyper parameter for distributed training
  127. │ │ ├──get_distribute_train_cmd.py // script for distributed training
  128. │ │ ├──README.md
  129. │ ├──convert_dataset_to_mindrecord.sh // shell script for converting coco type dataset to mindrecord
  130. │ ├──run_standalone_train_ascend.sh // shell script for standalone training on ascend
  131. │ ├──run_distributed_train_ascend.sh // shell script for distributed training on ascend
  132. │ ├──run_standalone_eval_ascend.sh // shell script for standalone evaluation on ascend
  133. │ ├──run_standalone_train_cpu.sh // shell script for standalone training on cpu
  134. │ ├──run_standalone_eval_cpu.sh // shell script for standalone evaluation on cpu
  135. └── src
  136. ├──__init__.py
  137. ├──centernet_pose.py // centernet networks, training entry
  138. ├──dataset.py // generate dataloader and data processing entry
  139. ├──config.py // centernet unique configs
  140. ├──dcn_v2.py // deformable convolution operator v2
  141. ├──decode.py // decode the head features
  142. ├──backbone_dla.py // deep layer aggregation backbone
  143. ├──utils.py // auxiliary functions for train, to log and preload
  144. ├──image.py // image preprocess functions
  145. ├──post_process.py // post-process functions after decode in inference
  146. └──visual.py // visualization image, bbox, score and keypoints
  147. ```
  148. ## [Script Parameters](#contents)
  149. ### Create MindRecord type dataset
  150. ```text
  151. usage: dataset.py [--coco_data_dir COCO_DATA_DIR]
  152. [--mindrecord_dir MINDRECORD_DIR]
  153. [--mindrecord_prefix MINDRECORD_PREFIX]
  154. options:
  155. --coco_data_dir path to coco dataset directory: PATH, default is ""
  156. --mindrecord_dir path to mindrecord dataset directory: PATH, default is ""
  157. --mindrecord_prefix prefix of MindRecord dataset filename: STR, default is "coco_hp.train.mind"
  158. ```
  159. ### Training
  160. ```text
  161. usage: train.py [--device_target DEVICE_TARGET] [--distribute DISTRIBUTE]
  162. [--need_profiler NEED_PROFILER] [--profiler_path PROFILER_PATH]
  163. [--epoch_size EPOCH_SIZE] [--train_steps TRAIN_STEPS] [device_id DEVICE_ID]
  164. [--device_num DEVICE_NUM] [--do_shuffle DO_SHUFFLE]
  165. [--enable_data_sink ENABLE_DATA_SINK] [--data_sink_steps N]
  166. [--enable_save_ckpt ENABLE_SAVE_CKPT]
  167. [--save_checkpoint_path SAVE_CHECKPOINT_PATH]
  168. [--load_checkpoint_path LOAD_CHECKPOINT_PATH]
  169. [--save_checkpoint_steps N] [--save_checkpoint_num N]
  170. [--mindrecord_dir MINDRECORD_DIR]
  171. [--mindrecord_prefix MINDRECORD_PREFIX]
  172. [--visual_image VISUAL_IMAGE] [--save_result_dir SAVE_RESULT_DIR]
  173. options:
  174. --device_target device where the code will be implemented: "Ascend" | "CPU", default is "Ascend"
  175. --distribute training by several devices: "true"(training by more than 1 device) | "false", default is "false"
  176. --need profiler whether to use the profiling tools: "true" | "false", default is "false"
  177. --profiler_path path to save the profiling results: PATH, default is ""
  178. --epoch_size epoch size: N, default is 1
  179. --train_steps training Steps: N, default is -1
  180. --device_id device id: N, default is 0
  181. --device_num number of used devices: N, default is 1
  182. --do_shuffle enable shuffle: "true" | "false", default is "true"
  183. --enable_lossscale enable lossscale: "true" | "false", default is "true"
  184. --enable_data_sink enable data sink: "true" | "false", default is "true"
  185. --data_sink_steps set data sink steps: N, default is 1
  186. --enable_save_ckpt enable save checkpoint: "true" | "false", default is "true"
  187. --save_checkpoint_path path to save checkpoint files: PATH, default is ""
  188. --load_checkpoint_path path to load checkpoint files: PATH, default is ""
  189. --save_checkpoint_steps steps for saving checkpoint files: N, default is 1000
  190. --save_checkpoint_num number for saving checkpoint files: N, default is 1
  191. --mindrecord_dir path to mindrecord dataset directory: PATH, default is ""
  192. --mindrecord_prefix prefix of MindRecord dataset filename: STR, default is "coco_hp.train.mind"
  193. --visual_image whether visualize the image and annotation info: "true" | "false", default is "false"
  194. --save_result_dir path to save the visualization results: PATH, default is ""
  195. ```
  196. ### Evaluation
  197. ```text
  198. usage: eval.py [--device_target DEVICE_TARGET] [--device_id N]
  199. [--load_checkpoint_path LOAD_CHECKPOINT_PATH]
  200. [--data_dir DATA_DIR] [--run_mode RUN_MODE]
  201. [--visual_image VISUAL_IMAGE]
  202. [--enable_eval ENABLE_EVAL] [--save_result_dir SAVE_RESULT_DIR]
  203. options:
  204. --device_target device where the code will be implemented: "Ascend" | "CPU", default is "Ascend"
  205. --device_id device id to run task, default is 0
  206. --load_checkpoint_path initial checkpoint (usually from a pre-trained CenterNet model): PATH, default is ""
  207. --data_dir validation or test dataset dir: PATH, default is ""
  208. --run_mode inference mode: "val" | "test", default is "val"
  209. --visual_image whether visualize the image and annotation info: "true" | "false", default is "false"
  210. --save_result_dir path to save the visualization and inference results: PATH, default is ""
  211. ```
  212. ### Options and Parameters
  213. Parameters for training and evaluation can be set in file `config.py` and `finetune_eval_config.py` respectively.
  214. #### Options
  215. ```text
  216. config for training.
  217. batch_size batch size of input dataset: N, default is 32
  218. loss_scale_value initial value of loss scale: N, default is 1024
  219. optimizer optimizer used in the network: Adam, default is Adam
  220. lr_schedule schedules to get the learning rate
  221. ```
  222. ```text
  223. config for evaluation.
  224. soft_nms nms after decode: True | False, default is True
  225. keep_res keep original or fix resolution: True | False, default is False
  226. multi_scales use multi-scales of image: List, default is [1.0]
  227. pad pad size when keep original resolution, default is 31
  228. K number of bboxes to be computed by TopK, default is 100
  229. score_thresh threshold of score when visualize image and annotation info
  230. ```
  231. ```text
  232. config for export.
  233. input_res input resolution of the model air, default is [512, 512]
  234. ckpt_file checkpoint file, default is "./ckkt_file.ckpt"
  235. export_format the exported format of model air, default is MINDIR
  236. export_name the exported file name, default is "CentNet_MultiPose"
  237. ```
  238. #### Parameters
  239. ```text
  240. Parameters for dataset (Training/Evaluation):
  241. num_classes number of categories: N, default is 1
  242. num_joints number of keypoints to recognize a person: N, default is 17
  243. max_objs maximum numbers of objects labeled in each image
  244. input_res input resolution, default is [512, 512]
  245. output_res output resolution, default is [128, 128]
  246. rand_crop whether crop image in random during data augmenation: True | False, default is False
  247. shift maximum value of image shift during data augmenation: N, default is 0.1
  248. scale maximum value of image scale times during data augmenation: N, default is 0.4
  249. aug_rot properbility of image rotation during data augmenation: N, default is 0.0
  250. rotate maximum value of rotation angle during data augmentation: N, default is 0.0
  251. flip_prop properbility of image flip during data augmenation: N, default is 0.5
  252. mean mean value of RGB image
  253. std variance of RGB image
  254. flip_idx the corresponding point index of keypoints when flip the image
  255. edges pairs of points linked by an edge to mimic person pose
  256. eig_vec eigenvectors of RGB image
  257. eig_val eigenvalues of RGB image
  258. categories format of annotations for multi-person pose
  259. Parameters for network (Training/Evaluation):
  260. down_ratio the ratio of input and output resolution during training
  261. last_level the last level in final upsampling
  262. final_kernel the final kernel size for convolution
  263. stage_levels list numbers of the tree height for each stage
  264. stage_channels list numbers of channels of the output in each stage
  265. head_conv the channel number to get the head by convolution
  266. dense_hp whether apply weighted pose regression near center point: True | False, default is True
  267. hm_hp estimate human joint heatmap or directly use the joint offset from center: True | False, default is True
  268. reg_hp_offset regress local offset for human joint heatmaps or not: True | False, default is True
  269. reg_offset regress local offset or not: True | False, default is True
  270. hm_weight loss weight for keypoint heatmaps: N, default is 1.0
  271. off_weight loss weight for keypoint local offsets: N, default is 0.1
  272. wh_weight loss weight for bounding box size: N, default is 0.1
  273. hm_weight loss weight for keypoint heatmaps: N, default is 1.0
  274. hm_hp_weight loss weight for human keypoint heatmap: N, default is 1.0
  275. mse_loss use mse loss or focal loss to train keypoint heatmaps: True | False, default is False
  276. reg_loss l1 or smooth l1 for regression loss: 'l1' | 'sl1', default is 'l1'
  277. Parameters for optimizer and learning rate:
  278. Adam:
  279. weight_decay weight decay: Q
  280. eps term added to the denominator to improve numerical stability: Q
  281. decay_filer lamda expression to specify which param will be decayed
  282. PolyDecay:
  283. learning_rate initial value of learning rate: Q
  284. end_learning_rate final value of learning rate: Q
  285. power learning rate decay factor
  286. eps normalization parameter
  287. warmup_steps number of warmup_steps
  288. MultiDecay:
  289. learning_rate initial value of learning rate: Q
  290. eps normalization parameter
  291. warmup_steps number of warmup_steps
  292. multi_epochs list of epoch numbers after which the lr will be decayed
  293. factor learning rate decay factor
  294. ```
  295. ## [Training Process](#contents)
  296. Before your first training, convert coco type dataset to mindrecord files is needed to improve performance on host.
  297. ```bash
  298. bash scripts/convert_dataset_to_mindrecord.sh /path/coco_dataset_dir /path/mindrecord_dataset_dir
  299. ```
  300. The command above will run in the background, after converting mindrecord files will be located in path specified by yourself.
  301. ### Standalone Training
  302. #### Running on Ascend
  303. ```bash
  304. bash scripts/run_standalone_train_ascend.sh device_id /path/mindrecord_dataset /path/load_ckpt(optional)
  305. ```
  306. The command above will run in the background, you can view training logs in training_log.txt. After training finished, you will get some checkpoint files under the script folder by default. The loss values will be displayed as follows:
  307. ```text
  308. # grep "epoch" training_log.txt
  309. ...
  310. epoch: 349.0, current epoch percent: 0.80, step: 87450, outputs are (Tensor(shape=[1], dtype=Float32, [ 4.96466]), Tensor(shape=[], dtype=Bool, False), Tensor(shape=[], dtype=Float32, 1024))
  311. epoch: 349.0, current epoch percent: 1.00, step: 87500, outputs are (Tensor(shape=[1], dtype=Float32, [ 4.59703]), Tensor(shape=[], dtype=Bool, False), Tensor(shape=[], dtype=Float32, 1024))
  312. ...
  313. ```
  314. #### Running on CPU
  315. ```bash
  316. bash scripts/run_standalone_train_cpu.sh /path/mindrecord_dataset /path/load_ckpt(optional)
  317. ```
  318. The command above will run in the background, you can view training logs in training_log.txt. After training finished, you will get some checkpoint files under the script folder by default. The loss values will be displayed as follows (rusume from pretrained checkpoint and batch_size was set to be 8):
  319. ```text
  320. # grep "epoch" training_log.txt
  321. ...
  322. epoch: 0.0, current epoch percent: 0.00, step: 1, time of per steps: 66.693 s, outputs are 3.645
  323. epoch: 0.0, current epoch percent: 0.00, step: 2, time of per steps: 46.594 s, outputs are 4.862
  324. epoch: 0.0, current epoch percent: 0.00, step: 3, time of per steps: 44.718 s, outputs are 3.927
  325. epoch: 0.0, current epoch percent: 0.00, step: 4, time of per steps: 45.113 s, outputs are 3.910
  326. epoch: 0.0, current epoch percent: 0.00, step: 5, time of per steps: 45.213 s, outputs are 3.749
  327. ...
  328. ```
  329. ### Distributed Training
  330. #### Running on Ascend
  331. ```bash
  332. bash scripts/run_distributed_train_ascend.sh /path/mindrecord_dataset /path/hccl.json /path/load_ckpt(optional)
  333. ```
  334. The command above will run in the background, you can view training logs in LOG*/training_log.txt and LOG*/ms_log/. After training finished, you will get some checkpoint files under the LOG*/ckpt_0 folder by default. The loss value will be displayed as follows:
  335. ```bash
  336. # grep "epoch" LOG*/ms_log/mindspore.log
  337. epoch: 0.0, current epoch percent: 0.001, step: 100, outputs are (Tensor(shape=[1], dtype=Float32, [ 1.08209e+01]), Tensor(shape=[], dtype=Bool, False), Tensor(shape=[], dtype=Float32, 1024))
  338. epoch: 0.0, current epoch percent: 0.002, step: 200, outputs are (Tensor(shape=[1], dtype=Float32, [ 1.07566e+01]), Tensor(shape=[], dtype=Bool, False), Tensor(shape=[], dtype=Float32, 1024))
  339. ...
  340. epoch: 0.0, current epoch percent: 0.001, step: 100, outputs are (Tensor(shape=[1], dtype=Float32, [ 1.08218e+01]), Tensor(shape=[], dtype=Bool, False), Tensor(shape=[], dtype=Float32, 1024))
  341. epoch: 0.0, current epoch percent: 0.002, step: 200, outputs are (Tensor(shape=[1], dtype=Float32, [ 1.07770e+01]), Tensor(shape=[], dtype=Bool, False), Tensor(shape=[], dtype=Float32, 1024))
  342. ...
  343. ```
  344. ## [Testing Process](#contents)
  345. ### Testing and Evaluation
  346. ```bash
  347. # Evaluation base on validation dataset will be done automatically, while for test or test-dev dataset, the accuracy should be upload to the CodaLab official website(https://competitions.codalab.org).
  348. # On Ascend
  349. bash scripts/run_standalone_eval_ascend.sh device_id val(or test) /path/coco_dataset /path/load_ckpt
  350. # On CPU
  351. bash scripts/run_standalone_eval_cpu.sh val(or test) /path/coco_dataset /path/load_ckpt
  352. ```
  353. you can see the MAP result below as below:
  354. ```log
  355. overall performance on coco2017 validation dataset
  356. Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets= 20 ] = 0.521
  357. Average Precision (AP) @[ IoU=0.50 | area= all | maxDets= 20 ] = 0.791
  358. Average Precision (AP) @[ IoU=0.75 | area= all | maxDets= 20 ] = 0.564
  359. Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.446
  360. Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.639
  361. Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 20 ] = 0.600
  362. Average Recall (AR) @[ IoU=0.50 | area= all | maxDets= 20 ] = 0.847
  363. Average Recall (AR) @[ IoU=0.75 | area= all | maxDets= 20 ] = 0.645
  364. Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.509
  365. Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.729
  366. overall performance on coco2017 test-dev dataset
  367. Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets= 20 ] = 0.513
  368. Average Precision (AP) @[ IoU=0.50 | area= all | maxDets= 20 ] = 0.795
  369. Average Precision (AP) @[ IoU=0.75 | area= all | maxDets= 20 ] = 0.550
  370. Average Precision (AP) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.443
  371. Average Precision (AP) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.623
  372. Average Recall (AR) @[ IoU=0.50:0.95 | area= all | maxDets= 20 ] = 0.600
  373. Average Recall (AR) @[ IoU=0.50 | area= all | maxDets= 20 ] = 0.863
  374. Average Recall (AR) @[ IoU=0.75 | area= all | maxDets= 20 ] = 0.642
  375. Average Recall (AR) @[ IoU=0.50:0.95 | area=medium | maxDets= 20 ] = 0.509
  376. Average Recall (AR) @[ IoU=0.50:0.95 | area= large | maxDets= 20 ] = 0.724
  377. ```
  378. ## [Convert Process](#contents)
  379. ### Convert
  380. If you want to infer the network on Ascend 310, you should convert the model to AIR:
  381. ```python
  382. python export.py [DEVICE_ID]
  383. ```
  384. # [Model Description](#contents)
  385. ## [Performance](#contents)
  386. ### Training Performance On Ascend
  387. CenterNet on 11.8K images(The annotation and data format must be the same as coco)
  388. | Parameters | CenterNet |
  389. | -------------------------- | ---------------------------------------------------------------|
  390. | Resource | Ascend 910; CPU 2.60GHz, 192cores; Memory, 755G |
  391. | uploaded Date | 12/15/2020 (month/day/year) |
  392. | MindSpore Version | 1.0.0 |
  393. | Dataset | 11.8K images |
  394. | Training Parameters | 8p, epoch=350, steps=250 * epoch, batch_size = 32, lr=1.2e-4 |
  395. | Optimizer | Adam |
  396. | Loss Function | Focal Loss, L1 Loss, RegLoss |
  397. | outputs | detections |
  398. | Loss | 4.5-5.5 |
  399. | Speed | 1p 59 img/s, 8p 470 img/s |
  400. | Total time: training | 1p: 4.38 days; 8p: 13-14 h |
  401. | Total time: evaluation | keep res: test 1.7h, val 0.7h; fix res: test 50 min, val 12 min|
  402. | Checkpoint | 242M (.ckpt file) |
  403. | Scripts | <https://gitee.com/mindspore/mindspore/tree/master/model_zoo/research/cv/centernet> |
  404. ### Inference Performance On Ascend
  405. CenterNet on validation(5K images) and test-dev(40K images)
  406. | Parameters | CenterNet |
  407. | -------------------------- | ----------------------------------------------------------------|
  408. | Resource | Ascend 910; CPU 2.60GHz, 192cores; Memory, 755G |
  409. | uploaded Date | 12/15/2020 (month/day/year) |
  410. | MindSpore Version | 1.0.0 |
  411. | Dataset | 5K images(val), 40K images(test-dev) |
  412. | batch_size | 1 |
  413. | outputs | boxes and keypoints position and scores |
  414. | Accuracy(validation) | MAP: 52.1%, AP50: 79.1%, AP75: 56.4, Medium: 44.6%, Large: 63.9%|
  415. | Accuracy(test-dev) | MAP: 51.3%, AP50: 79.5%, AP75: 55.0, Medium: 44.3%, Large: 62.3%|
  416. | Model for inference | 87M (.mindir file) |
  417. # [Description of Random Situation](#contents)
  418. In run_standalone_train_ascend.sh and run_distributed_train_ascend.sh, we set do_shuffle to True to shuffle the dataset by default.
  419. In train.py, we set a random seed to make sure that each node has the same initial weight in distribute training.
  420. # [ModelZoo Homepage](#contents)
  421. Please check the official [homepage](https://gitee.com/mindspore/mindspore/tree/master/model_zoo).