Generate synthetic image for ML / TriggerBox problem

Hello, this is my first UE project the aim is to produce synthetic images to train a ML model, for this reason I need to know the total number of spawn objects visible in the viewport frustum of the camera.

What I’ve done so far:

  • A basic conveyor belt that move overlapping object forward
  • An Emitter that spawn random instances (Set Child Actor Class) on the conveyor belt
  • I thought to use a TriggerBox Enter/Leave event to track the number of instances but the events get fired at the end of the conveyor belt! not when they actually happen or not fired at all??

Any suggestions on the best approach to accomplish this?

What I still need to figure out beside the trigger:

  • How to write to a file (i.e a CSV) to annotate the number of detected objects in the viewport for the current frame
  • How to render the current frame into an image
    (I’m trying to replicate what I’ve done in a Blender script I have no idea if I can accomplish this in UE)

I’ve uploaded the project removing all the textures for the startup content but is still 130mb. hopefully someone can give me some advice how to progress