Skip to content

Instantly share code, notes, and snippets.

View willpatera's full-sized avatar

Will willpatera

View GitHub Profile
@willpatera
willpatera / marker_detector.py
Created April 11, 2014 03:33
Hacky modification of marker_detector plugin to demonstrate how one could save gaze positions on surface
'''
(*)~----------------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2014 Pupil Labs
Distributed under the terms of the CC BY-NC-SA License.
License details are in the file license.txt, distributed as part of this software.
----------------------------------------------------------------------------------~(*)
'''
export EDITOR=slime
export PATH=/usr/local/bin:/usr/local/sbin:$PATH
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"
# Set architecture flags
# export ARCHFLAGS="-arch x86_64"
# Ensure user-installed binaries take precedence
# path for node.js
@willpatera
willpatera / random_walk_glumpy.py
Created August 20, 2014 01:03
Python Random Walk 3D
#!/usr/bin/env python
import numpy as np
import scipy.spatial.distance as spd
import OpenGL.GL as gl
from glumpy import figure, Trackball
if __name__ == '__main__':
@willpatera
willpatera / _readme.md
Last active August 29, 2015 14:14
Demo code for Pupil Google Group

Eye Image Screen Capture and Apparent Pupil Size

This gist contains modified source code and an example plugin for the Pupil Google Group as a demonstration of concept. This code runs, but is not intended for distribution (only as one potential starting point for other users who might want to further develop a plugin that saves eye images in real-time along with pupil data.

Changes

screen_cap_eye.py

  • the very rough example of the plugin that could be developed to achieve eye screen captures along with other pupil data.

eye.py

@willpatera
willpatera / Readme.md
Last active January 2, 2016 14:49
Debugging marker tracker plugin from Pupil forum post
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@willpatera
willpatera / scan_path_no_flow.py
Created December 22, 2016 06:13
Scan Path Without Flow
'''
(*)~----------------------------------------------------------------------------------
Pupil - eye tracking platform
Copyright (C) 2012-2016 Pupil Labs
Distributed under the terms of the GNU Lesser General Public License (LGPL v3.0).
License details are in the file license.txt, distributed as part of this software.
----------------------------------------------------------------------------------~(*)
'''
@willpatera
willpatera / pupil_data_to_csv.py
Last active September 18, 2018 18:03
Read `pupil_data` pickle file and export as `.csv` file
# coding=utf-8
import pickle
import numpy as np
import sys
# open the pickled file
# replace with your path to pupil_data
if sys.version_info >= (3, 0):
pupil_data = pickle.load(open("/Users/wrp/recordings/2016_01_28/001/pupil_data","rb"),encoding='latin1')
else:
import time
# https://github.com/pupil-labs/pyndsi/tree/v1.0
import ndsi # Main requirement
GAZE_TYPE = "gaze" # Type of sensors that we are interested in
SENSORS = {} # Will store connected sensors
def main():
@willpatera
willpatera / gsettings-desktop-schemas.rb
Last active June 24, 2020 12:22
GStreamer 1.0 + Python Tests
require 'formula'
class GsettingsDesktopSchemas < Formula
homepage 'http://ftp.gnome.org/pub/GNOME/sources/gsettings-desktop-schemas/'
url 'http://ftp.gnome.org/pub/GNOME/sources/gsettings-desktop-schemas/3.10/gsettings-desktop-schemas-3.10.1.tar.xz'
sha256 '452378c4960a145747ec69f8c6a874e5b7715454df3e2452d1ff1a0a82e76811'
depends_on 'xz' => :build
depends_on 'pkg-config' => :build
depends_on 'intltool' => :build