-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kinesis feature not printing any output #13
Comments
Hi @eliquinox 👋 , To obtain the prediction, please use the from neurosity import NeurositySDK
from dotenv import load_dotenv
import os
import time
# Load environment variables from a .env file
load_dotenv("my.env")
# Initialize Neurosity SDK with device ID
device_id = os.getenv("NEUROSITY_DEVICE_ID")
neurosity = NeurositySDK({"device_id": device_id})
# Log in to Neurosity
neurosity.login({
"email": os.getenv("NEUROSITY_EMAIL"),
"password": os.getenv("NEUROSITY_PASSWORD")
})
# Fetch device information
info = neurosity.get_info()
# Callback function to process the data
def callback(data):
print(data)
# Subscribe to kinesis events for the left arm
unsubscribe = neurosity.kinesis("leftArm", callback)
# Wait for 20 seconds to collect data
time.sleep(20)
# Unsubscribe and clean up
unsubscribe()
print("Finished execution of example.py") Here are the results from running the above script: {"label": "push", "metric": "kinesis", "probability": 0.01727728877348198, "timestamp": 1713891598118, "type": "training"}
{"label": "push", "metric": "kinesis", "probability": 0.013549573655196736, "timestamp": 1713891598243, "type": "training"}
{"label": "push", "metric": "kinesis", "probability": 0.01411070240397368, "timestamp": 1713891598368, "type": "training"}
{"label": "push", "metric": "kinesis", "probability": 0.01187809103675398, "timestamp": 1713891598493, "type": "training"} Please let me know if this works for you! PDT: If there is no response, it could be due to an incorrect naming of the trained action. |
In case someone else is also confused, exactly like @AdonaiVera said: unsubscribe = neurosity.kinesis_predictions("leftArm", callback) instead of unsubscribe = neurosity.kinesis("leftArm", callback) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have trained a kinesis
leftArm
via dev console and wanted to access it via the python API. My script:When I run the script, however, I get no output. Not sure where the problem is.
The text was updated successfully, but these errors were encountered: