Skip to content

Instantly share code, notes, and snippets.

View papr's full-sized avatar
🏠
Working from home

Pablo Prietz papr

🏠
Working from home
  • Berlin
  • 04:02 (UTC +01:00)
View GitHub Profile
@papr
papr / README.md
Last active September 29, 2022 15:10

Generate a Pupil-Player-compatible recording from a single, externally recorded, video file.

Dependencies:

pip install -r requirements.txt

Usage

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@papr
papr / nine_point_calibration.py
Created April 1, 2021 13:33
To use this calibration choreography, download the file and place it in the `Home directory -> pupil_capture_settings -> plugins` folder. Afterward, start Capture. You should be able to select the new choreography in the Calibration menu.
from calibration_choreography.screen_marker_plugin import ScreenMarkerChoreographyPlugin
from calibration_choreography.base_plugin import ChoreographyMode
class NinePointScreenMarkerChoreography(ScreenMarkerChoreographyPlugin):
label = "Nine-point Calibration"
@classmethod
def selection_label(cls) -> str:
return "Nine-point Screen Marker"
@papr
papr / pupil_mobile_imu_data.py
Created January 11, 2021 15:19
Loads Pupil Mobile IMu data into a pandas dataframe
import numpy as np
import pandas as pd
G = 9.78033
IMU_TYPE = np.dtype([
("time_s", "<f8"),
*((f"accel_{d}", "<f4") for d in "xyz"),
*((f"gyro_{d}", "<f4") for d in "xyz")
])
@papr
papr / custom_2d_pupil_detector.py
Created November 13, 2020 14:00
Example pupil detector plugin that extends the default 2D detector. Requires Pupil v2.6 or higher. Install instructions: https://docs.pupil-labs.com/developer/core/plugin-api/#adding-a-plugin Author: @romanroibu
import logging
from pupil_detectors import Detector2D, DetectorBase, Roi
from pyglui import ui
from methods import normalize
from pupil_detector_plugins import available_detector_plugins
from pupil_detector_plugins.detector_base_plugin import (
PropertyProxy,
@papr
papr / artificial_2d_pupil_detector.py
Last active November 16, 2020 16:57
Example pupil detector plugin that generates artificial pupil data. Requires Pupil v2.6 or higher. Install instructions: https://docs.pupil-labs.com/developer/core/plugin-api/#adding-a-plugin Author: @N-M-T
import logging
import numpy as np
from pupil_detectors import DetectorBase
from pyglui import ui
from methods import normalize
from pupil_detector_plugins.detector_base_plugin import PupilDetectorPlugin
from pupil_detector_plugins.visualizer_2d import draw_pupil_outline
@papr
papr / vis_single_circle.py
Last active September 1, 2020 10:46
Pupil Player third-party plugin that only visualizes the high-confidence gaze point that is closest to the current frame
"""
(*)~---------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2020 Pupil Labs
Distributed under the terms of the GNU
Lesser General Public License (LGPL v3.0).
See COPYING and COPYING.LESSER for license details.
---------------------------------------------------------------------------~(*)
"""
@papr
papr / gaze_with_offset_correction.py
Created August 31, 2020 12:59 — forked from pfaion/gaze_with_offset_correction.py
Offset Corrected Gaze From Recording
from pyglui import ui
import file_methods as fm
import player_methods as pm
from gaze_producer.gaze_producer_base import GazeProducerBase
from methods import denormalize
from player_methods import transparent_circle
class GazeFromRecordingWithOffsetCorrection(GazeProducerBase):
@papr
papr / README.md
Last active July 18, 2022 07:12
Dual-monocular Gazer for Pupil Capture, Service, and Player
@papr
papr / no_log_annotations.py
Created July 13, 2020 09:37
Custom Annotations-plugin that does not log incoming annotations
from annotations import Annotation_Capture
class No_Log_Annotation_Capture(Annotation_Capture):
def recent_events(self, events):
recent_annotation_data = []
while self.annotation_sub.new_data:
topic, annotation_datum = self.annotation_sub.recv()
recent_annotation_data.append(annotation_datum)
events["annotation"] = recent_annotation_data