Transfer_learning app full image:

hi,
i customized transfer_leaning app and try to get image with i want bbox only,
full image is created by dummy_obj inside probe,
as obj list already, it should be got all obj_params, i tried to acquire display meta and add on frame but getting nothing bounding box to show.
i noted the probe scale obj dimensions to full frame, maybe it covers all, or how to move the probe to osd src pad?
so how to do for my issue?

thank you very much!

Hi,

We are going to check this issue in deep.
Will share more information with you later.

Hi,

Could you share how do you check the bounding box?
We can get the bbox information in the output/labels/ when using save-img-full-frame=1

Thanks.

yes can get bbox informations at labels,
but i want to show my target bounding box on images which takes, this is problem.
and keep all bbox on RTSP out screens, too, but EGL is not important for me.

thank you.

Hi,

Do you want to get the NvDsObjectMeta data in the overlay_graphics(.) function?
If yes, have you tried to call the nvds_acquire_obj_meta_from_pool(.)?
https://docs.nvidia.com/metropolis/deepstream/sdk-api/group__metadata__structures.html#ga73332e651df84e9e9528825b376c8232

Thanks.

hi,
before the line:
at_least_one_image_saved |= save_image(img_producer.get_image_full_frame_path_saved(),
ip_surf, &dummy_obj_meta, frame_meta, dummy_counter);
i have acquire obj_meta and add it to frame already, but none boxes on snap images at all.
i want to show boxes which i am interest on images.

thank you

Hi,

Sorry for the late reply.

Is this still an issue for you?
If yes, would you mind sharing your customization with us for reproducing?

Thanks.

yes it is really a long time problem for me still, this is my code which in transfer learning cpp, i tried two ways to acquire but can not get bbox to show on images:

    if(at_least_one_confidence_is_within_range) {
        for (NvDsMetaList *l_obj = frame_meta->obj_meta_list; l_obj != nullptr;
             l_obj = l_obj->next) {
            NvDsObjectMeta *obj_meta = static_cast<NvDsObjectMeta *>(l_obj->data);
            if (!obj_meta_is_above_min_confidence(obj_meta)
                || !obj_meta_box_is_above_minimum_dimension(obj_meta))
                continue;

            ImageMetaProducer::IPData ipdata = make_ipdata(appCtx, frame_meta, obj_meta);

            /// Store temporally information about the current object in the producer
            bool data_was_stacked = img_producer.stack_obj_data(ipdata);
            /// Save a cropped image if the option was enabled
            if (data_was_stacked && g_img_meta_consumer.get_save_cropped_images_enabled())
                at_least_one_image_saved |= save_image(ipdata.image_cropped_obj_path_saved,
                                                       ip_surf, obj_meta, frame_meta, obj_counter);
            if (data_was_stacked && !full_frame_written
                && g_img_meta_consumer.get_save_full_frame_enabled()) {
                unsigned dummy_counter = 0;
                /// Creating a special object meta in order to save a full frame
                NvDsObjectMeta dummy_obj_meta;
                dummy_obj_meta.rect_params.width = ip_surf->surfaceList[frame_meta->batch_id].width;
                dummy_obj_meta.rect_params.height = ip_surf->surfaceList[frame_meta->batch_id].height;
                dummy_obj_meta.rect_params.top = 0;
                dummy_obj_meta.rect_params.left = 0;
                NvDsObjectMeta *obj_meta = nvds_acquire_obj_meta_from_pool(batch_meta); //
                NvDsObjectMeta *obj_parent = obj_meta->parent; //
                nvds_add_obj_meta_to_frame (frame_meta, obj_meta, obj_parent); //
                //NvDsDisplayMeta *display_meta = nvds_acquire_display_meta_from_pool(batch_meta);
                //nvds_add_display_meta_to_frame (frame_meta, display_meta);
                at_least_one_image_saved |= save_image(img_producer.get_image_full_frame_path_saved(),
                                                       ip_surf, &dummy_obj_meta, frame_meta, dummy_counter);
                full_frame_written = true;
            }
            at_least_one_metadata_saved |= data_was_stacked;
        }
    }
    /// Send information contained in the producer and empty it.
    if(at_least_one_metadata_saved) {
        img_producer.send_and_flush_obj_data();
        g_img_meta_consumer.data_was_saved_for_source(source_number);
    }
    g_img_meta_consumer.unlock_source_nb(source_number);
}
/// Wait for all the thread writing jpg files to be finished. (joining a thread list)
if (at_least_one_image_saved)
    nvds_obj_enc_finish(g_img_meta_consumer.get_obj_ctx_handle());

}

pls give an advice for the problem still, i want to draw object’s bbox on all images which have been snapped.

thank you

Hi,

Sorry for the late update.

The sample is trying to save some images for further training.
As you can find, the after_pgie_image_meta_save is attached right behind the primary nvinfer.

But please note that the bounding box is added after nvosd.
You will need to add the osd_sink_pad_buffer_probe to nvosd and save the image.

Thanks.

pls give more advice about where to add osd_sink_probe then i can get result which i want?

thank you very much really!

Hi,

Thanks for your patience.

You can find a jpeg encoder example in the osd_sink_pad_buffer_probe in the below example:

/opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-image-meta-test/

Please add it to the overlay_graphics function accordingly.
Thanks.

oh, it is seems a very nice idea! ::)))
i try this way as soon as possible and let you know.
and pls help me check sgie tensor problem at another topic.

thank you so much!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.