Giter Site home page Giter Site logo

vck / yolov3-pytorch-garbage-detection Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kanellisg/yolov3-pytorch-garbage-detection

0.0 0.0 0.0 58.42 MB

Test and prediction code for a garbage object detection

License: MIT License

Python 13.80% Shell 0.66% Dockerfile 0.03% Jupyter Notebook 85.51%

yolov3-pytorch-garbage-detection's Introduction

Demo 2

Garbage detection using PyTorch and YoloV3

For more information, look at this medium post.

PyTorch implementation of a garbage detection model. This repository contains all code for predicting/detecting and evaulating the model.

This repository combines elements from:

Demo 1

Test and prediction code for a garbage object detection

Installation

To install all required libaries:

pip install -r requirements.txt

Predictions

Several different weights and configs are available at: https://drive.google.com/open?id=1DjeNxdaF7AW3Nu54_3oRw_1SeYJtOvNL. Some also have the testing data.

Pre trained weights

Name Classes Test data
3 classes cardboard, garbage_bags and containers Yes
cigarettes cigarette Yes
9 classes container_small, garbage_bag, cardboard, matras, christmas_tree, graffiti, pole, face_privacy_filter and license_plate_privacy_filter No

Run predictions

To run predictions, download the cfg and weights from https://drive.google.com/open?id=1DjeNxdaF7AW3Nu54_3oRw_1SeYJtOvNL and put them in the correct folders.

Then for example run the following the make a prediction on a file using CPU:

python detector_garb.py -i samples/input5_frame11.jpg -o output

Or to realtime detect on your webcam using GPU: (CUDA must be installed)

python detector_garb.py -i 0 --webcam --video -o ./webcam_output/ --cuda

Docker

To run code in docker

docker-compose build
docker-compose up

Test

For testing download data from: https://drive.google.com/drive/folders/1DjeNxdaF7AW3Nu54_3oRw_1SeYJtOvNL

The garbage bags, containers and cardboard dataset contains 804 images and label files. A smaller dataset with annotations of cigarettes is also available.

To run test execute the following code:

python test.py
Class Images Targets P R mAP F1
all 115 579 0.242 0.941 0.875 0.376
container_small 115 180 0.38 0.989 0.979 0.549
garbage_bag 115 223 0.212 0.964 0.875 0.348
cardboard 115 176 0.122 0.869 0.77 0.231

test_example

Training

For training a new model look at:

https://github.com/maartensukel/yolov3-garbage-object-detection-training

This is the training loss of 1400 images with 9 classes: test_example

yolov3-pytorch-garbage-detection's People

Contributors

maartensukel avatar spreeker 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.