Has anyone built a Semantic Segmentation with python on RPi 5 with Hailo 8L

Hi everyone,

I am trying to build a semantic segmentation pipeline using the models available in model_zoo. I can find the associated code in C++ but not in Python. I tried modifying the Python code of instance segmentation, but it is very convoluted and something or the other is missing (like the .so file). Plus, I cannot find the JSON files of the semantic segmentation model in the model zoo at hailo_model_zoo/docs/public_models/HAILO8L/HAILO8L_semantic_segmentation.rst at c13e20e18f8d2913549b9061d7ea2b47d1a18a51 · hailo-ai/hailo_model_zoo · GitHub

Has anyone created a project related to semantic segmentation? Plus, I would recommend that the developers add the official Python code as well, since instance segmentation is already present.

Hey @Parikshit_Singh_Rath,

Welcome to the Hailo Community!

We’re currently working on upgrading the C++ app for semantic segmentation, so that should be available pretty soon.

In the meantime, You can use the segmentation pipeline . You’d just need to swap out the postprocess and model to fit your needs.

We’re also developing a dedicated semantic app, though it won’t make it into the next release - it’ll be in the one after that.

If you run into any issues with the postprocessing or pipeline setup, feel free to reach out. Happy to help!

I want to be very clear that my feedback is specifically about the Hailo AI HAT for Raspberry Pi 5.

After more than a year on this platform, the gap between the product brief and the actual developer experience is significant:

  • Python support for the Pi 5 AI HAT is still not available.

  • HailoRT cannot be accessed from Python on Raspberry Pi 5.

  • The GStreamer pipelines run, but they keep all inference metadata internally, so developers get no usable class IDs, scores, or bounding boxes.

  • Key model assets (JSON configs, postprocess definitions, etc.) are missing or inconsistent.

  • Several release cycles have passed with no progress toward exposing inference results or enabling real Python-based applications on the Pi 5 HAT.

For those of us working specifically with the AI HAT for Raspberry Pi 5, it increasingly feels like this product has been deprioritized or left behind. That may not be intentional, but the absence of meaningful updates for over a year creates exactly that impression.

Clear communication and a concrete roadmap would really help the community understand whether full Python support and inference-access on Raspberry Pi 5 are truly planned — or not. Developers simply need to know what to expect going forward.

Thanks.

Hey @Ole_Jakob_Opdal-Sell,

Welcome to the Hailo Community!

Thanks for the feedback!

Just wanted to address your points:

  1. Python support is actually available through the hailo-all installer. If you run pip list | grep hailo on your RPi, you’ll see hailort is installed. For examples on how to use it directly, check out our repo here: Hailo-Application-Code-Examples/runtime/python at main · hailo-ai/Hailo-Application-Code-Examples · GitHub

  2. Like I mentioned, hailort can be accessed directly with Python!

  3. GStreamer can extract all the data you need. Here’s the callback for detection - it shows how to extract everything:

# This is the callback function that will be called when data is available from the pipeline
def app_callback(pad, info, user_data):
    # Get the GstBuffer from the probe info
    buffer = info.get_buffer()
    # Check if the buffer is valid
    if buffer is None:
        hailo_logger.warning("Received None buffer | frame=%s", user_data.get_count())
        return Gst.PadProbeReturn.OK

    # Using the user_data to count the number of frames
    user_data.increment()
    frame_idx = user_data.get_count()
    string_to_print = f"Frame count: {user_data.get_count()}\n"

    # Get the caps from the pad
    format, width, height = get_caps_from_pad(pad)
    hailo_logger.debug("Frame=%s | caps fmt=%s %sx%s", frame_idx, format, width, height)

    # If the user_data.use_frame is set to True, we can get the video frame from the buffer
    frame = None
    if user_data.use_frame and format is not None and width is not None and height is not None:
        # Get video frame
        frame = get_numpy_from_buffer(buffer, format, width, height)

    # Get the detections from the buffer
    roi = hailo.get_roi_from_buffer(buffer)
    detections = roi.get_objects_typed(hailo.HAILO_DETECTION)

    # Parse the detections
    detection_count = 0
    for detection in detections:
        label = detection.get_label()
        bbox = detection.get_bbox()
        confidence = detection.get_confidence()
        if label == "person":
            # Get track ID
            track_id = 0
            track = detection.get_objects_typed(hailo.HAILO_UNIQUE_ID)
            if len(track) == 1:
                track_id = track[0].get_id()
            string_to_print += (
                f"Detection: ID: {track_id} Label: {label} Confidence: {confidence:.2f}\n"
            )
            hailo_logger.debug(
                "Frame=%s | Detection person | id=%s conf=%.2f bbox=(x=%.1f,y=%.1f,w=%.1f,h=%.1f)",
                frame_idx,
                track_id,
                confidence,
                bbox.xmin(),
                bbox.ymin(),
                bbox.width(),
                bbox.height(),
            )
            detection_count += 1
    if user_data.use_frame:
        # Note: using imshow will not work here, as the callback function is not running in the main thread
        # Let's print the detection count to the frame
        cv2.putText(
            frame,
            f"Detections: {detection_count}",
            (10, 30),
            cv2.FONT_HERSHEY_SIMPLEX,
            1,
            (0, 255, 0),
            2,
        )
        # Example of how to use the new_variable and new_function from the user_data
        # Let's print the new_variable and the result of the new_function to the frame
        cv2.putText(
            frame,
            f"{user_data.new_function()} {user_data.new_variable}",
            (10, 60),
            cv2.FONT_HERSHEY_SIMPLEX,
            1,
            (0, 255, 0),
            2,
        )
        # Convert the frame to BGR
        frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)
        user_data.set_frame(frame)

    print(string_to_print)
    hailo_logger.info(string_to_print.strip())
    return Gst.PadProbeReturn.OK
  1. All the resources you’re looking for are in the config. If you run into any specific issues or bugs, just let me know and I’ll be happy to help fix them!

  2. Regarding the apps - I’ve shared some already, but we’re also working on integrating everything into a single hailo-apps package for easier access.

Hope this helps you get started and build what you’re working on! Don’t hesitate to reach out if you need anything else.