This project is inspired by Daniel West's project to build a Lego sorter
This YouTube video is a nice explantion of the three steps to build a Lego sorter
1. Build a dataset to train the AI using the Ldraw Library and use blender to render the image, I have adapted this from J Theiner python script.
Control of the blender script as stand-alone: blender -b -P dataset/blender/render.py -- -i 9.dat --save ./ --images_per_brick 1 --config thumbnail.json
render images 50 for each id image size: 224x224x3 brick augmentation: 11,000 official brick colors rotation: in x direction due to no standardized origin: 0, 90, 180, 270 scaling: normalized one dimension and size variation via zooming factor [ ] surface texture and reflexion setting background: random images from Background.jpg image camera position: random on the surface on the upper half of a sphere exposure: random spot on the sphere surface, radius and energy fixed [ ] varying exposure Script to render all images: python dataset/generate_dataset.py
Hint for Mac users to access blender: /Applications/Blender/blender.app/Contents/MacOS/blender -b -P ...
2. Train the AI with Tensorflow using Kaggle using the cloud GPU to produce the preprocess the dataset & classifier model.
Once the Lego Bricks have been rendered it is uploaded to Kaggle 7 to build the Tensorflow Dataset which is compatible with Tensorflow.
Them the model can be trainned from the dataset.
System has been build on Raspberrypi Model B but is very slow and the AI has to be executed remotely.
Using the OpenMV it is hoped that the AI deployed onto the local machine.