DeepStream-Yolo icon indicating copy to clipboard operation
DeepStream-Yolo copied to clipboard

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

Open mutengchen opened this issue 3 years ago • 3 comments

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

mutengchen avatar Aug 29 '22 01:08 mutengchen

Maybe you can edit ./nvdsinfer_custom_impl_Yolo/nvdsparsebbox_Yolo.cpp

chengzihencai avatar Aug 29 '22 03:08 chengzihencai

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

sharoseali avatar Sep 03 '22 13:09 sharoseali

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

marcoslucianops avatar Sep 03 '22 13:09 marcoslucianops

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);

emad555 avatar Aug 31 '23 05:08 emad555