Giter Site home page Giter Site logo

Comments (10)

vardanagarwal avatar vardanagarwal commented on May 22, 2024

Thanks @ctippur. I switched from using Dlib facial landmark model to a TensorFlow model which I am pretty sure you can find in the repo. However, if you want to continue to use Dlib you can download the model from here: https://github.com/davisking/dlib-models/blob/master/shape_predictor_68_face_landmarks.dat.bz2.

Hope that solves the issue.

from proctoring-ai.

ctippur avatar ctippur commented on May 22, 2024

Thanks @vardanagarwal. I am looking for the most accurate method to determine the location points. If I understand right, TF model is a better way to go?

from proctoring-ai.

vardanagarwal avatar vardanagarwal commented on May 22, 2024

Yeah, based on my testing I felt is was better. You can have a look at the results here: https://towardsdatascience.com/robust-facial-landmarks-for-occluded-angled-faces-925e465cbf2e?sk=505eb1101576227f4c38474092dd4c22

from proctoring-ai.

ctippur avatar ctippur commented on May 22, 2024

Vardan,

Thank you. Thats quite impressive.
I modified contouring function to see if I can get just the center of pupil coordinates.

I seem to be getting a lot of (<class 'ValueError'>, ValueError('max() arg is an empty sequence'), <traceback object at 0x148fe4b90>)
I would also like to improve the precision. Any ideas on how I can improve the precision and not lose frames?

try:
        cnt = max(cnts, key = cv2.contourArea)
        M = cv2.moments(cnt)
        cx = int(M['m10']/M['m00'])
        cy = int(M['m01']/M['m00'])
        
        if right:
            cx += mid
        
        return eye, cx, cy
    except:
        print (sys.exc_info())
        return eye, None, None

from proctoring-ai.

vardanagarwal avatar vardanagarwal commented on May 22, 2024

That's to do with the threshold. If your threshold is very small then no contour will be detected leading to that error. You can add an if condition checking that length of cnts>0.

I am trying to figure out to automate the thresholding part then this won't be an issue.

Can you elaborate what you mean by precision here and why you feel it might lose frames if it is tried to be improved.

from proctoring-ai.

ctippur avatar ctippur commented on May 22, 2024

You are right. The threshold for the most part seem to be 0.
I will have to look at the precision question again. I have a still video and I was hoping to see the cx and cy to pretty much be the same. Since so many frames are being rejected.

To increase the threshold, I am looking at some variatiobs below. Let me know if we can collaborate.

    thresh = cv2.erode(thresh, None, iterations=2) 
    thresh = cv2.dilate(thresh, None, iterations=4) 
    thresh = cv2.medianBlur(thresh, 3) 
    thresh = cv2.bitwise_not(thresh)

from proctoring-ai.

vardanagarwal avatar vardanagarwal commented on May 22, 2024

Yeah sure! As mentioned earlier it is currently controlled by a trackbar which means it requires manual work so I am definitely up for it.

from proctoring-ai.

ctippur avatar ctippur commented on May 22, 2024

Quick benchmarking

| Threshold   |      Left x      |  left y | right x | right y |
|----------|:-------------:|------:|------:|------:|
| 1 |  180 | 180| 199 | 199 |
|3|165|165|180|180|

from proctoring-ai.

vardanagarwal avatar vardanagarwal commented on May 22, 2024

It would be better to close this issue and open up another one having the apt name so that anyone else looking to contribute can find it.

from proctoring-ai.

ctippur avatar ctippur commented on May 22, 2024

Perfect. Closing this to reopen another issue.

from proctoring-ai.

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.