Code from the 2020 FTC team of Cloud Robotics.
The pathing code to spline together curved paths is provided by Road Runner.
The Neural Network is done with Easy Opencv in tangent with the YOLO RNN framework from darknet
For more detailed instructions on getting Road Runner setup in your own project, see the Road Runner README.
-
Download or clone this repo with
git clone https://github.com/acmerobotics/road-runner-quickstart
. -
Open the project in Android Studio and build
TeamCode
like any otherftc_app
project. -
Add in the dependencies from Road Runner's README and EasyOpenCV's README
- Download the dependencies mentioned by AlexeyAB to install darknet
- Make a dataset of images (a hundred / object for simple objects works, and include images without the object to leave blank)
- Label the images (I used LabelImg) with the yolo setting turned on (for the images without the objects
- Create the configuration files for training an object instructions here
- Download darknet53.conv.74
- (I used Windows PowerShell) Navigate to the darknet file and start training (example code shown below, but change files based on what you named them)
.\darknet detector train data/obj.data yolo-obj.cfg darknet53.conv.74
Follow AlexeyAB's instructions for training a custom neural network
It is very important to label all of the object that you want to identify in the images you have, otherwise the neural network will have a very hard training when it keeps identifying an object correctly and being told that it is wrong
The best labeling tool I found for creating my custom dataset for Skystone and Stones (of around 325 photos) was LabelImg
For objects that are obscured, label the part that is visible
I found that it was necessary to use the YOLO-tiny configuration for the processing power of our SamsungGalaxyS5
Road Runner's online quickstart documentation.
Darknet's YOLO documentation
For more information on how YOLO works, watch Joseph Redmon's TED Talk:
Currently there is a bug where files duplicate themselves causing names which break the gradle build, and to fix this type
.\gradlew clean
into the terminal of the project (for IntelliJ, the terminal can be found with View-ToolWindows-Terminal)