3 ms·
I also built an Open Source (GPL3) facial recognition program as well, called uWho (github.com/jwcrawley/uWho). Mine doesn't need anything like CUDA or OpenCL,
by kefka 11y ago
I also built an Open Source (GPL3) facial recognition program as well, called uWho (github.com/jwcrawley/uWho). Mine doesn't need anything like CUDA or OpenCL, and runs on a 6 year old laptop at 1280x720@15fps.
I ran it at our free, ticketless convention called Makevention (bloomington, IN). Estimates were that 650-700 people showed up. My tracker counted 669 uniques, which I think is spot on.
I also wrote mine for privacy in mind. The database was a KNN on a perceptual hash of the face. The data that was stored was only a hash and could only verify a face: it could not generate the face from the hash. Considering the application (Maker/Hacker con) I wanted to be sure that this was the case. (The data only resided on that machine, and it's wiped now.)
I've halted work on the gui version of it. Now I want to make it into a client/server, where the clients are RasPis (or other cheap compute with camera) and the server is whatever good machine you have. Initially, I'll reimplement the same algo, but I know that KNN has exponential time/cpu requirements the more samples I get.
- anonym28492 11y agoi have just checked and you are only using existing opencv functionality - openface is based on state of the art research in face recognition using convolutional triplet networks
- kefka 11y agoyou'll get no argument out of being that I use OpenCV. It is the tool that I had, and works effectively the way I programmed it. Also, I do not have a general purpose GPU so I cannot do gpu-accelerated calculations. this model is indeed a new and novel way of handling facial recognition. the only caveat for me using this is that I do not have a GP GPU. if I am able to acquire one, I will undoubtedly use it instead!
- anonym28492 11y agoyou can utilize a neural network on a cpu as well - it will just take longer for an answer to be retrieved the intention behind my comment was only to point out that your solution does compete on a different level - i did not intent do speak badly of it
- kefka 11y agoSorry, I wasn't angry at all. I was at a stoplight and read what you wrote, and responded with my voice to text (android). :) And they are indeed different projects. I would dare say that they have much better quality, but I've not used it. 120d of freedom does give a great deal of unique clustering data. I know mine doesn't compare with that, but also doesn't require as much power either. Sincerely,
- bdamos 11y agoThe argument isn't that you use OpenCV: OpenFace also uses OpenCV. However, I think you should target and present your program as being a program that uses face recognition, not as a face recognition program. You are using and not crediting here that your program uses existing, off-the-shelf face recognition functionality already in OpenCV: https://github.com/jwcrawley/uWho/blob/2823479d5abf9f8f2de21ab38cf77a9f4c4c46d8/mainwindow.cpp#L31 https://github.com/jwcrawley/uWho/blob/2823479d5abf9f8f2de21...
- baldfat 11y agoI think I now have an idea for counting people who attend church. :)
- kefka 11y agoYou don't actually need a computer with my software. There's a button that you can easily load a video file and do the same classification on the video file. Just record a video of the front doors, and load it later on. You don't freak the people out and you can quietly do the classification later on.
- baldfat 11y agoThat was what i actually was thinking about. We have a security system that takes HD video on our three entrances. Couldn't this be a HUGE tool for smaller restaurants and figure out how many repeat customers they have and if they start losing or gaining them?
- kefka 11y agoAbsolutely. My problem was that of how to market something like this. I have no clue how to do so, and the 2 people that contacted me fizzled after initial contact. I know I did get it in Hackaday, where there was a a bit of a spat between the "cool" and "evil" factions regarding this area. ( http://hackaday.com/2015/03/04/face-recognition-for-your-next-con/ http://hackaday.com/2015/03/04/face-recognition-for-your-nex... ) It's also why I wanted a server/client architecture, where each machine can handle face tracking (of a face, not a specific face) and then upload that image to the server, where it is processed for "whom" it is. I wanted the interface to be a clean HTML5 app, where I am now able to bring something pretty to market. With that setup, I could be feeding in data from 80 cameras in a beefy server and keep on chugging nicely. If you'd like to talk further about this, my email is whois: crankylinuxuser.net :) My phone# is real there too.
- bdamos 11y agoOpenFace can optionally use a CUDA-enabled GPU, but it's not a requirement. The performance is almost real-time on a CPU. After detection (which varies depending on the input image size), the recognition takes less than a second. We have a few performance results on the FAQ at http://cmusatyalab.github.io/openface/faq/ http://cmusatyalab.github.io/openface/faq/ I'm surprised (and skeptical) uWho can do detection+recognition at 15fps. I would expect face detection alone in 1280x720 images to be much slower than 15fps. On my 3.7GHz CPU with a 1050x1400px image, dlib's face detector takes about a second to run. This is also my experience with OpenCV's face detector, which I noticed your code is using. Also OpenCV's face detector returns many false positives, especially in videos. See this YouTube video for an experimental comparison: https://www.youtube.com/watch?v=LsK0hzcEyHI https://www.youtube.com/watch?v=LsK0hzcEyHI Also, I think it's a strong claim that faces can't be generated from a perceptual hash. One property of perceptual hashes is that hashes that have a close hamming distance to each other are more similar (of the same person). I wouldn't be surprised if a model could successfully map perceptual hashes to faces given enough training data. I read a good paper about doing this (not specific to faces) but can't remember the reference now. Edit: I just added some simple timing code to this sample OpenCV face detection project on my 3.60GHz machine: https://github.com/shantnu/FaceDetect https://github.com/shantnu/FaceDetect On the John Lennon image from the OpenFace FAQ sized 1050x1400px, it takes 0.32 seconds, which is about 3fps. This is slightly quicker that dlib's detector on the same image, but it also returned a false positive.
- kefka 11y agoI'm doing a bit of tricks to speed up the performance. And I'm perfectly find that you question the performance :) I encourage you to try it out. My first problem/observation is that Haar cascades looove running on a GPU due to their Float-y nature. But dealing with them on a CPU frankly stinks. I was getting 1 frame/10 seconds at 800x600 with the included Haar face detector. That's effectively unusable. Turns out there's also LBP cascades, which are integer based. And they run fast on a cpu. But, from my observations, they have many false positives. But they seem to have no issue with false negatives, so I grab all the faces, plus a few "junks". The speedup is, is that I can use an LBP and then throw the region of interest (the potential face) onto a Haar cascade eye detector. Now that I'm dealing with much smaller pictures, haar runs acceptably. Literally, if (eyes.size > 0){is valid face.....} Then I proceed to use the built in function on OpenCV contrib Face library. The problems with the library are numerous. Mainly, the settings are provided without good descriptions, or whatever the defaults of whatever academic papers had them set as. Because I'm also an academic, I was able to get ahold of quite a few large datasets of face data. After doing so, I wrote a few small programs that attempted to calculate the ideal settings for the FaceRecognizer call, which I believe I did so. (The settings are in the call, in the source.) Of course, I do get some slowdowns depending on how many faces there are (mainly, stay away from google searches for faces). But then again, 4 haars on 50x50 images is not that bad at all. My machines used: Thinkpad T61 (8GB ram), Intel NUC (8GB ram, I5 cpu) Camera: Logitech C920 webcam I did try my code using the max resolution the camera could acquire (1920x1080).... 1 frame/5 seconds.