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

Training new model #8

Closed ThomasLengeling closed 7 years ago

ThomasLengeling commented 7 years ago

Very usefully app, I want to include my own training model to the app to be able to detect different objects or features. Any suggestion where to start?, thank you!

chenweiqian commented 7 years ago

I want to use my own training model SSD to detect face. Could you give me some ideas? Thanks!!

chenweiqian commented 7 years ago

@ThomasLengeling hi, i run it on android, but it failed. how do you do?

lubian commented 7 years ago

I tried with the provided model file android_yolo.pb, it works perfectly on my Huawei Elite P9. However, when I tried with another model file. converted from yolo weights by darkflow, my app crashed each time I launch it. I just replace the model file with my own model file .pb, is there anything that I missed? Thanks in advance!

LiangHao92 commented 7 years ago

@chenweiqian hello, have you succeed running ssd model?

LiangHao92 commented 7 years ago

@lubian hello, have you succeed?

chenweiqian commented 7 years ago

@LiangHao92 Because when I used pb file of my own ssd model, the official program could not detect faces. So I just succeed in running ssd model on my own small program. The small program could detect faces from photos albums.

lubian commented 7 years ago

I've successfully generated the app with the given model file and it works on my huawei P9 . However, with my own model file, the app crashes each time I launch it. Lu

Le vendredi 4 août 2017, chenweiqian notifications@github.com a écrit :

@LiangHao92 https://github.com/lianghao92 Because when I used pb file of my own ssd model, the official program could not detect faces. So I just succeed in running ssd model on my own small program. The small program could detect faces from photos albums.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/natanielruiz/android-yolo/issues/8#issuecomment-320254708, or mute the thread https://github.com/notifications/unsubscribe-auth/AQKD3JJV5Z_Y9CuP9uHsSEk4yG4-fAc-ks5sUyI5gaJpZM4NK-i1 .

--

Best Wishes, Lu BIAN

natanielruiz commented 7 years ago

Hello everyone. The app is hardcoded for 20 classes and for the tiny-yolo final output layer. You can check the following if you want to change this: https://github.com/natanielruiz/android-yolo/blob/master/app/src/main/java/org/tensorflow/demo/TensorflowClassifier.java for the interpretation of the output.

The code for the network output is written in C++ and is compiled. The output of the network is in the form of a StringTokenizer and is converted into an array 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 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

I will be closing this issue in a couple of days.