This project contains several components:
- A data collection script that downloads 3D models of lego pieces from the MecaBricks website
- A synthetic image generation script that creates images of the 3D models from different angles and lighting conditions
- A machine learning model that categorizes the images into different lego piece types
Part | Image 1 | Image 2 | Image 3 | Image 4 | Image 5 |
---|---|---|---|---|---|
1x1 Plate | |||||
1x2 Plate | |||||
2x2 Plate | |||||
2x4 Plate |
- Python 3.6+
- Blender 2.8+
- Jupyter Notebook
- Dependencies:
pip install -r requirements.txt
To collect the data, simply run the create_objs.ipynb
notebook. This will download the 3D models of the lego pieces from the MecaBricks website as json, convert them to obj files, and save them in the parts_obj
directory.
To generate synthetic images, open Blender and run the RandomView.py
script. This will load the obj files from the parts_obj
directory, render images of the 3D models from different angles and lighting conditions, and save them in the output
directory.
TODO
- MecaBricks
- Blender
- Background images from random public domain sources and gen AI