Python runner for real-time ML classification
Reason this release was yanked:
Please use edge-impulse-linux instead
Project description
Edge Impulse Linux SDK for Python
This library lets you run machine learning models and collect sensor data on Linux machines using Python. This SDK is part of Edge Impulse where we enable developers to create the next generation of intelligent device solutions with embedded machine learning. Start here to learn more and train your first model.
pip install edgeimpulse
runner.py
Implements the ImpulseRunner
use:
from edgeimpulse.runner import ImpulseRunner
import signal
runner = None
def signal_handler(sig, frame):
print('Interrupted')
if (runner):
runner.stop()
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
...
runner = ImpulseRunner(modelfile)
model_info = runner.init()
...
res = runner.classify(features[:window_size].tolist())
Classify from microphone in real-time
from edgeimpulse.audio import AudioImpulseRunner
...
runner = AudioImpulseRunner('/path/to/your/model')
runner.init()
classifier = runner.classify()
for res in classifier:
print(res)
Classify from camera in real-time
from edgeimpulse.camera import CameraImpulseRunner
import cv2
...
runner = CameraImpulseRunner('/path/to/your/model')
runner.init()
classifier = runner.classify()
for res, img in classifier:
print(res)
cv2.imshow('frame',img)
examples:
/camera
/microphone
camera
Classifies frames grabbed directly from the webcam.
microphone
Classifies audio acquired directly from the audio interface.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
edgeimpulse-0.0.7.tar.gz
(4.7 kB
view hashes)
Built Distribution
Close
Hashes for edgeimpulse-0.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16e2db733b9176c4f8c4d13be9b7e209395d45ef6c8c07414b0cc79dc33e6667 |
|
MD5 | 2bcb547437a71e5a5855a1e2fe93b3ad |
|
BLAKE2b-256 | b65af74022646e82790c221126ce7f639f28e5a0bb463766b0f1ebdaa65bdabc |