open_model_zoo icon indicating copy to clipboard operation
open_model_zoo copied to clipboard

[Suggestion] Improve Pedestrain Trackor C++ Demo

Open wdkwyf opened this issue 5 years ago • 6 comments

Hi, OpenVINO guys, I learn a lot from your Pedestrain Trackor demo, however I wonder why some intel model can't be supported in this demo. Such as person-detection-0203, person-detection-0106. Only person-detection-0201/0202 are supported.

I notice it's because the detection output is a little different, could you please improve the demo to let's try more detection models, because I want to try cascade-RCNN model to get better accuracy.

Thanks.

wdkwyf avatar Mar 31 '21 09:03 wdkwyf

@wdkwyf Thanks for your interest and feedback, we will review that. Especially it make sense, since we have introduced, so called, Model API, which is a model class hierarchy, intended to simplify and unify use of different models, solving the same task, in apps

vladimir-dudnik avatar Mar 31 '21 09:03 vladimir-dudnik

@vladimir-dudnik , Thank you. The 'model api' you mentioned is public now?

wdkwyf avatar Mar 31 '21 10:03 wdkwyf

@wdkwyf yes, you may take, for example, a look at C++ object_detection_demo (Python demo use similar approach) and you will find that a main application loop looks like (of course in simplified way):

std::unique_ptr<ModelBase> model; model.reset(new ModelYolo3(FLAGS_m, (float)FLAGS_t, FLAGS_auto_resize, FLAGS_yolo_af, (float)FLAGS_iou_t, labels));

InferenceEngine::Core core; AsyncPipeline pipeline(std::move(model), ConfigFactory::getUserConfig(FLAGS_d, FLAGS_l, FLAGS_c, FLAGS_pc, FLAGS_nireq, FLAGS_nstreams, FLAGS_nthreads), core);

while (keepRunning) { curr_frame = cap->read();

frameNum = pipeline.submitData(ImageInputData(curr_frame), std::make_shared<ImageMetaData>(curr_frame, startTime));

pipeline.waitForData();

//--- Checking for results and rendering data if it's ready
result = pipeline.getResult())
cv::Mat outFrame = renderDetectionData(result->asRef<DetectionResult>(), palette);

int key = cv::waitKey(1);
if (27 == key || 'q' == key || 'Q' == key)
{
    // Esc
    keepRunning = false;
}

}

So, we have a base Model class and several derived Model specifc classes. This way, model specific pre and post processing are tightly coupled with appropriate model class and not spread across the application. And with unified representation of generalized model task results (like object detection task), we can easily support many different object detection model topologies in single application. That the difference between previous Open Model Zoo demos where we got several object detection demos (if you remember): object_detection_demo_centernet, oject_detection_demo_faceboxes, object_detection_demo_retinaface, object_detection_demo_ssd_async, object_detection_demo_yolov3_async - all these and even more now covered by single demo application.

vladimir-dudnik avatar Mar 31 '21 15:03 vladimir-dudnik

@wdkwyf FYI, we are working in applying OMZ Model API to pedestrian tracker demo, see https://github.com/openvinotoolkit/open_model_zoo/pull/2654

vladimir-dudnik avatar Sep 10 '21 21:09 vladimir-dudnik

in applying OMZ Mod

@vladimir-dudnik Thanks! I'll check.

wdkwyf avatar Sep 13 '21 02:09 wdkwyf

@wdkwyf https://github.com/openvinotoolkit/open_model_zoo/pull/2654 merged and is now part of OpenVINO 2022.1 release

vladimir-dudnik avatar Apr 01 '22 13:04 vladimir-dudnik