christian-vorhemus / azure-percept-py Goto Github PK
View Code? Open in Web Editor NEWLibrary to access the sensors of Azure Percept in Python
License: Apache License 2.0
Library to access the sensors of Azure Percept in Python
License: Apache License 2.0
Add a simulation flag so that the code can also be used (and tested) on servers without an actual Percept.
Hi @christian-vorhemus !
Following up on the discussion in pypa/auditwheel#354 I was wondering whether it would make sense to pool our resources to maintain FFmpeg builds for Python projects.
To be more specific, in order to cut down on the build time for PyAV
wheels for Linux / Mac / Windows, I maintain this:
https://github.com/PyAV-Org/pyav-ffmpeg
These are builds of FFmpeg + its dependencies, built via cibuildwheel to ensure they are using the exact toolchains required for linking them in Python wheels. The output is a tarball per platform contain include
and lib
directories.
Windows is a special case, I have not (yet?) been able to compile FFmpeg and its dependencies from source, so I rely on third party builds.
Any thoughts?
The problem appears when running the sample code from the README. The error varies (running the same code) and may also include malloc(): corrupted unsorted chunks 3
or free(): corrupted unsorted chunks
When I install the device, I always get "Operation time out"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="0673", MODE="666"
and reloading itStack:
โ python azure-percept-test.py
Authenticating sensor...
Exception in thread Thread-2:
Traceback (most recent call last):
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/azure/iot/percept/_device_authentication.py", line 94, in start_authentication
read_msg = dev.read(self.read_endpoint, 5120)
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/usb/core.py", line 1029, in read
ret = fn(
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/usb/backend/libusb1.py", line 846, in bulk_read
return self.__read(self.lib.libusb_bulk_transfer,
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/usb/backend/libusb1.py", line 954, in __read
_check(retval)
File "/home/user/.pyenv/versions/3.8.12/lib/python3.8/site-packages/usb/backend/libusb1.py", line 602, in _check
raise USBTimeoutError(_strerror(ret), ret, _libusb_errno[ret])
usb.core.USBTimeoutError: [Errno 110] Operation timed out
Currently the library only supports nets with one tensor as output. Support for multi-tensor outputs should be added.
It seems like the debug level set on the myriad library is set to INFO which results in a lot of logging messages that are put to standard out. It would be cleaner if only errors or critical messages would be shown (potentially on stderr) or - even better - letting the user set the log level.
There are memory leaks detected using tracemalloc and psutil.Process(os.getpid()). Goal of this issue is to diagnose them further and fix them eventually.
Thanks a lot for creating this module to easily contorl camera and audio hardware !
Will it support control audio led in the future?
Thanks.
The function should return the image array fast, at the moment it takes several seconds.
When I create a .wav
file but don't close the device (just call stop_recording
) the file created is invalid:
formats: can't open input file `./sample.wav': WAVE: RIFF header not found
RuntimeError: Error loading audio file: failed to open file ./sample.wav
Example Code:
audio = AudioDevice()
print("Authenticating sensor...")
while True:
if audio.is_ready() is True:
break
else:
time.sleep(1)
print("Authentication successful!")
while True:
audio.start_recording("./sample.wav")
time.sleep(1)
audio.stop_recording() # Closes WAV file
# Don't call this to simulate problem
# audio.close()
Reference:
In general the function is buggy as it doesn't return the correct number of frames.
Hi!
Thanks a lot for creating this, amazing that we can use all the sensors this easily!
Currently I am working on a project, but I would love to learn more on how you enabled the Azure ear audio recording. Could you explain in a bit more detail how the audio recording works in this library? Is there a way to do this easily ourselves or do we need to use this library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.