GithubHelp home page GithubHelp logo

Add Person and Recognition with 'custom images/video' instead of camera about android-face-recognition-with-deep-learning-test-framework HOT 10 CLOSED

qualeams avatar qualeams commented on August 18, 2024
Add Person and Recognition with 'custom images/video' instead of camera

from android-face-recognition-with-deep-learning-test-framework.

Comments (10)

sladomic avatar sladomic commented on August 18, 2024

Hi @ashokbugude

You can just work with the folders in /sdcard/Pictures/facerecognition/training

  1. Add a unique folder name
  2. Paste face images into it

The images, where the face cannot be detected will be skipped. So if you add for example 20 images, but the face can only be detected in 15 of them, only 15 images will be used for training.

The same can be done for recognition, if you use the Test function and add test images to the folder sdcard/Pictures/facerecognition/test

Regards,
Michael

from android-face-recognition-with-deep-learning-test-framework.

ashokbugude avatar ashokbugude commented on August 18, 2024

Hi Michael,

Thanks for your response,
Could you please clarify a doubt of mine.

When we use camera for detecting/Add Person, the new folder get created in '/sdcard/Pictures/facerecognition/training' with cropped images of faces

But

When I create folders manually , the images are not cropped with faces
So when I do the training at this point of time, would the training be done for entire image ?
OR
Face if detected from the uncropped images be cropped automatically and then used for training ?

Would it give the same results in both cases ?

Regards
Ashok

from android-face-recognition-with-deep-learning-test-framework.

sladomic avatar sladomic commented on August 18, 2024

It will try to detect the face in the uncropped image amd if detected use only the cropped image.

The results should be the same but it will be a bit slower due to the bigger images.

However you could save the images after cropping with the Filehelper function as done for debugging purposes (similar to /sdcard/Pictures/facerecognition/data/preprocessedImage.png)

from android-face-recognition-with-deep-learning-test-framework.

ashokbugude avatar ashokbugude commented on August 18, 2024

Thanks for the response

Can I please know the difference between reference and deviation folders in test folder ?
Should I place the custom images for testing in reference or deviation folder ?

from android-face-recognition-with-deep-learning-test-framework.

sladomic avatar sladomic commented on August 18, 2024

@ashokbugude the names are a bit strange but you can just use one folder and place all the images into the reference folder

I think we will remove this in a future version or implement a cross validation and test folder instead

from android-face-recognition-with-deep-learning-test-framework.

ashokbugude avatar ashokbugude commented on August 18, 2024

@sladomic Thanks for your response,

I ran the recognition test , it completed and displayed 95% as message.
I got the results in results folder with text files

One of the lines in text file says key_maximun_camera_view_width:320 and key_maximun_camera_view_height:240

Does it mean if the dimensions of image width > 320 or key_maximun_camera_view_height > 240 , the other part of the image won't be used for recognition ?
If so how do we modify the parameter ?
Do we need to keep in mind of image dimensions while providing the custom as inputs ?

Also does the results file print more than 1 persons names if it detects more than 1 person in an image ?

from android-face-recognition-with-deep-learning-test-framework.

sladomic avatar sladomic commented on August 18, 2024

Hi @ashokbugude

key_maximun_camera_view_width and key_maximun_camera_view_height have no effect for the Training or Test functions (only for Add Person and Recognition)

Do we need to keep in mind of image dimensions while providing the custom as inputs?

  • Yes, the images should ideally be bigger than N x N, since you will detect a face in it, crop the image and resize it to N x N (in the preprocessing recognition). So if the image is already very small (e.g. 150 x 150) and the face is only 40 x 40 but you resize it to 160 x 160, you loose a lot of information

Also does the results file print more than 1 persons names if it detects more than 1 person in an image ?

  • If more than 1 person is detected in the image, this image is skipped (if (images == null || images.size() > 1))

from android-face-recognition-with-deep-learning-test-framework.

ashokbugude avatar ashokbugude commented on August 18, 2024

@sladomic Thanks for your response.

I found few issues while detecting face from custom images and from camera source as well.

Face is not detected from image if

  1. The face is tilted slightly sidewards or upwards/downwards
  2. Camera is put at an angle (other than parallel) from the face
  3. The distance between camera and face is more than 'one arm' distance.

Can I please know how can these issues be resolved

from android-face-recognition-with-deep-learning-test-framework.

sladomic avatar sladomic commented on August 18, 2024

Hi @ashokbugude

There are several ways of improving the detection, but you need to keep in mind, that for example for Eigenfaces the face should be frontal and aligned to get the best results.

That's why we eliminate a lot of images, where we are not 100% sure, that the face is frontal aligned:

  • Eliminate image if more than 1 face has been detected
  • Eliminate image if the left eye couldn't be detected in the right half (and vice-versa)

The Viola-Jones algorithm, which is used here (OpenCV detectMultiScale function with Haar classifier) is of course a very old algorithm. More recent algorithms detect faces in every angle and then use face alignment to transfer the angled face into a frontal face. The scope of our work was face recognition, that's the reason we didn't focus on improving face detection.

To answer your questions:

  1. If you disable eye detection, it detects more faces, but then the image cannot be eye aligned
  2. Similar to 1.
  3. Try to play with the parameters of the detection https://stackoverflow.com/a/20805153

from android-face-recognition-with-deep-learning-test-framework.

ashokbugude avatar ashokbugude commented on August 18, 2024

Thanks , I shall try the above ways

I am using TensorFlow algorithm (100 % accuracy one )
The need was actually to resolve the above 3 issues for recognition. Sorry for using the word detection earlier

If we train images with frontal face only as it's existing now, it's not recognizing 'angular camera' , 'tilted face' and 'face at a distance'.
For these 3 things to get recognized , do we need to do training of images with angular camera' , 'tilted face' and face at a distance?
So if we improve the detection ,does it improve the recognition as well OR are there any other ways to improve the recognition irrespective of whatever the detection(frontal currently) may be,

from android-face-recognition-with-deep-learning-test-framework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.