This library lets you run machine learning models and collect sensor data on Linux machines using Python. The SDK is open source and hosted on GitHub: edgeimpulse/linux-sdk-python.See our Linux EIM executable guide to learn more about the .eim file format.
Windows Subsystem for Linux (WSL)If you are using WSL, you will need to install the following npm packages, and may need to install audio / video dependencies for your machine:e.g. audio dependencies for Ubuntu:
Before you can classify data you’ll first need to collect it. If you want to collect data from the camera or microphone on your system you can use the Edge Impulse CLI, and if you want to collect data from different sensors (like accelerometers or proprietary control systems) you can do so in a few lines of code.
To collect data from other sensors you’ll need to write some code to collect the data from an external sensor, wrap it in the Edge Impulse Data Acquisition format, and upload the data to the Ingestion service. Here’s an end-to-end example.
To classify data (whether this is from the camera, the microphone, or a custom sensor) you’ll need a model file. This model file contains all signal processing code, classical ML algorithms and neural networks - and typically contains hardware optimizations to run as fast as possible. To grab a model file:
This error shows when you want to gain access to the camera or the microphone on macOS from a virtual shell (like the terminal in Visual Studio Code). Try to run the command from the normal Terminal.app.
This error is due to the length of the results output.To fix this, you can overwrite this line in the class ImpulseRunner from the runner.py.
Copy
data = self._client.recv(1 * 1024 * 1024)
with:
Copy
data = b""while True: chunk = self._client.recv(1024) # end chunk has \x00 in the end if chunk[-1] == 0: data = data + chunk[:-1] break data = data + chunk