No objects of type HAILO_UNIQUE_ID

So far I’ve had a problem with the libre_id.so library for hailocropper. When there’s a detection, the pipeline gets a segmentation error. I’ve recompiled the file in debug mode to know where was the problem. Here you can see that this is where the “objects” is empty :

HailoUniqueIDPtr get_tracking_id(HailoDetectionPtr detection)
{
    auto objects = detection->get_objects_typed(HAILO_UNIQUE_ID);
    if (objects.empty()) {
        std::cerr << "Error: detection contains no objects of type HAILO_UNIQUE_ID" << std::endl;
        return nullptr;
    }

    for (auto obj : objects)
    {
        HailoUniqueIDPtr id = std::dynamic_pointer_cast<HailoUniqueID>(obj);
        if (!id) {
            std::cerr << "Error: dynamic_pointer_cast to HailoUniqueID failed" << std::endl;
            continue;
        }

        if (id->get_mode() == TRACKING_ID)
        {
            std::cout << "Tracking ID found: " << id->get_id() << std::endl;
            return id;
        }
    }

    std::cerr << "Error: No HailoUniqueID with mode TRACKING_ID found" << std::endl;
    return nullptr;
}

Then the get_id() method makes the program crash cause of the nullptr. Why does the detection->get_objects_typed(HAILO_UNIQUE_ID) returns an empty objects ?

hi @axplessis, we would like to reproduce the issue. For that, could you please add any extra details such as pipeline, env, and anything else relevant?

Hi @nina-vilela !

First, thank you for your answer.

My project is running on a raspberry pi 5 using a H8L and a camera module 3. I’ve downloaded the package hailo-all so tappas and hailort are a version late.

Here is the pipeline I made, adapted from the hailo-rpi5-examples pose-estimation.py and inspired by the multi-person-multi-camera-tracking script :

hailomuxer name=hmux libcamerasrc name=src_0 auto-focus-mode=2 ! video/x-raw, format=RGB, width=2304, height=1296 ! queue name=queue_src_scale max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! videoscale ! video/x-raw, format=RGB, width=576, height=324 ! tee name=t ! queue name=bypass_queue max-size-buffers=20 max-size-bytes=0 max-size-time=0 leaky=no ! hmux.sink_0 t. ! queue name=queue_hailonet max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! queue name=queue_yolo_scale max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! videoscale ! video/x-raw, format=RGB, width=640, height=640 ! videoconvert n-threads=3 ! hailonet hef-path=/home/rpi5-reanov/Documents/RoadFlea/hailo-rpi5-examples-1/basic_pipelines/../resources/yolov8s_pose_h8l_pi.hef batch-size=2 force-writable=true vdevice-key=1 ! queue name=queue_hailofilter max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! hailofilter function-name=filter so-path=/usr/lib/aarch64-linux-gnu/hailo/tappas//post-process/libyolov8pose_post.so qos=false ! queue name=queue_hmux max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! hmux.sink_1 hmux. ! queue name=hailo_pre_tracker leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 ! hailotracker name=hailo_tracker hailo-objects-blacklist=hailo_landmarks,hailo_depth_mask,hailo_class_mask,hailo_matrix class-id=1 kalman-dist-thr=0.7 iou-thr=0.8 init-iou-thr=0.3 keep-new-frames=2 keep-tracked-frames=1000 keep-lost-frames=8 qos=false ! hailocropper so-path=/home/rpi5-reanov/Documents/RoadFlea/hailo-rpi5-examples-1/basic_pipelines/../resources/cropper/libre_id.so function-name=create_crops internal-offset=true name=cropper2 hailoaggregator name=hmux2 cropper2. ! queue name=bypass_queue_reid max-size-buffers=20 max-size-bytes=0 max-size-time=0 leaky=no ! hmux2.sink_0 cropper2. ! queue name=pre_reid_q leaky=no max-size-buffers=10 max-size-bytes=0 max-size-time=0 ! queue name=queue_src_scale2 max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=no ! videoscale ! video/x-raw, format=RGB, width=128, height=256 ! videoconvert n-threads=3 ! hailonet hef-path=/home/rpi5-reanov/Documents/RoadFlea/hailo-rpi5-examples-1/basic_pipelines/../resources/repvgg_a0_person_reid_512.hef force-writable=true vdevice-key=1 ! queue name=reid_post_q leaky=no max-size-buffers=10 max-size-bytes=0 max-size-time=0 ! hailofilter so-path=/home/rpi5-reanov/Documents/RoadFlea/hailo-rpi5-examples-1/basic_pipelines/../resources/libre_id.so qos=false ! queue name=queue_hmux2 max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=no ! hmux2.sink_1 hmux2. ! queue name=hailo_pre_gallery leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 ! hailogallery similarity-thr=.4 gallery-queue-size=100 class-id=1 ! queue name=hailo_post_gallery leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 ! queue name=hailo_pre_draw leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 ! hailofilter use-gst-buffer=true so-path=/home/rpi5-reanov/Documents/RoadFlea/hailo-rpi5-examples-1/basic_pipelines/../resources/libre_id_overlay.so qos=false ! queue name=hailo_post_draw leaky=no max-size-buffers=30 max-size-bytes=0 max-size-time=0 ! queue name=queue_hailo_python max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! queue name=queue_user_callback max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! identity name=identity_callback ! queue name=queue_hailooverlay max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! hailooverlay ! queue name=queue_videoconvert max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! videoconvert n-threads=3 qos=false ! queue name=queue_hailo_display max-size-buffers=3 max-size-bytes=0 max-size-time=0 leaky=upstream ! fpsdisplaysink video-sink=xvimagesink name=hailo_display sync=false text-overlay=True signal-fps-measurements=true

I can provide more code samples if needed.

The initial problem I was experiencing was that the pipeline launched pretty well but crashed when a person faced the camera. I’ve managed to know that the crash occurred in libre_id.so cropper file using gdb. I then recompiled the file to avoid the crash and put instead an error message to specifically know where the crash was.

I should add that the tracker everything works well using the yolov8s_h8l.hef model with libyolo_hailortpp_post.so. I guess that the problem comes from the yolo_pose model but i really need those landmarks.

thank you for the extra details!
we are looking into it

1 Like

Hi @axplessis
Make sure that the tracker is configured to the correct class-id your network supplies. currently it is configured to class-id 1.

I used the pose estimation example to check the class used by the pose postprocess.
In the user callback I added code to get the class ID:

    for detection in detections:
        label = detection.get_label()
        bbox = detection.get_bbox()
        confidence = detection.get_confidence()
        class_id = detection.get_class_id()
        string_to_print += (f"Class id {class_id} \n")

The output is: Class id 0
So please try to change the tracker to track class-id 0

Run this to see all tracker available parameters:
gst-inspect-1.0 hailotracker

Hope it will solve your issue.

It solved it !

Thanks a lot

Awesome.
I’ll be happy to share your project with the community once it is done.
If it is fine by you off course :wink: