Giter Site home page Giter Site logo

vivekalumootil / agronav-vivek Goto Github PK

View Code? Open in Web Editor NEW

This project forked from structurescomp/agronav

0.0 0.0 0.0 59.16 MB

Agronav: Autonomous Navigation Framework for Agricultural Robots and Vehicles using Semantic Segmentation and Semantic Line Detection

Shell 0.10% C++ 0.43% Python 97.48% CSS 0.01% Cuda 0.68% Makefile 0.06% Batchfile 0.07% Jupyter Notebook 1.03% Dockerfile 0.13%

agronav-vivek's Introduction


Agronav: Autonomous Navigation Framework for Agricultural Robots and Vehicles using Semantic Segmentation and Semantic Line Detection


Pipeline of the Agronav framework


Updates

  • 06/22/2023: Revised instructions, tested image inference code.

Instructions


Dependencies

This code has been tested on Python 3.8.

  1. After creating a virtual environment (Python 3.8), install pytorch and cuda package.

    Using conda:

    conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia

    Using pip:

    pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116
  2. Install mmcv

    pip install wheel
    pip install -U openmim
    mim install mmcv-full==1.7.1
    cd segmentation
    pip install -v -e .
  3. Install other dependencies

    conda install numpy scipy scikit-image pqdm -y
    pip install opencv-python yml POT pudb -y
  4. Install deep-hough-transform

    cd ../lineDetection
    cd model/_cdht
    pip install ninja
    python setup.py build 
    python setup.py install --user

Training the Semantic Segmentation Model


Training the Semantic Line Detection Model

  1. Download the AgroNav_LineDetection dataset from here and extract to data/ directory. The dataset contains images and ground truth annotations of the semantic lines. The images are the outputs of the semantic segmentation model. Each image contains a pair of semantic lines.

  2. Run the following lines for data augmentation and generation of the parametric space labels.

cd lineDetection
python data/prepare_data_NKL.py --root './data/agroNav_LineDetection' --label './data/agroNav_LineDetection' --save-dir './data/training/agroNav_LineDetection_resized_100_100' --fixsize 400 
  1. Run the following script to obtain a list of filenames of the training data.
python data/extractFilenameList.py

This creates a .txt file with the filenames inside /training. Divide the filenames into train and validation data.

agroNav_LineDetection_train.txt
agroNav_LineDetection_val.txt
  1. Specify the training and validation data paths in config.yml.

  2. Add the .../agronav directory and .../model/_cdht directory to your PYTHONPATH environment variable.

  3. Train the model.

python train.py

Inference

  1. Download the pre-trained checkpoints for semantic segmentation [MobileNetV3, HRNet, ResNest]. Move the downloaded file to ./segmentation/checkpoint/.
  2. Download the pre-trained checkpoints for semantic line detection here. Move the download file to ../lineDetection/checkpoint/.
  3. Move inference images to ./inference/input
  4. Run the following command to perform end-to-end inference on the test images. End-to-end inference begins with a raw RGB image, and visualizes the centerlines.
    python e2e_inference_image.py
  5. The final results with the centerlines will be saved in ./inference/output_centerline, the intermediate results are saved in ./inference/temp and ./inference/output.

To run the semantic segmentation and line detection models independently, use ./segmentation/inference_image.py and ./lineDetection/inference.py.


Citation

If found helpful, please consider citing our work:

@InProceedings{Panda_2023_CVPR,
    author    = {Panda, Shivam K. and Lee, Yongkyu and Jawed, M. Khalid},
    title     = {Agronav: Autonomous Navigation Framework for Agricultural Robots and Vehicles Using Semantic Segmentation and Semantic Line Detection},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops},
    month     = {June},
    year      = {2023},
    pages     = {6271-6280}
}

agronav-vivek's People

Contributors

yongkyul avatar vivekalumootil 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.