In CMD/Terminal, run:
git clone https://github.com/feagi/trainer.gitcd trainerpython3 -m venv venv(for Windows,python -m venv venv)source venv/bin/activate- Once the venv is activated, run:
- Linux / Mac:
pip3 install -r requirements.txtpython3 controller.py --api_key "<insert link here>" (replace <insert link here> without removing the quotes in the command).
- Windows:
pip install -r requirements.txtpython controller.py --api_key "<insert link here>" (replace <insert link here> without removing the quotes in the command).
- Linux / Mac:
At this point, the websocket should be successfully connected. You should see a log of the websocket URL (wss:// . . .), with no errors following.
- Python version 3.8+
- Pip version 21+ (?)
- api key (get from /brain-visualizer on NeuroRobotics Studiounder main nav Embodiment -> Magic Link)
- Command Prompt (CMD) or PowerShell (Windows) / Terminal (Mac or Linux)
- Git (https://git-scm.com/downloads for Windows. Mac and Linux should have it by default)
A trainer has been built to send FEAGI images and display the image in the browser with FEAGI's guess of what that image is.
- To use it, after doing the installation steps above, open a separate terminal and run the Flask server with
python utils/flask_server.py. This will open a separate browser window displaying the current image. - Any images in feagi_trainer/ will be sent. They should be named x-y-z to match FEAGI's language (such as 0-1-0.jpg).
- To confirm everything is set up, you can manually test FEAGI's ID recognition output:
- In the brain visualizer GUI, click the + beside Cortical Areas, click Output, and select ID recognition from the dropdown.
- Shift + click anywhere in the ID recognition cortical area and hit space to activate. You should see "FEAGI Guess" update above the image in the separate browser window. It will change depending on the selected voxel.
- In the GUI, again click the + beside Cortical Areas, click Output, and select Recognition Location from the dropdown.
- Shift-click any two locations in Vision_MR and hit space. You should see a bounding box appear in the current image.
Do you have the image inside the folder? If not, you will need to grab an image and place it in the folder where the controller is located, or follow the path specified in your configuration.json's image_path.
Your image's name should be formatted like this: #-#-#. For example, 0-0-1, 1-0-0, 0-2-3. They all need to be in an image format such as PNG, JPEG, JPG, or any other static format. You can add them without restarting your trainer, as it is designed to work with dynamic file changes.
Go to image_display_duration in your configuration.json. Update it to the number of seconds you want the image to stay on display.
Go to image_gap_duration in your configuration.json and update it to the number of seconds you want the image to stay off.
Example command: python controller.py --help
optional arguments:
-h, --help Show this help message and exit.
-api_key API_KEY, --api_key API_KEY
Use an api key. You can find your api key from NeuroRobotics studio website.
-ip IP, --ip IP Specify the FEAGI IP address.
-port PORT, --port PORT
Change the ZMQ port. Use 30000 for Docker and 3000 for localhost.
--csv_data_range
Defines the minimum and maximum values of the data. Example: --csv_data_range -5 10. Default: 0 10
--csv_path
Specifies the path to the CSV file. Example: --csv_path my_vision_data.csv
If you see an error like this:
NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
warnings.warn(
This issue occurs due to Mac's security, which is perfectly acceptable and understandable.
To fix this, follow these steps:
- Open Finder.
- Go to Applications (on the left side).
- Click on Python 3.x.
- Double-click on
Install Certificates....ommandfile. - Wait for it to be done then close the terminal it popped.
- Re-run your Python script.
TODO: Add text describing the folowing image in detail