Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D model points to be made as dynamic from the input image or video #11

Open
Anandddev opened this issue Feb 13, 2019 · 11 comments
Open

Comments

@Anandddev
Copy link

I would like ot know how to change the 3D model points declared in Pose_estimator.py with respect to different image size that is 1280 X 1084

def __init__(self, img_size=(480, 640)):
    self.size = img_size

    # 3D model points.
    self.model_points = np.array([
        (0.0, 0.0, 0.0),             # Nose tip
        (0.0, -330.0, -65.0),        # Chin
        (-225.0, 170.0, -135.0),     # Left eye left corner
        (225.0, 170.0, -135.0),      # Right eye right corne
        (-150.0, -150.0, -125.0),    # Left Mouth corner
        (150.0, -150.0, -125.0)      # Right mouth corner
    ]) / 4.5

Please suggest me the way to get out of this to improve my accuracy of landmark point detection

@yinguobing
Copy link
Owner

The __init__ function accepts a tuple as image size. May I ask why do you want to modify the model points according to the image size?

@Anandddev
Copy link
Author

I would like to obtain results in real time using an webcam which capotures 1280X1080. Without changing the model points accuracy is less when compared with older one output. Please suggest me how can i increase my accuracy to maximum.

@Anandddev
Copy link
Author

I would like to increase the accuracy of the facial eye points as i feel that it is not matching the eyes of the video captured and also the eye detection must be improved mainly and so i need to increase accuracy

@yinguobing
Copy link
Owner

I'm afraid the detection accuracy is actually up to the CNN model, not the 3D face model points. If a more accurate result is required, you may want to try other CNN models with better performance, as this model is quite simple and is more of a demonstration work.

@Anandddev
Copy link
Author

Thanks for your reply. Please guide me the steps to be done for the processing of pose estimation of eye detection with image resolution of 1280 X 1080 and import into the pose estimation code which contains image size as 480, 640

@yinguobing
Copy link
Owner

The variation of image resolution is already handled by this line in the demo file.

Did you find anything unusual when using that file directly?

@Anandddev
Copy link
Author

Thank you for the reply i am clear now. Can you tell me the method you have used to calculate the below mentioned points

3D model points.

self.model_points = np.array([
    (0.0, 0.0, 0.0),             # Nose tip
    (0.0, -330.0, -65.0),        # Chin
    (-225.0, 170.0, -135.0),     # Left eye left corner
    (225.0, 170.0, -135.0),      # Right eye right corne
    (-150.0, -150.0, -125.0),    # Left Mouth corner
    (150.0, -150.0, -125.0)      # Right mouth corner
]) / 4.5

And i would like to undersatnd the requirement of you using "/4.5" whta is the purpose of this 4.5 in this code

And also i am unable to do the training for our own datasets with tensorflow. Please guide us the method you used to train the data's step by step. I would like to know the steps you followed to train the dataset of eye detection with tensorflow. I would also prefer to know how did you perform the annotation of eyes

Please guide me in tensorflow training step by step procedure and annotation of eyes

@Anandddev
Copy link
Author

I would like to know how to change the below mentioned points of Facial landmarks
self.model_points = np.array([
(0.0, 0.0, 0.0), # Nose tip
(0.0, -330.0, -65.0), # Chin
(-225.0, 170.0, -135.0), # Left eye left corner
(225.0, 170.0, -135.0), # Right eye right corne
(-150.0, -150.0, -125.0), # Left Mouth corner
(150.0, -150.0, -125.0) # Right mouth corner
]) / 4.5


And i would like to undersatnd the requirement of you using "/4.5" whta is the purpose of this 4.5 in this code


And also i am unable to do the training for our own datasets with tensorflow. Please guide us the method you used to train the data's step by step. I would like to know the steps you followed to train the dataset of eye detection with tensorflow. I would also prefer to know how did you perform the annotation of eyes


Please guide me in tensorflow training step by step procedure and annotation of eyes

@yinguobing
Copy link
Owner

For the training part, please refer to this repo.

The face model points are used for pose estimation. Check out this function but also be aware this repo actually use another function with 68 points involved.

The number 4.5 is for scaling. You may refer to the OpenCV documentation for the technical details of PnP, or this post that makes a good explanation.

@Anandddev
Copy link
Author

I am unable to match the corner points of the eye detection can u help me to improve the eye detection using facial landmark points

@yinguobing
Copy link
Owner

For a better result you might want to read this great paper:
Face Alignment In-the-Wild: A Survey

Wish that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants