marcoslucianops / DeepStream-Yolo

NVIDIA DeepStream SDK 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models
MIT License
1.42k stars 354 forks source link

Is there a way to obtain the coordinates of the bounding box #242

Closed mutengchen closed 1 year ago

mutengchen commented 2 years ago

I used yolov5 to train a model for recognizing icons. I want to know how to get the specific coordinate position (X,Y coordinate) of the bounding box

chengzihencai commented 2 years ago

Maybe you can edit ./nvdsinfer_custom_impl_Yolo/nvdsparsebbox_Yolo.cpp

sharoseali commented 1 year ago

If one wants to redraw the boxes in another way or to draw polygons on the frame, Is there any way to do that ??

marcoslucianops commented 1 year ago

https://github.com/NVIDIA-AI-IOT/deepstream_python_apps

emad555 commented 1 year ago

you can add the following lines to all_bbox_generated function in deepstream_app_main.c, then compile the file and copy the new bin file to the bin folder.

 float left = (float)obj->rect_params.left;
        float top = (float)obj->rect_params.top;
        float width = (float)obj->rect_params.width;
        float height = (float)obj->rect_params.height;

        g_print("Object ID: %d\n", obj->object_id);
        g_print("Class ID: %d\n", obj->class_id);
        g_print("Bounding Box (Left, Top, Width, Height): %.2f, %.2f, %.2f, %.2f\n", left, top, width, height);