• Stars
    star
    117
  • Rank 300,555 (Top 6 %)
  • Language Cython
  • License
    Other
  • Created over 9 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

python binding to libuvc
tests Code style: Black https://img.shields.io/badge/skeleton-2022-informational

pyuvc

Python bindings for the Pupil Labs fork of libuvc with super fast jpeg decompression using libjpegturbo (utilizing the tubojpeg api).

  • cross platform access to UVC capture devices.
  • Full access to all uvc settings (Zoom,Focus,Brightness,etc.)
  • Full access to all stream and format parameters (rates,sizes,etc.)
  • Enumerate all capture devices with device_list()
  • Capture instance will always grab mjpeg conpressed frames from cameras.

Image data is returned as Frame object. This object will decompress and convert on the fly when image data is requested. This gives the user the full flexiblity: Grab just the jpeg buffers or have them converted to YUV or Gray or RGB and only when you need.

The Frame class has caching build in to avoid double decompression or conversion.

Install via PyPI

pip install pupil-labs-uvc

Example

See examples/ for code examples.

Install from source

pyuvc requires the following dependencies:

Once the dependencies are installed, you can pip install the source tree:

git clone https://github.com/pupil-labs/pyuvc --recursive
export FORCE_LOCAL_LIBUVC_BUILD=ON
pip install ./pyuvc

Linux

Ubuntu/Debian:

apt-get update -y
apt-get install -y libusb-1.0-0-dev libturbojpeg-dev
Running as a non-root user

One needs to setup udev rules and add the target user to the plugdev group to avoid the privileged access requirement.

echo 'SUBSYSTEM=="usb",  ENV{DEVTYPE}=="usb_device", GROUP="plugdev", MODE="0664"' | sudo tee /etc/udev/rules.d/10-libuvc.rules > /dev/null
sudo udevadm trigger
sudo usermod -a -G plugdev $USER
# logout and back in

macOS

Homebrew:

brew update
brew install libusb jpeg-turbo
Running as a non-root user

Unfortunately, this is currently not possible. See this libusb issue thread for details.

WINDOWS

Run the following code in a powershell to install the dependencies (requires 7z to be installed)

pip install build delvewheel
git clone https://github.com/pupil-labs/pyuvc --recursive
cd pyuvc
scripts/download-deps-win.ps1 -DEPS_TMP_PATH tmp
$Env:DEPS_PATHS_LOC = "tmp/dep_paths.json"
python -m build -w   # will create a wheel in dist/ folder; insert the wheel path below
python scripts/repair-wheels-win.py $Env:DEPS_PATHS_LOC <wheel location> wheelhouse
pip install wheelhouse/<wheel name>
Manual driver installation

pyuvc requires the libUSBk driver to be installed for your corresponding camera. Otherwise, metadata like the product name will be set to "unknown".

Please see these instructions on how to manually install libUSBk drivers for your specific camera.

More Repositories

1

pupil

Open source eye tracking
Python
1,423
star
2

hmd-eyes

Building blocks for eye tracking in AR and VR.
C#
150
star
3

pupil-helpers

Scripts, Utilities and other Helpers for Pupil
Jupyter Notebook
47
star
4

pupil-community

Community contributed plugins and projects using Pupil
42
star
5

pye3d-detector

Python
34
star
6

pyglui

cython powered OpenGL gui that works with glfw
C
29
star
7

pySLAM

python binding for LSD SLAM
Python
28
star
8

pupil-tutorials

Jupyter Notebooks demonstrating how to process Pupil Player exports
Jupyter Notebook
24
star
9

pupil-docs

Documentation for Pupil - open source eye tracking
Vue
24
star
10

pupil-detectors

C++
23
star
11

pupil-geometry

Pupil Hardware Interface Camera Mounts
15
star
12

pupil-invisible-monitor

DEPRECATED - Use https://docs.pupil-labs.com/invisible/how-tos/data-collection-with-the-companion-app/monitor-your-data-collection-in-real-time.html instead.
Python
10
star
13

pyv4l2

cython powered bindings for v4l2 capture
Python
9
star
14

PuRe-open

Open source implementation of the PuRe pupil detector.
9
star
15

pyndsi

Python
8
star
16

pyximea

Python bindings for ximea XiAPI
Python
8
star
17

realtime-python-api

Pupil Labs Realtime API client
Python
6
star
18

neon-geometry

Reference CAD files for NEON integrations
6
star
19

pynanovg

cython powered bindings for nanovg
Python
6
star
20

nslr-hmm

Python implementation of the NSLR-HMM eye movement identification algorithm. | Fork of https://gitlab.com/nslr/nslr-hmm
Python
6
star
21

pupil-labs-website

The Pupil Labs Website
CoffeeScript
4
star
22

real-time-blink-detection

Python
4
star
23

densepose-module

Implementation of detectron2 denspose estimation with acknowledgement of body parts gazed.
Python
4
star
24

real-time-screen-gaze

Python
4
star
25

nslr

C++ implementation of the Naive Segmented Linear Regression algorithm with Python bindings. | Fork of https://gitlab.com/nslr/nslr
C++
4
star
26

pyvideoinput

C++
3
star
27

cygl

Open GL cython definitions and utils
C
3
star
28

pi_preview

Pupil Invisible Gaze Preview
Python
3
star
29

dynamic-rim-module

A tool to remap gaze from the scene camera onto screen content
Python
3
star
30

neon-player

Python
3
star
31

realtime-network-api

Realtime Network API
HTML
3
star
32

pl-recover-recording

Python
3
star
33

pl-rec-export

Pupil Labs Recording Export Tool
Python
2
star
34

pupil-docker-ubuntu

Pupil development dependencies Ubuntu Docker image
Shell
2
star
35

pyfontstash

python bindings for fontstash
Python
2
star
36

gaze-controlled-cursor-demo

Python
2
star
37

pupil-core-network-client

A Python client for the Pupil Core Network API
Python
2
star
38

pupil-docs-website

static site generator for pupil docs
JavaScript
2
star
39

pupil-matching-evaluation

Repository for the evaluation of the Pupil Core gaze matching algorithm
Jupyter Notebook
2
star
40

pl-neon-matlab

Use your Neon eyetracker in MATLAB and Octave
MATLAB
1
star
41

neon-xr

C#
1
star
42

camera

Python module that handles camera intrinsics and projections across multiple Pupil Labs projects
Python
1
star
43

gulp-sharp-minimal

Simple sharp plugin for gulp to modify images
JavaScript
1
star
44

pupil-demo

Python
1
star
45

surface-tracker

Python
1
star
46

pupil-icon-font

Icon font for Pupil software
JavaScript
1
star
47

pupil-core-pipeline

Python
1
star
48

pupil-picoflexx

Pico Flexx Backend for Pupil Capture
Python
1
star
49

pl-neon-recording

An API for working with raw data from Neon recordings
Python
1
star
50

realtime-matlab-experiment

A simple Matlab experiment that demonstrates how to start/stop Pupil Invisible recordings and send events to Pupil Invisible over the network
MATLAB
1
star
51

tag-aligner

Jupyter Notebook
1
star