Code Monkey home page Code Monkey logo

yolov3's Introduction

🦄 YOLOv3 Implementation in TensorFlow 1.1x + Keras 🦄

How it Looks Like

Watch the demo

Quick Start

On a PC / Mac

Create conda environment depending on whether you have a supported GPU or not:

conda env create -f environment-[c|g]pu.yml
source activate yolov3-[c|g]pu

On a Raspi 3

Install OpenCV 3 with the following instructions.

Then:

pip install tensorflow scikit-learn

Download YOLO Weights

Download weights into the cfg directory:

cd cfg
wget https://pjreddie.com/media/files/yolov3.weights

Demo on Single Image:

python single_image.py

The output is stored on out.png in the root folder.

Demo on Web Cam:

To see it live on your Web Cam:

python webcam.py

Progress

  • YOLO configuration parser
  • Build YOLO model
  • Check architecture against a well-known implementation
  • Load YOLO pre-trained weights
  • Handle YOLO layer (Detection Layer)
  • Non-Maximal Suppression
  • Colorful boxes with labels and scores
  • Test out on a Web Cam
  • Check dependencies
  • Dependencies for CPU and GPU
  • Instructions for running the project
  • Use original scale of input image
  • YOLO head in a function
  • Figure out Eager Execution + Loading Weights
  • Support Tiny YOLOv3
  • Allow passing in options to use Tiny YOLOv3
  • Investigate Quantization / Smaller Weights
  • Try this out on a Raspi3
  • Tensorflow.js (¯\(ツ)/¯)

Credits

yolov3's People

Contributors

benjamintanweihao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

yolov3's Issues

Shape mismatch error in route layer on specifying input shape in single_image.py

I specified the input shape in single_image.py :
inputs = Input(shape=(416, 416, 3))

This gave me following error:
File "single_image.py", line 11, in
outputs, config = darknet_base(inputs, include_yolo_head=False)
File "/vol1/dbstore/orc_srib/n.hri/Hand_Localization/Experiments/005_yolov3_tflite_pc/YOLOv3/darknet.py", line 67, in darknet_base
x, layers, yolo_layers, ptr = _build_route_layer(x, block, layers, yolo_layers, ptr)
File "/vol1/dbstore/orc_srib/n.hri/Hand_Localization/Experiments/005_yolov3_tflite_pc/YOLOv3/darknet.py", line 224, in _build_route_layer
x = Concatenate(axis=3)(selected_layers)
File "/vol0/tool/ml/cuda9/.venv/py2/tensorflow-1.10.0/lib/python2.7/site-packages/tensorflow/python/keras/engine/base_layer.py", line 728, in call
self.build(input_shapes)
File "/vol0/tool/ml/cuda9/.venv/py2/tensorflow-1.10.0/lib/python2.7/site-packages/tensorflow/python/keras/utils/tf_utils.py", line 148, in wrapper
output_shape = fn(instance, input_shape)
File "/vol0/tool/ml/cuda9/.venv/py2/tensorflow-1.10.0/lib/python2.7/site-packages/tensorflow/python/keras/layers/merge.py", line 392, in build
'Got inputs shapes: %s' % (input_shape))
ValueError: A Concatenate layer requires inputs with matching shapes except for the concat axis. Got inputs shapes: [(None, None, None, 128), (None, 26, 26, 256)]

I can't think of a reason as to why it is able to get shape of one layer only in route layer and not the other.

Error while running tflite_demo.py

Model provided has model identifier 'TE: ', should be 'TFL3'.

Previous errors were :
No module named 'tensorflow.contrib.lite'
ImportError: cannot import name 'interpreter'
ValueError: Could not open '/content/gdrive/My Drive/BEMRR/YOLOv3/model/yolov3.tflite'.

FileNotFoundError: [Errno 2] yolov3-tiny.weights, May work with yolov3.weights

The link https://pjreddie.com/media/files/yolov3.weights provided a file called yolov3.weights not yolov3-tiny.weights . I feel either this setup should work with yolov3.weights or the read me part needs to be edited to have yolov3-tiny.weights downloaded.
https://pjreddie.com/media/files/yolov3-tiny.weights

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\NAME\yoloproj\YOLOv3\cfg\yolov3-tiny.weights'

Is it possible to get class scores for all classes ?

Hi, Is it possible to get class scores for all classes ? For example we have a dog object. The model predicts that the object is dog, with score 0.9. Is it possible to get scores for other classes, for example: cat - 0.1 ?
I checked many examples but have not found how to get class scores for all classes ?
Thank you very much.

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.