How to simply pass buffers through hailotilecropper and hailotileaggregator?

Hello. I would like to simply pass buffers through hailotilecropper and hailotileaggregator. I want to run object detection on high-resolution images using tappas/apps/h8/gstreamer/general/tiling/README.rst at master · hailo-ai/tappas · GitHub every x seconds and managed to disable inference using the pass-through property of the hailonet element. I need to do similar for the 2 aforementioned elements since they are compute-intensive. Thank you.

Hey @FlorinCiobotea,

Since the hailotilecropper and hailotileaggregator elements don’t have a built-in pass-through feature, you can minimize their computational load by adjusting their properties to effectively act as “pass-through” components in your GStreamer pipeline. Here’s how you can achieve this:

  1. Configure hailotilecropper for Pass-Through:

    • Set tiles-along-x-axis and tiles-along-y-axis to 1 to disable tiling.
    • Set overlap-x-axis and overlap-y-axis to 0 to disable overlap calculations.
    • Use single-scale mode by setting tiling-mode=0.
    • Example:
      gst-launch-1.0 \
          filesrc location=input.mp4 ! \
          decodebin ! \
          hailotilecropper tiles-along-x-axis=1 tiles-along-y-axis=1 overlap-x-axis=0 overlap-y-axis=0 tiling-mode=0 ! \
          videoconvert ! autovideosink
      
  2. Configure hailotileaggregator for Pass-Through:

    • Since tiling is effectively disabled by the above configuration, hailotileaggregator will not need to perform complex operations. Use the default configuration to maintain minimal resource usage.
    • Pipeline example:
      gst-launch-1.0 \
          hailotilecropper tiles-along-x-axis=1 tiles-along-y-axis=1 overlap-x-axis=0 overlap-y-axis=0 tiling-mode=0 ! \
          hailotileaggregator ! \
          videoconvert ! autovideosink
      
  3. Run Inference Every X Seconds:

    • Use the videorate element to limit the frame rate going into the hailonet element.
    • Set max-rate=1/x to process one frame every x seconds.
    • Example:
      gst-launch-1.0 \
          filesrc location=input.mp4 ! \
          decodebin ! \
          videorate max-rate=1/x ! \
          hailotilecropper tiles-along-x-axis=1 tiles-along-y-axis=1 overlap-x-axis=0 overlap-y-axis=0 tiling-mode=0 ! \
          hailonet hef-path=model.hef ! \
          hailotileaggregator ! \
          videoconvert ! autovideosink
      

By configuring hailotilecropper with these property values, you effectively minimize its computational load while maintaining compatibility with your pipeline. The hailotileaggregator can be used with its default configuration since tiling is disabled.

This setup allows you to run inference at your desired intervals using the videorate element, while keeping the computational overhead of hailotilecropper and hailotileaggregator to a minimum.

Let me know if you have any further questions or need additional assistance!