Zed parsing labels as unknown during ingest

Using the camera to do some custom object detections and I have been running into an issue where my label value is reading out as Unknown after ingest using Yolo. My code before conversion:

    # Creating ingestable objects for the ZED SDK
    obj = sl.CustomBoxObjectData()
    obj.bounding_box_2d = xywh2abcd(xywh, im0.shape)
    obj.probability = det.conf
    obj.label=int(det.cls)

Where det is an output of model.predict.

Printing obj.label here gives a value of 0, which makes sense as I am working with a single class.

The after code is shown as below:

zed.ingest_custom_box_objects(detections)
lock.release()
# Retrieve objects and bodies
returned_state = zed.retrieve_objects(objects, obj_runtime_param, obj_param.instance_module_id)
returned_state2 = zed.retrieve_bodies(bodies, body_runtime_param, body_param.instance_module_id)
for a in objects.object_list:
print(a.label)

Printing the object label here gives Unknown. It appears the label is being converted to an Unknown during the ingesting process, is there a reason for this?

Hello @GreenMachine ,

The label field is actually of OBJECT_CLASS type, to see the label ingested please use the raw_label field.

It could indeed be clearer in the doc, sorry for that.

This solved the issue, thank you!

1 Like