- Copy
main.py
andmotors.py
to the SD card (USB mount) of your OpenMV device. - Reconnect your device with a serial terminal connected and wait for the
Type <a> for autopilot, <m> for manual control
message to appear. (N.B. It is not possible to use the OpenMV IDE serial terminal for this step because it does not allow keyboard input. Use (for example) Serial) - Type
m
to select manual mode. - Type
o
to start recording. - Control the robot with the keyboard, use
a
to steer left, ands
to steer right. - Type
p
to stop recording. - Grab the recorded .gif and .txt file from the OpenMV SD card (USB mount) and copy them to your local data storage directory (for example
data
in the autopilot directory)
Use the following terminal commands to augment & upload all data stored in the train
and test
directories to the train & test dataset of your Edge Impulse project.
find data/train | grep .gif | xargs -I"{}" python3 process_data.py training {}
find data/test | grep .gif | xargs -I"{}" python3 process_data.py testing {}
- Add an
Images
input block, aImage
DSP block and aKeras
learn block to your projext. - Set the input block image resolution for your project to 160 x 120 (width x height).
- Set the
color depth
for the DSP block toGrayscale
. - Generate the DSP features.
- Switch the Keras block to expert mode and paste in the code from
train.py
. - Train the neural network.
- Go to the deployments tab in the Edge Impulse studio and select the 'OpenMV' deployment type and download the ZIP file.
- Open the ZIP file and copy the trained.tflite file to the OpenMV SD card (USB mount) storage.
- Power up the openMV without a USB data connection, it should then run the program in autopilot mode automatically. With a data connection active type
a
for autopilot mode when prompted.