Code Monkey home page Code Monkey logo

leaf-plant-instance-segmentation's Introduction

In-Field Phenotyping Based on Crop Leaf and Plant Instance Segmentation

In this codebase we present an approach to perform in-field phenotyping based on crop leaf and plant instance segmentation.

Teaser

We propose a vision-based approach that performs instance segmentation of individual crop leaves and associates each with its corresponding crop plant in real fields.

Our method is a bottom-up approach based on an end-to-end trainable convolutional neural network~(CNN). We generate two different representations of the input image that are eligible to cluster individual crop leaf and plant instances within a predicted clustering region.

Network

Prerequisites

Create a virtual environment and install dependencies:

conda create -n venv python=3.7
conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch
conda install matplotlib tqdm scikit-image pandas
conda install -c conda-forge tensorboard
conda install -c anaconda future
conda install -c conda-forge opencv 
conda install -c conda-forge pycocotools
conda install -c anaconda h5py

Training

First, start training the network:

export DATASET_DIR=path/to/dataset
python src/train.py

You can set different training options in the file train_config.py.

Second, to perform the automated postprocessing step to cluster individual crop leaf and plant instances:

python src/report.py

You can set different postprocessing options in the file report_config.py.

Test

We provide a model pretraind on our dataset and a minimal example to perform instance segmentation of crop leaves and plants.

First, define the path to the provided dataset:

export DATASET_DIR=./dataset-mini

Second, make sure that the option only_eval in train_config.py is to True

Third, we provide the pretrained model at ./src/exp/. Please make sure that the resume_path option in train_config.py is set accordingly.

You can run the model as following:

python src/train.py

This will save the model predicitions to disk at ./logs.

Finally, run the automated postprocessing to cluster individual crop leaf and plant instances:

python src/report.py

Please find a visualization of all predicitions in the directory ./logs/reports

License

This software is released under a creative commons license which allows for personal and research use only.

Attribution

leaf-plant-instance-segmentation's People

Contributors

jaweyl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.