natanielruiz / android-yolo

Real-time object detection on Android using the YOLO network with TensorFlow
Apache License 2.0
667 stars 212 forks source link

I want to add or Remove Objects? #32

Closed iamharisgul closed 6 years ago

iamharisgul commented 6 years ago

Hi, I want to add or Remove Objects How i can Edit the Code Any Procedure?

Thanks

natanielruiz commented 6 years ago

The app is hardcoded for 20 classes and for the tiny-yolo network final output layer. You can check the following code if you want to change this:

https://github.com/natanielruiz/android-yolo/blob/master/app/src/main/java/org/tensorflow/demo/TensorflowClassifier.java

The code describes the interpretation of the output.

The code for the network inference pass is written in C++ and the output is passed to Java. The output of the network is in the form of a String which is converted to a StringTokenizer and is then converted into an array of Floats in line 87 of TensorflowClassifier.java

You can work from there and read the papers to transform the new yolo model output into something that makes sense. (I did it only for one bounding box and also obtained the confidence of this bounding box). This part of the code is commented by me so you can understand what I did. Also read the paper here: https://arxiv.org/abs/1506.02640