Git Product home page Git Product logo

flotvis's Introduction

FLOTVIS

header.png

A real-time object detector API for floating plastic litter, built with YOLOv4 and Keras/Tensorflow.

Contents

FLOTVIS .  
├── VOCdevkit               # Main training dataset  
│   └── VOC2007  
│       ├── Annotations  
│       ├── JPEGImage  
│       └── ImageSet  
│           └── Main  
├── model_data              # weights and anchors  
│   ├── yolov4_anchors.txt  
│   ├── yolov4_weights.h5   
│   └── ...  
├── nets                    # backbone and evaluation functions  
│   ├── CSPdarknet53.py  
│   ├── loss.py  
│   ├── ious.py  
│   └── yolo_net.py  
├── test                    # dataset for testing  
│   ├── test1.jpg  
│   └── ...  
└── utils                   # utilities  
    ├── util.py  
    └── gputil.py  

Dependencies

tensorflow==1.15
Keras==2.1.5
scipy==1.2.1
numpy==1.17.0
matplotlib==3.1.2
opencv_python==4.1.2.30
tqdm==4.60.0
Pillow==8.2.0
h5py==2.10.0

Predict

# predict single image
$ python3 main.py --mode='image' --img='test/test.jpg'
# predict all images in folder
$ python3 main.py --mode='batch' --imgdir='./test/'
# predict video
$ python3 main.py --mode='video' --vid='test/test.mp4'
# predict using camera
$ python3 main.py --mode='camera'
# get FPS
$ python3 main.py --mode='fps'

Prepare Dataset

  • LabelImg for creating ground truth bounding box default output in .xml
    class(es): plastic
    yolo_net data format: class_number <x_center> <y_center> <width> <height>

Train

# get FPS
$ python3 train.py

References

Troubleshooting

  • If Jupyter Notebook running on your local machine prompts "No Module named Tensorflow": it is a problem of Jupyter with virtualenv.
    $ cd $HOME  
    $ brew install  
    $ pip3 install jupyter  
    $ jupyter notebook --generate-config  
    # this installs kernelspec python3 in $HOME/Library/Jupyter/kernels/python3  
    $ python3 -m ipykernel install --user  

    Assuming you use pyenv and works in a virtual environment named venv, then:

    # Activate your virtualenv  
    $ pyenv activate tf1.15  
    # Check path of the Python interpreter  
    $ pyenv which python  
    $HOME/.pyenv/versions/tf1.15/bin/python # copy this output  
    # Deactivate the virtualenv  
    $ pyenv deactivate  
    $ mkdir $HOME/Library/Jupyter/kernels/venv
    $ touch $HOME/Library/Jupyter/kernels/venv/kernel.json

    add the following content to the newly created kernel.json

    {
      "argv": [
        "$HOME/.pyenv/versions/tf1.15/bin/python",
        "-m", "ipykernel",
        "-f", "{connection_file}"
      ],
      "display_name": "venv",
      "language": "python"
    }

    Finally, check the jupyter kernel using:

    jupyter kernelspec list

flotvis's People

Contributors

nschang avatar

Stargazers

 avatar

Watchers

 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.