Skip to main content

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())

Audio classification

from edgeimpulse.audio import AudioImpulseRunner
runner = AudioImpulseRunner('/path/to/your/model')
model_info = runner.init()
...
res = runner.classify(data)
print(res);

Classify audio from your microphone in real-time

from edgeimpulse.audio import AudioImpulseRunner
...
with AudioImpulseRunner('/path/to/your/model') as runner:
    model_info = runner.init()
    for res, audio in runner.classifier():
        print(res)

Image classification

from edgeimpulse.audio import ImageImpulseRunner
runner = ImageImpulseRunner('/path/to/your/model')
model_info = runner.init()
...
res = runner.classify(data)
print(res);

Classify images frames from your camera in real-time

from edgeimpulse.image import ImageImpulseRunner
import cv2

with ImageImpulseRunner('/path/to/your/model') as runner:
    model_info = runner.init()
    for res, img in runner.classifier():
        print(res)
        cv2.imshow('frame',img)
        cv2.waitKey()

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.14.tar.gz (5.4 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

edgeimpulse-0.0.14-py3.7.egg (13.0 kB view details)

Uploaded Egg

edgeimpulse-0.0.14-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file edgeimpulse-0.0.14.tar.gz.

File metadata

  • Download URL: edgeimpulse-0.0.14.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10+

File hashes

Hashes for edgeimpulse-0.0.14.tar.gz
Algorithm Hash digest
SHA256 dbb3352a3119b320221240853b2fe0d97488a8a40852fa29112abb1e82d64cc3
MD5 18cbb1e4432b410aacc9f46e8030de0b
BLAKE2b-256 c47cfb160431a43cd0914ed328c2e58e8e7c7f61b24b1d4d6eae9474a4055993

See more details on using hashes here.

File details

Details for the file edgeimpulse-0.0.14-py3.7.egg.

File metadata

  • Download URL: edgeimpulse-0.0.14-py3.7.egg
  • Upload date:
  • Size: 13.0 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10+

File hashes

Hashes for edgeimpulse-0.0.14-py3.7.egg
Algorithm Hash digest
SHA256 a2709452375671684f2aacd77abfc295132c2175dd48731719c3be7c6a6285c8
MD5 9ed417e40f35923740fbbe4bd864f7f1
BLAKE2b-256 573371c5c80468bd5734f298a6f5eab026d2fdd395ddd4561978abd1c868374b

See more details on using hashes here.

File details

Details for the file edgeimpulse-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: edgeimpulse-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.10+

File hashes

Hashes for edgeimpulse-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 5f150c2a82eb8fae60e710715641b17607a4e479838983e9949d89bd30ec8793
MD5 49293b7de7665017ae6ec720bd3c8c0e
BLAKE2b-256 e9837aa212161c3c9de42537a563e9245cb74898515adcf7df6ba2d0889fa0ce

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page