项目作者: peter850421

项目描述 :
Mask RCNN on own dataset.
高级语言: Jupyter Notebook
项目地址: git://github.com/peter850421/Mask-RCNN.git
创建时间: 2019-07-04T03:29:12Z
项目社区:https://github.com/peter850421/Mask-RCNN

开源协议:

下载


Step 1 Data Preprocessing

Data cleaner can remove the trash img out of dataset. It trains on the resnet50 by using 3994 imgs(positive imgs and negative imgs).
Validation imgs includes 238 imgs(positive imgs and negative imgs). The accuracy in validation set is 99.8%.

Data Preprocessing - Training and Valid

  1. python train.py

Data Preprocessing - Testing(Cleaning)

  1. python predict.py --dir=高架

Data Preprocessing Data_path

Put the data just like below.

  1. |-- train.py
  2. |-- model.py
  3. |-- predict.py
  4. |-- data_utils.py
  5. |-- best_model
  6. |--Classify
  7. |-- model.pth
  8. |-- data(image)
  9. |-- A
  10. |-- B
  11. |-- C
  12. |-- D
  13. |-- ....

Step2 Data annotation

Label me

When we finish the annotation from labelme, we next transform the format to COCO format by the command . But I suggest the other way to transform the format.
Put this file in to the image annotation folder, then try below:

  1. python labelme2coco.py

It will generate a new.json that is the annotation file of coco format. Next, we change the file name to train.json. Validation dataset repeat the above step to get the coco format.
Now we have the dataset below:

  1. |-- dataset
  2. |-- train
  3. |--0.jpg
  4. |--1.jpg
  5. |-- ...
  6. |-- val
  7. |--1000.jpg
  8. |--1001.jpg
  9. |-- ...
  10. |--annotation
  11. |--train.json
  12. |--val.json

Step3 Installation

Follow the installation in matterport/Mask_RCNN

Step4 Training and Evaluation

Training

  1. python ./train201908.py --training_dataset train --validation_dataset valid --year 201908 train

Evaluate

  1. python ./train201908.py --training_dataset train --validation_dataset valid --year 201908 evaluate

also see train_valid_visual

coco_eval replaced by cocoeval.py (remember to change the class number)

TO DO LIST

  • [X] Data Clearer
  • Annotation
  • [X] Traingin MASK RCNN
  • [X] Visualize Result