- pupil_labs.neon_recording.load(rec_dir_in: Path | str) NeonRecording¶
Load a
NeonRecording
- class pupil_labs.neon_recording.neon_recording.NeonRecording(rec_dir_in: Path | str)¶
Bases:
objectClass to handle the Neon Recording data
- Attributes:
info (dict): Information loaded from info.json
start_ts_ns (int): Start timestamp in nanoseconds
start_ts (float): Start timestamp in seconds
wearer (dict): Wearer information containing uuid and name
calibration (Calibration): Camera calibration data
device_serial (str): Serial number of the device
streams (dict): data streams of the recording
- property audio: AudioStream¶
Audio from the scene video
- Returns:
AudioStream
- property events: EventStream¶
Event annotations
- Returns:
EventStream
- property eye: VideoStream¶
Frames of video from the eye cameras
- Returns:
VideoStream
- property eye_state: EyeStateStream¶
Eye state data
- Returns:
EyeStateStream
- property gaze: GazeStream¶
2D gaze data in scene-camera space
- Returns:
- GazeStream: Each record contains
ts: The moment these data were recorded x: y: The position of the gaze estimate
- property scene: VideoStream¶
Frames of video from the scene camera
- Returns:
VideoStream
- class pupil_labs.neon_recording.calib.Calibration(version, serial, scene_camera_matrix, scene_distortion_coefficients, scene_extrinsics_affine_matrix, right_camera_matrix, right_distortion_coefficients, right_extrinsics_affine_matrix, left_camera_matrix, left_distortion_coefficients, left_extrinsics_affine_matrix, crc)¶
Bases:
NamedTuple- dtype = dtype([('version', 'u1'), ('serial', 'S6'), ('scene_camera_matrix', '<f8', (3, 3)), ('scene_distortion_coefficients', '<f8', (8,)), ('scene_extrinsics_affine_matrix', '<f8', (4, 4)), ('right_camera_matrix', '<f8', (3, 3)), ('right_distortion_coefficients', '<f8', (8,)), ('right_extrinsics_affine_matrix', '<f8', (4, 4)), ('left_camera_matrix', '<f8', (3, 3)), ('left_distortion_coefficients', '<f8', (8,)), ('left_extrinsics_affine_matrix', '<f8', (4, 4)), ('crc', '<u4')])¶
- class pupil_labs.neon_recording.stream.stream.InterpolationMethod(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
Enum- LINEAR = 'linear'¶
- NEAREST = 'nearest'¶
- NEAREST_BEFORE = 'nearest_before'¶
- class pupil_labs.neon_recording.stream.stream.SimpleDataSampler(data)¶
Bases:
object- property data¶
- sample(tstamps=None, method=InterpolationMethod.NEAREST)¶
- sampler_class¶
alias of
SimpleDataSampler
- to_numpy()¶
- property ts¶
- class pupil_labs.neon_recording.stream.stream.Stream(name, recording, data)¶
Bases:
SimpleDataSampler
- class pupil_labs.neon_recording.stream.av_stream.base_av_stream.AVStreamPart(container, audio_or_video)¶
Bases:
object- property frame_idx¶
- goto_index(frame_idx, frame_generator)¶
- class pupil_labs.neon_recording.stream.av_stream.base_av_stream.BaseAVStream(ts, audio_or_video)¶
Bases:
StreamSampler- property av_containers¶
- property av_streams¶
- class pupil_labs.neon_recording.stream.av_stream.base_av_stream.StreamSampler(raw_stream, sample_timestamps, audio_or_video)¶
Bases:
object- property data¶
- sample(tstamps=None, method=InterpolationMethod.NEAREST)¶
- to_numpy()¶
- property ts¶
- class pupil_labs.neon_recording.stream.av_stream.base_av_stream.TimestampedFrame(frame, ts)¶
Bases:
objectWraps either a
av.video.frame.VideoFrameor anav.audio.frame.AudioFrame- property bgr¶
- property gray¶
- property ts¶
- class pupil_labs.neon_recording.stream.av_stream.audio_stream.AudioStream(recording)¶
Bases:
BaseAVStreamAudio frames from a camera
Each item is a
TimestampedFrame- property rate¶
- class pupil_labs.neon_recording.stream.av_stream.audio_stream.AudioStreamPart(container, start_ts)¶
Bases:
AVStreamPart
- class pupil_labs.neon_recording.stream.av_stream.video_stream.GrayFrame(width, height)¶
Bases:
object- property bgr¶
- property gray¶
- class pupil_labs.neon_recording.stream.av_stream.video_stream.VideoStream(name, base_name, recording)¶
Bases:
BaseAVStreamVideo frames from a camera
Each item is a
TimestampedFrame- property height¶
- property width¶
- class pupil_labs.neon_recording.stream.av_stream.video_stream.VideoStreamPart(container, timestamps)¶
Bases:
AVStreamPart
- class pupil_labs.neon_recording.stream.event_stream.EventStream(recording)¶
Bases:
StreamEvent annotations
- Each record contains:
ts: The moment these data were recorded
event: The name of the event
- unique()¶
- class pupil_labs.neon_recording.stream.imu.imu_stream.IMUStream(recording)¶
Bases:
StreamMotion and orientation data
- Each record contains:
ts: The moment these data were recorded
- Gyroscope data
gyro_x
gyro_y
gyro_z
- Acceleration data
accel_x
accel_y
accel_z
- Orientation in Euler angles (degrees)
pitch
yaw
roll
- Orientation as a quaternion
quaternion_w
quaternion_x
quaternion_y
quaternion_z
- sampler_class¶
alias of
IMUStreamSampler
- class pupil_labs.neon_recording.stream.imu.imu_stream.IMUStreamSampler(data)¶
Bases:
SimpleDataSampler- sampler_class¶
alias of
IMUStreamSampler
- pupil_labs.neon_recording.stream.imu.imu_stream.parse_neon_imu_raw_packets(buffer)¶
- class pupil_labs.neon_recording.stream.eye_state_stream.EyeStateStream(recording)¶
Bases:
StreamEye state data
- Each record contains:
ts: The moment these data were recorded
pupil_diameter_left: The diameter of the left pupil in mm
eyeball_center_left_x: The position of the left eyeball relative to the scene camera, in mm
eyeball_center_left_y
eyeball_center_left_z
optical_axis_left_x: A vector in the forward direction of the left eye’s optical axis
optical_axis_left_y
optical_axis_left_z
pupil_diameter_left: The diameter of the right pupil in mm
eyeball_center_left_x: The position of the right eyeball relative to the scene camera, in mm
eyeball_center_left_y
eyeball_center_left_z
optical_axis_left_x: A vector in the forward direction of the right eye’s optical axis
optical_axis_left_y
optical_axis_left_z