Coder Social home page Coder Social logo

unable to run example.py about gazetracking HOT 4 CLOSED

HemantAHK avatar HemantAHK commented on August 16, 2024
unable to run example.py

from gazetracking.

Comments (4)

antoinelame avatar antoinelame commented on August 16, 2024

Hello,

Looks like your "shape_predictor_68_face_landmarks.dat" file is corrupted. Try to re-download it and check that the md5 checksum of the file is: 73fde5e05226548677a050913eed4e04

from gazetracking.

HemantAHK avatar HemantAHK commented on August 16, 2024

@antoinelame ok I have done it's working by the way how to trace the eye gazing of top and bottom I have used your functions but unable to trace top and bottom

from gazetracking.

antoinelame avatar antoinelame commented on August 16, 2024

At the moment, only is_right() and is_left() functions are available in the current version. It uses the horizontal_ratio() function that returns a number between 0.0 and 1.0 that indicates the horizontal direction of the gaze.

I didn't create is_top() and is_bottom() functions, but I have created vertical_ratio(). It's similar to horizontal_ratio(), it returns a number between 0.0 and 1.0.

You can use it to know if the gaze is at the top or at the bottom. Call this function, and if the number returned is around 0.0, it means that the pupil is at the top. If the number returned is around 1.0, it means that the pupil is at the bottom.

For convenience, if you need it, you also can create is_top() and is_bottom() functions like so:

def is_top(self):
        """Returns true if the user is looking to the top"""
        try:
            return self.vertical_ratio() <= 0.30
        except TypeError:
            return None

It will return true if the vertical_ratio is below 0.3.

It's up to you to define what number should be the limit between looking at the center and looking to the top (0.30 in my example). I had not created these functions because I found that the margin of error up/down was too large, unlike the left/right. I guess because the distance between the left and right end is greater than the distance between the upper and lower end.

Otherwise, is the position of your pupils correctly detected? For the moment, the program is mainly calibrated according to my eyes and webcam. So I wonder if it works as well for other people. If not, don't hesitate to change the value of the threshold. (in pupil.py, image_processing method, line 31, value currently at 20).

from gazetracking.

HemantAHK avatar HemantAHK commented on August 16, 2024

@antoinelame it is working fine. And I will try the changes.Thankyou for ur time.

from gazetracking.

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.