NovatecConsulting / FaceRecognition-in-ARKit

Detects faces using the Vision-API and runs the extracted face through a CoreML-model to identiy the specific persons.
MIT License
832 stars 114 forks source link

add more info regarding data model n its training #1

Open askari01 opened 6 years ago

steve21124 commented 6 years ago

yes. That's will be useful. So far, don't know how to train it

askari01 commented 6 years ago

I have an idea regarding the app, if you are willing we can discuss it.

askari01 commented 6 years ago

can you upload your trained model

m-ruhl commented 6 years ago

A more in-depth instructions will follow.

Bear with me, I'm currently on vacation, so it may take some while.

TheTiger13 commented 6 years ago

Hi @m-ruhl, Thanks for the latest sample on ARKit. I downloaded the project but faces_model.mlmodel file is missing. From where I can get this file?

jagatfx commented 6 years ago

It is not the method from the author, but you can try following the instructions here (https://azure.microsoft.com/en-us/blog/custom-vision-service-introduces-classifier-export-starting-with-coreml-for-ios-11/) to use the Microsoft Custom Vision Service to export the model after training on images into the proper format expected by CoreML

twhitt14 commented 6 years ago

@jagatfx Do you know how to download the model from azure's custom vision service? I don't see the option anywhere...

katunch commented 6 years ago

@jagatfx check out the documentation here: https://docs.microsoft.com/en-us/azure/cognitive-services/custom-vision-service/export-your-model i did it so but I'm unable to import this model into xcode.

jagatfx commented 6 years ago

@twhitt14 @katunch after you click the Train button there is an export tab that says "Choose your platform" and lists iOS 11 (CoreML) as the only export option. Click that one. Click the Export button. Click the Download button. This downloads a .mlmodel file. Rename the file faces_model.mlmodel. Drop the faces_model.mlmodel file into your XCode Project. Now it will run and use your mlmodel.

There are better ways to get a good mlmodel for faces, but at least this is a quick and free way to get something the is able to experiment with the app.

MHX792 commented 6 years ago

@jagatfx can you provide more information about how many photos are needed on average and what the confidence level should be? Tested it with ~10 photos of a pen and mouse and nothing happened.

jagatfx commented 6 years ago

@MHX792 From the Microsoft docs they recommend 30 photos per tag. For more information on improving the classifier you can see this article.

Very few images are required to create a classifier -- 30 images per class is enough to start your prototype. The methods Custom Vision Service uses are robust to differences, which allows you to start prototyping with so little data.

Here is a great article from Microsoft on training the Custom Vision Service classifier.

If you just want to recognize various objects without worrying about the training process or model creation you can use the ResNet50 mlmodel listed in the apple docs.

As a last note for others, the Microsoft Custom Vision Service is not meant to be used to classify human faces. So if you want to train a model that can perform well at recognizing faces I would use a different approach. I just referenced as a way to quickly make your own classifier model that can work with this demo app.

m-ruhl commented 6 years ago

The blog-post is finally here: https://blog.novatec-gmbh.de/created-face-recognition-model/

Sorry for the delay ;-)

askari01 commented 6 years ago

thanks for the blog post, if everyone is cool I would like to close this thread.