This code generates image datasets with annotations and labels for training your neural network by one click.
Using Blender 2.91 on Pop!_OS 20.04 LTS
- Prepare your 3D models (*.blend files) and backgrounds (*.hdr files).
- Paste the code into Blender Scripting Window and change to absolute paths of your models folder and backgrounds folder, unless you know where your blender script placed.
- Chage some variables like image numbers etc.
- Note that this code also generates KITTI format dataset for my other project, and it's not 100% correct for other general using. But the COCO dataset does.
Detection using YOLOv5 trained by generated dataset
According to this paper, pay attention to the texture of model to render.
Note: For saving time, used Evee (Blender real-time render engine) to render the training set (1500 images) and Cycles to render the validation set (500 images). So, theoretically, using Cycles for both will have a better performance.