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?
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.
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.
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());
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.
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.