UoA-eResearch / hololens_facial_recognition

A Unity hololens app to detect faces and display their attributes
MIT License
233 stars 53 forks source link

Built the app but nothing happened #1

Open k3nnywilliam opened 7 years ago

k3nnywilliam commented 7 years ago

Hi,

I was attempting to build the facial recognition app but I couldn't get the app to work. Just to be sure if the build steps are correct, this is what I did:

1) I've replaced the API keys just like you've suggested 2) Git cloned your project and load it into Unity 3) Opened the 'Main' scene 4) Changed the build settings: SDK--> windows 10, UWP build type --> D3D, Debugging -- >Unity c# project 5) Build it 6) Open up the sln file 7) Edited the package.appxmanifest, basically changing the TargetDeviceFamily and MaxVersionTested entries 8) Changed the deployment target entries 9) Build the project, deployed, 10) Hololens shows the unity splash screen, point my hololens toward a picture of someone's face on my monitor screen but nothing happened.

My question is what went wrong?

-Ken

neon-ninja commented 7 years ago

It should take a photo the first time it runs, and you should see red floating text saying "photo captured, processing". After that, air tap or click with the clicker to take another photo. If that doesn't work, check that you've granted the camera permission - see https://developer.microsoft.com/en-us/windows/holographic/holograms_101e#chapter_1_-_.22holo.22_world

Additionally, there's a section for Capabilities in Package.appxmanifest - I had to enable Internet (Client), Microphone and Webcam. Not sure why Microphone is necessary.

Also, if there were some error while you're in an attached debugging session in visual studio you should see the error messages in the Output tab

Thanks for being the first (that I know of) to test this!

LukeStephen commented 7 years ago

k3nnywilliam,

Did you have to run your own version of https://github.com/UoA-eResearch/openface_mass_compare/blob/master/compare.py?

neon-ninja commented 7 years ago

@LukeStephen - because https://github.com/UoA-eResearch/hololens_facial_recognition/blob/master/Assets/Scripts/GazeGestureManager.cs#L126 is wrapped in a try block, if the OpenFaceUrl isn't set to something valid or if the server is down, the app will still work fine for gender/age detection, just not individual recognition. OpenFaceUrl is optional.

LukeStephen commented 7 years ago

@k3nnywilliam @neon-ninja enabling Microphone in VS capabilities fixed the issue, it then worked, very cool demo!!

k3nnywilliam commented 7 years ago

@neon-ninja , sorry for the late reply. It works, awesome stuff! I'm wondering if you have any plans for real-time facial recognition?

neon-ninja commented 7 years ago

@k3nnywilliam I hadn't planned on it, but it wouldn't be hard to do. Just add a coroutine that calls PhotoCapture.CreateAsync(false, OnPhotoCaptureCreated); every second or so. Feel free to submit a PR with that (configurable ideally).