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
  • 18:32 (UTC +02:00)
View GitHub Profile
@papr
papr / README.md
Last active October 25, 2022 07:38
Surface crop tool

Cropping surface areas from an external image

This tool allows you to automatically crop and align Pupil-Capture-defined surface areas from an external image of the actual surface.

Caveats:

  • The script will assume that the provided image is not distorted.

Installation

@papr
papr / read_psychopy_hdf5.py
Created August 25, 2022 08:27
Extract eye tracking data recorded by PsychoPy ioHub
import pandas as pd
recording_hdf5 = pd.HDFStore(path_to_hdf5_file, "r")
binocular_data = recording_hdf5[
"/data_collection/events/eyetracker/BinocularEyeSampleEvent"
]
monocular_data = recording_hdf5[
"/data_collection/events/eyetracker/MonocularEyeSampleEvent"
]
@papr
papr / export_template_data.py
Created June 27, 2022 11:25
Pupil Player plugin to export template questions and answers from Pupil Invisible recordings
import json
import logging
import pathlib
from plugin import Plugin
from pupil_recording import PupilRecording, RecordingInfo
logger = logging.getLogger(__name__)
@papr
papr / README.md
Last active November 22, 2022 08:18
This Python script extracts gaze, IMU, and template data from raw Invisible recordings.

PI Export Utility

This Python script extracts gaze, IMU, and template data from raw Invisible recordings. Gaze and IMU data are exported as CSV files. Template data as json.

Usage: pi-export.py [OPTIONS] [RECORDINGS]...

Options:
 -e, --export-folder TEXT Relative export path [default: `/export`]
import abc
import collections
import json
import logging
import pathlib
import threading
import time
from typing import Deque, Mapping, NamedTuple, Optional, Type, Union
try:
@papr
papr / requirements.txt
Last active January 17, 2022 13:42
Python script to turn off the Pupil Capture world camera via the Network API
msgpack>=1.0.0
pyzmq
@papr
papr / README.md
Last active December 10, 2021 17:00
Dual-Display HMD Calibration Choreography

Dual-Display HMD Calibration Choreography

The components below allow Pupil Core to calibrate gaze for separate head-mounted displays. As a result, Pupil Core can estimate gaze within custom target coordinate systems for each eye. This is different from the dual-monocular calibrations which calibrate each eye separately but assume the target coordinate system to be the same for both eyes.

There are three major components:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@papr
papr / temporal_alignment_overlay.py
Last active October 9, 2022 12:28
Video overlay plugin for Pupil Player with manual temporal-alignment option. See this link for install instructions https://docs.pupil-labs.com/developer/core/plugin-api/#adding-a-plugin
import logging
from pyglui import ui
from video_overlay.controllers.overlay_manager import OverlayManager
from video_overlay.models.config import Configuration
from video_overlay.plugins.generic_overlay import Video_Overlay
from video_overlay.ui.management import UIManagementGeneric
from video_overlay.ui.menu import GenericOverlayMenuRenderer
from video_overlay.utils.constraints import ConstraintedValue, InclusiveConstraint
from video_overlay.workers.overlay_renderer import OverlayRenderer