forked from mindspore-Ecosystem/mindspore
opt maskrnn preprocessing pref
This commit is contained in:
parent
d2b1e783e7
commit
c8268df1d1
|
@ -35,6 +35,9 @@ MaskRCNN is a two-stage target detection network. It extends FasterRCNN by addin
|
||||||
[Paper](http://cn.arxiv.org/pdf/1703.06870v3): Kaiming He, Georgia Gkioxari, Piotr Dollar and Ross Girshick. "MaskRCNN"
|
[Paper](http://cn.arxiv.org/pdf/1703.06870v3): Kaiming He, Georgia Gkioxari, Piotr Dollar and Ross Girshick. "MaskRCNN"
|
||||||
|
|
||||||
# [Dataset](#contents)
|
# [Dataset](#contents)
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
- [COCO2017](https://cocodataset.org/) is a popular dataset with bounding-box and pixel-level stuff annotations. These annotations can be used for scene understanding tasks like semantic segmentation, object detection and image captioning. There are 118K/5K images for train/val.
|
- [COCO2017](https://cocodataset.org/) is a popular dataset with bounding-box and pixel-level stuff annotations. These annotations can be used for scene understanding tasks like semantic segmentation, object detection and image captioning. There are 118K/5K images for train/val.
|
||||||
|
|
||||||
- Dataset size: 19G
|
- Dataset size: 19G
|
||||||
|
@ -398,12 +401,12 @@ Accumulating evaluation results...
|
||||||
|
|
||||||
### Evaluation Performance
|
### Evaluation Performance
|
||||||
|
|
||||||
| Parameters | MaskRCNN |
|
| Parameters | Ascend |
|
||||||
| -------------------------- | ----------------------------------------------------------- |
|
| -------------------------- | ----------------------------------------------------------- |
|
||||||
| Model Version | V1 |
|
| Model Version | V1 |
|
||||||
| Resource | Ascend 910; CPU 2.60GHz, 192cores; Memory, 755G |
|
| Resource | Ascend 910; CPU 2.60GHz, 192cores; Memory, 755G |
|
||||||
| uploaded Date | 08/01/2020 (month/day/year) |
|
| uploaded Date | 08/01/2020 (month/day/year) |
|
||||||
| MindSpore Version | 0.6.0-alpha |
|
| MindSpore Version | 1.0.0 |
|
||||||
| Dataset | COCO2017 |
|
| Dataset | COCO2017 |
|
||||||
| Training Parameters | epoch=12, batch_size = 2 |
|
| Training Parameters | epoch=12, batch_size = 2 |
|
||||||
| Optimizer | SGD |
|
| Optimizer | SGD |
|
||||||
|
@ -420,12 +423,12 @@ Accumulating evaluation results...
|
||||||
|
|
||||||
### Inference Performance
|
### Inference Performance
|
||||||
|
|
||||||
| Parameters | MaskRCNN |
|
| Parameters | Ascend |
|
||||||
| ------------------- | --------------------------- |
|
| ------------------- | --------------------------- |
|
||||||
| Model Version | V1 |
|
| Model Version | V1 |
|
||||||
| Resource | Ascend 910 |
|
| Resource | Ascend 910 |
|
||||||
| Uploaded Date | 08/01/2020 (month/day/year) |
|
| Uploaded Date | 08/01/2020 (month/day/year) |
|
||||||
| MindSpore Version | 0.6.0-alpha |
|
| MindSpore Version | 1.0.0 |
|
||||||
| Dataset | COCO2017 |
|
| Dataset | COCO2017 |
|
||||||
| batch_size | 2 |
|
| batch_size | 2 |
|
||||||
| outputs | mAP |
|
| outputs | mAP |
|
||||||
|
|
|
@ -301,10 +301,8 @@ def pad_to_max(img, img_shape, gt_bboxes, gt_label, gt_num, gt_mask, instance_co
|
||||||
gt_label_new = np.pad(gt_label, ((0, pad_max_number - instance_count)), mode="constant", constant_values=-1)
|
gt_label_new = np.pad(gt_label, ((0, pad_max_number - instance_count)), mode="constant", constant_values=-1)
|
||||||
gt_iscrowd_new = np.pad(gt_num, ((0, pad_max_number - instance_count)), mode="constant", constant_values=1)
|
gt_iscrowd_new = np.pad(gt_num, ((0, pad_max_number - instance_count)), mode="constant", constant_values=1)
|
||||||
gt_iscrowd_new_revert = ~(gt_iscrowd_new.astype(np.bool))
|
gt_iscrowd_new_revert = ~(gt_iscrowd_new.astype(np.bool))
|
||||||
gt_mask_new = np.pad(gt_mask, ((0, pad_max_number - instance_count), (0, 0), (0, 0)), mode="constant",
|
|
||||||
constant_values=0)
|
|
||||||
|
|
||||||
return img, img_shape, gt_box_new, gt_label_new, gt_iscrowd_new_revert, gt_mask_new
|
return img, img_shape, gt_box_new, gt_label_new, gt_iscrowd_new_revert, gt_mask
|
||||||
|
|
||||||
def preprocess_fn(image, box, mask, mask_shape, is_training):
|
def preprocess_fn(image, box, mask, mask_shape, is_training):
|
||||||
"""Preprocess function for dataset."""
|
"""Preprocess function for dataset."""
|
||||||
|
@ -518,7 +516,7 @@ def create_maskrcnn_dataset(mindrecord_file, batch_size=2, device_num=1, rank_id
|
||||||
column_order=["image", "image_shape", "box", "label", "valid_num", "mask"],
|
column_order=["image", "image_shape", "box", "label", "valid_num", "mask"],
|
||||||
python_multiprocessing=False,
|
python_multiprocessing=False,
|
||||||
num_parallel_workers=num_parallel_workers)
|
num_parallel_workers=num_parallel_workers)
|
||||||
ds = ds.batch(batch_size, drop_remainder=True)
|
ds = ds.batch(batch_size, drop_remainder=True, pad_info={"mask": ([config.max_instance_count, None, None], 0)})
|
||||||
|
|
||||||
else:
|
else:
|
||||||
ds = ds.map(operations=compose_map_func,
|
ds = ds.map(operations=compose_map_func,
|
||||||
|
|
Loading…
Reference in New Issue