A real-time object detector API for floating plastic litter, built with YOLOv4 and Keras/Tensorflow.
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
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 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'
- 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>
# get FPS
$ python3 train.py
- mean Average Precision (mAP)
- Complete-IoU Loss and Cluster-NMS
- ImgAug
- LabelImg
- Semantic Versioning
- tqdm
- How to improve object-detection
- A neat implementation of YOLO v3 with TF 2.2 and Keras
- A popular Implementation of YOLO v3 based on multi-backend Keras
- Another Implementation of YOLO v3 based on multi-backend Keras
- YOLO implementation on Keras/TF2
- YOLO implementation on Keras
- YOLOv4 implementation on Keras
- YOLOv4 implementation on Keras
- YOLOv4 implementation on Keras
- Deep-SORT-YOLOv4
- Web Based YOLOv4 Graphic Interface by BMWInnovationLab
-
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