You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Main Camera > Perception Camera (Script) > Drag and drop the newly created files to the corresponding Camera Labelers Label Config (see image).
Project > Scene > Drag and drop the Pikachu model (.fbx), the model texture (.png), and the background image (png).
Project > Scene > Create > Material > Drag and drop the model texture (.png) to the new material's Surface Inputs > Base Map.
Project > Scene > Drag and drop the Pikachu model into the Hierarchy. For the moment, this Pikachu will appear without colors nor texture.
Drag and drop the material ball on the white Pikachu in Scene. Now the Pikachu should appear colored.
Hierarchy > Pikachu object > Inspector > Add Component > Labeling > Use Automatic Labeling > Labeling Scheme > Use asset name > Add to Label Config... > Select both TutorialIdLabelConfig and TutorialSemanticSegmentationLabelConfig (Add Label for both).
Hierarchy > Right click > 3D Object > Cube > Drag the background image and drop it on the Cube object (which should now have the texture of the background image).
Hierarchy > Cube > Inspector > Adjust the values of Transform according to the image.
Before proceeding, it might be necessary to modify the Directional Light to match some better values.
Hierarchy > Pikachu object > Inspector > Add Component > Fixed Lenght Scenario > Add Randomizer > RotationRandomizer > Set the values of the image.
Lastly, always in the Pikachu object Inspector > Add Component > Rotation Randomizer Tag (which is already present in the above image).
Now, by pressing the play button the data generation will begin.
To find where the images are being saved: Edit > Project Settings > Perception > Solo Endpoint > Base Path is the folder where the outputs are collected. (Show Folder) to check.
Part 3 - Train YOLO Model and use it in Real Time
It is convenient to repeat the synthetic data generation process with multiple position of the object in the frame. In this case, repeat the generation with 4 different position-size combination.
For each data generation (4) we have now a folder of sequences. The decision of generating sequences rather than single frames is because the first shot is blurry; the Perception package is so fast in making screenshots that the object movement cannot follow. The structure of the Unity outputs is as follows.
From each sequence extract the last frame, the 5-th. Together with the frame, we collect the data from the corresponding .json annotation and we save it in the YOLOv8 format, namely <class_id> <x_center> <y_center> <width> <height>. The script that does that is code/extract_frame_and_data.py.
Navigate to the output of the script and create a new file, data.yaml, with the following content. This is needed during the training of the YOLOv8 model.