EYE2FIX

๐Ÿ”- Optical Biosignals
๐Ÿ‘๏ธ- Eye Gaze

EyeTrack2Fixation ๐Ÿ‘

๐Ÿ“ Table of Contents

  1. ๐Ÿ“š What is EyeTrack2Fixation?
  2. ๐Ÿ”ง How to install EyeTrack2Fixation?
  3. ๐Ÿš€ How to use EyeTrack2Fixation?
  4. ๐Ÿ“ฆ Dependencies
  5. ๐Ÿ“ง Contact

๐Ÿ“š What is EyeTrack2Fixation?

Pipeline to derive fixation features from eye-tracking records.
A fixation is a stable gaze on a point of interest.

Input

Required Features (#2 or #3) Description
* Time Timestamp of the eye-tracking record.
* X and Y eye coordinates Coordinates of the eye gaze.
or
* Left X and Y eye coordinates Coordinates of the left eye gaze.
* Right X and Y eye coordinates Coordinates of the right eye gaze.

The system automatically scans a list of potential column names (case-insensitive) for the features and assigns the values accordingly (see in src/constants.py).

Supported input data formats:

pandas DataFrame
.txt
.csv

Example:

    Time       Left_X  Left_Y  Right_X  Right_Y  
0   554262330  92.60   648.54  79.27    648.36 

๐Ÿ’ก "At timestamp 554262330` the left eye is at coordinates `(92.60, 648.54)` (in px) and the right eye is at coordinates `(79.27, 648.36) (in px)."

or

    Time       X     Y
0   554262330  92.60  648.54

๐Ÿ’ก "At timestamp 554262330` the eyes are at coordinates `(92.60, 648.54) (in px)."

Output

Features (#5) Description
* Start Time Timestamp of the start of the fixation.
* End Time Timestamp of the end of the fixation.
* Duration Duration of the fixation.
* End X X coordinate of the last fixation point.
* End Y Y coordinate of the last fixation point.

Output data format:

pandas DataFrame

Example:

   starttime  endtime    duration  endx       endy
0  554264326  555036492  772166    84.680000  647.890000

๐Ÿ’ก"At timestamp 554264326` the fixation starts and ends at timestamp `555036492` with a duration of `772166` nanoseconds. The fixation ends at coordinates `(84.680000, 647.890000) (in px)."

๐Ÿ”ง How to install EyeTrack2Fixation?

If you don't yet have Python installed, you can download it from Python Official Website!

If you don't yet have Git installed, you can download it from Git Official Website!

  1. Clone the repository by running following command in your terminal:
    git clone https://github.com/hubii-world/EyeTrack2Fixation-01.git
  2. Navigate to the project root directory by running the following command in your terminal:
    cd EyeTrack2Fixation
  3. Create a virtual environment and activate it (Python Version 3.10 or higher):
    python3 -m venv venv
    source venv/bin/activate
  4. Install the required packages by running the following command in your terminal:
    pip install -r requirements.txt

๐Ÿš€ How to use EyeTrack2Fixation?

  1. Via file path:
    • _Example .txt-file available in repository MARKDOWN_HASH26466766d214015c1510472c88628631MARKDOWNHASH!
from src.feature_extraction import Eye2FixExtractor

ffe = Eye2FixExtractor(data='../data/raw/eyetracker_freeviewing.txt')
efix = ffe.extract_features()
  1. Via pandas DataFrame:
    • If you have left and right eye coordinates:
import pandas as pd
from src.feature_extraction import Eye2FixExtractor

df = pd.DataFrame({
    'Time': [554262330, 554264326 , 554266315],
    'Left_X': [92.60, 185.06, 190.84],
    'Left_Y': [648.54, 647.05, 637.12],
    'Right_X': [79.27, 84.30, 84.77],
    'Right_Y': [648.36, 648.73, 649.84]
})

ffe = Eye2FixExtractor(data=df)
efix = ffe.extract_features()
  • If you only have x and y coordinates:
import pandas as pd
from src.feature_extraction import Eye2FixExtractor

df = pd.DataFrame({
    'Time': [554262330, 554264326 , 554266315],
    'X': [85.935, 84.680, 87.805],
    'Y': [648.450, 647.890, 643.480]
})

ffe = Eye2FixExtractor(data=df)
efix = ffe.extract_features()

๐Ÿ“ฆ Dependencies

๐Ÿ“ง Contact

HUman BIosignal Intelligence Hub (HUBII)

Nach oben scrollen