Unity-Technologies/com.unity.perception

the Frames Per Iteration attribute in the FixedLengthScenario class

hanshuai1232000 opened this issue · 7 comments

What is the meaning of the Frames Per Iteration attribute in the FixedLengthScenario class? The result I see is that each sequence generates the number of pictures set by Frames Per Iteration, and each one is different? What is the difference between these pictures?
截图20230324151117

A perception run is made up sequences and steps (or frames per iteration). At the start of each sequence, all of the randomizers will be executed, following that the amount of "frames per iteration" will be captured before the sequence ends, and the next sequence begins. It is our way to enable multiple captures (for instance video) in a scene before re-randomizing again.

If I set frames per iteration=5, 5 pictures will be generated in each step. What is the difference between these 5 pictures? I found that they are indeed different.

The unity simulation is running, so depending on scripts that might be attached to your game objects, physics, etc a lot could change. If there are no dynamic events occurring in the frame then the pictures should be nearly identical

Oh, got it, thank you for your patience

Hello, I still can't understand the meaning of the "iteration" attribute after reading the documents. What is the "iteration" used for? @StevenBorkman

Here's an example, let's say you want to capture a car moving. In this example you want to randomize the scene 4 times, capture 25 frames of the car driving after the scene has been reset and re-randomize. This will produce a total of 100 frames.

So how this works internally is that the Scenario class will go through all of the randomizers and change the structure of the scene. For example, changed the lighting, the starting location of the car, the color of the car, etc. Now the simulation will run for the number of "frames per iteration" (25 in our example) just like a normal unity game, going through the events of all the game objects. In our example, it would be the car driving down the road. After the "frames per iteration" the Scenario class will re-run the randomizer, reset the scene, and do it all over again. We will do this in total of 4 times.

For our example to work, we would set the following parameters in the inspector for our Fixed Length Scenario:
Frames Per Iteration: 25
Iteration Count: 4

Hope this helps, and please feel free to continue to ask questions, if it doesn't make sense.

I see. Thanks for the help.