项目作者: mjjackey

项目描述 :
Applications of AI and Computer Vision in Agriculture-Fruit recognition, localization and segmentation
高级语言: Jupyter Notebook
项目地址: git://github.com/mjjackey/Mask_R_CNN_in_Fruit_Counting.git
创建时间: 2019-12-25T06:33:06Z
项目社区:https://github.com/mjjackey/Mask_R_CNN_in_Fruit_Counting

开源协议:MIT License

下载


Applications of AI and Computer Vision in Agriculture-Fruit recognition, localization and segmentation

  • Utilise start-of-the-art CNN architectures technologies: Instance Segmentation to realise fruit recognition, localisation and segmentation in the farm, where the data is from open source dataset-ACFR farm Fruit Dataset collected at the farm in Warburton, Australia.

Data Soruce

Directory Description

  • mrcnn: main code files
  • datasets: the data set intending to train
  • samples/fruit: the codes for specified data sets, here is fruit data set
  • logs: save the trained weights files

How to Run Code

  1. Enter the Mask_RCNN directory
  2. Install dependencies

    1. pip3 install -r requirements.txt
  3. Run setup.py

    1. python3 setup.py install
  4. You can import the modules in Jupyter Notebook (see train_fruit.ipynb) or run it from the command line:

    1. # First enter the Mask_RCNN/samples/fruit directory
    2. # Train a new model starting from pre-trained COCO weights
    3. python3 fruit.py train --dataset=./apples/ --weights=coco --epoch=15
    4. # Resume training a model that you had trained earlier
    5. python3 fruit.py train --dataset=./apples/ --weights=last --epoch=25 --layers='all'
    6. # Train a new model starting from ImageNet weights
    7. python3 fruit.py train --dataset=./apples/ --weights=imagenet
    8. # Train a new model from a arbitrary pre-trained weights
    9. python3 fruit.py train --dataset=./apples/ --weights=path of .h5 files e.g. ./mask_rcnn_coco.h5 --epoch=11 --layers='all'
    10. # There are five arguments for command line: --dataset, --weights, --logs, --epoch, --layers, you can type:
    11. python3 fruit.py --help
    12. # to see each parameter usage.
  5. The inference code are ran on Google Gloud Colaboratory. First upload the Mask_RCNN folder to your google drive, then run the arbitrary .ipynb code file in Mask_RCNN/samples/fruit directory.

Reference

The code refers to https://github.com/matterport/Mask_RCNN.