pyomyo

PyoMyo - Python Opensource Myo armband library

https://github.com/perlinwarp/pyomyo

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.0%) to scientific vocabulary

Keywords

emg hacktoberfest myo myo-armband neuroscience pyomyo python virtual-reality vr
Last synced: 6 months ago · JSON representation ·

Repository

PyoMyo - Python Opensource Myo armband library

Basic Info
  • Host: GitHub
  • Owner: PerlinWarp
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 3.49 MB
Statistics
  • Stars: 151
  • Watchers: 13
  • Forks: 32
  • Open Issues: 6
  • Releases: 1
Topics
emg hacktoberfest myo myo-armband neuroscience pyomyo python virtual-reality vr
Created over 4 years ago · Last pushed 7 months ago
Metadata Files
Readme License Citation

README.md

PyoMyo

Python module for the Thalmic Labs Myo armband.

Cross platform and multithreaded and works without the Myo SDK.

pip install pyomyo Documentation is in the Wiki, see Getting Started.

Playing breakout with sEMG

PyoMyo Documentation

Home
Getting started
Common Problems
Myo Placement

The big picture

Why should you care?
Basics of EMG Design

Links to other resources

Python Open-source Myo library

This library was made from a fork of the MIT licensed dhzu/myo-raw. Bug fixes from Alvipe/myo-raw were also added to stop crashes and also add essential features.

This code was then updated to Python3, multithreading support was added then more bug fixes and other features were added, including support for all 3 EMG modes the Myo can use.

Note that sEMG data, the same kind gathered by the Myo is thought to be uniquely identifiable. Do not share this data without careful consideration of the future implications.

Also note, the Myo is outdated hardware, over the last year I have noticed a steady incline in the cost of second hand Myos. Both of my Myo's were bought for under £100, I do not recommend spending more than that to acquire one. Instead of buying one you should join the discord to create an open hardware alternative!

Included Example Code

The examples sub-folder contains some different ways of using the pyomyo library. git clone https://github.com/PerlinWarp/pyomyo

plotemgsmat.py

Left to Right Wrist movements.

Starts the Myo in mode 0x01 which provides data that's already preprocessed (bandpass filter + rectified).
This data is then plotted in Matplotlib and is a good first step to see how the Myo works.
Sliding your finger under each sensor on the Myo will help identify which plot is for sensor.

dino_jump.py

Chrome Dinosaur Game

An example showing how to use the live classifier built into pyomyo, see Getting Started for more info.

myomultithreadingexamp.py

Devs start here.
This file shows how to use the library and get Myo data in a seperate thread.

Myo Modes Explained

To communicate with the Myo, I used dzhu's myo-raw. Then added some functions from Alvipe to allow changing of the Myo's LED.

emg_mode.PREPROCESSED (0x01)
By default myo-raw sends 50Hz data that has been rectified and filtered, using a hidden 0x01 mode.

emg_mode.FILTERED (0x02)
Alvipe added the ability to also get filtered non-rectified sEMG (thanks Alvipe).

emg_mode.RAW (0x03)
Then I further added the ability to get true raw non-filtered data at 200Hz. This data is unrectified but scales from -128 and 127.

Sample data and a comparison between data captured in these modes can be found in MyoEMGPreprocessing.ipynb

The library

pyomyo.py

Prints sEMG readings at 200Hz straight from the Myo's ADC using the raw EMG mode.
Each EMG readings is between -128 and 127, it is the most "raw" the Myo can provide, however it's unlikely to be useful without extra processing. This file is also where the Myo driver is implemented, which uses Serial commands which are then sent over Bluetooth to interact with the Myo.

Classifier.py

Implements a live classifier using the k-nearest neighbors algorithm.
Press a number from 0-9 to label incoming data as the class represented by the number.
Press e to delete all the data you have gathered.
Once two classes have been made new data is automatically classified. Labelled data is stored as a numpy array in the data\ directory.

Owner

  • Name: Peter Walkington
  • Login: PerlinWarp
  • Kind: user
  • Location: London
  • Company: @facebook + @ctrl-labs

Recently graduated CS student working on VR and BCIs. Joined CTRL-Labs in November 2022.

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: PyoMyo
message: Python open-source Myo library
type: software
authors:
  - given-names: Peter
    family-names: Walkington
    email: perlinwarp@gmail.com
    orcid: 'https://orcid.org/0000-0003-3195-8679'
identifiers:
  - type: doi
    value: 10.5281/zenodo.7632303
repository-code: 'https://github.com/PerlinWarp/pyomyo'
url: 'https://github.com/PerlinWarp/pyomyo/wiki'
abstract: >-
  Python open-source Myo library (PyoMyo) is a
  cross-platform library made for the Thalmic Labs Myo that
  implements a Bluetooth protocol over Serial using the
  included dongle.
keywords:
  - EMG
  - electromyography
license: MIT
commit: 23f5d4c57034c7a82a354d0f4e6d5f69061b642b
version: 0.0.5
date-released: '2021-11-13'

GitHub Events

Total
  • Watch event: 14
  • Member event: 2
  • Push event: 5
  • Pull request event: 2
  • Gollum event: 2
  • Fork event: 4
  • Create event: 1
Last Year
  • Watch event: 14
  • Member event: 2
  • Push event: 5
  • Pull request event: 2
  • Gollum event: 2
  • Fork event: 4
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 27
  • Total Committers: 3
  • Avg Commits per committer: 9.0
  • Development Distribution Score (DDS): 0.111
Top Committers
Name Email Commits
perlinwarp p****p@g****m 24
PerlinWarp P****p@g****m 2
Bit4QU4 c****1@g****m 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 8
  • Average time to close issues: 3 days
  • Average time to close pull requests: 6 days
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 0.57
  • Average comments per pull request: 0.25
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: 5 minutes
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • PerlinWarp (4)
  • mayorhao (1)
  • Marcus1818787 (1)
  • bn2022 (1)
Pull Request Authors
  • PerlinWarp (4)
  • Bit4QU4 (2)
  • brunorchaves (2)
  • kir486680 (1)
Top Labels
Issue Labels
enhancement (4)
Pull Request Labels
hacktoberfest-accepted (3)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 133 last-month
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 2
    (may contain duplicates)
  • Total versions: 6
  • Total maintainers: 1
pypi.org: pyomyo

Python Opensource Myo library

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 120 Last month
Rankings
Stargazers count: 6.9%
Forks count: 7.8%
Dependent packages count: 10.1%
Average: 14.3%
Dependent repos count: 21.6%
Downloads: 25.0%
Maintainers (1)
Last synced: 6 months ago
pypi.org: openemg

Python Opensource EMG library

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 13 Last month
Rankings
Stargazers count: 6.9%
Forks count: 7.8%
Dependent packages count: 10.1%
Average: 18.1%
Dependent repos count: 21.6%
Downloads: 44.0%
Maintainers (1)
Last synced: 6 months ago