Welcome back to the OpenVINO channel
On video 47 we saw how to install the Gstreamer Video analytics.
Basically we have added analytic elements to the pool of Gstreamer elements,
so now you can use inference operations in a gstreamer pipeline..
Now I'd like to show you some more samples and tricks on how to use it.
Last video I showed you a "shell" Gtreamer sample That looks like that
But we have also C++ samples..
Let's look at the face-attribute sample for example..
Under gstreamer..samples/ cpp/ We can just run the "build and run"
And you can see that it's again a full application, with multiple face related models.
Looking at the code, You might need to change the location of the video file,
And you can see that it's pretty detailed..
Maybe it's easier to run the shell scripts, but these c++ examples can give you more details
and can serve as great reference code you could just copy to your application..
Let's quickly look at the other shell samples..
This is the gstreamer execution line for Console-measure-fps-CPU
As you can see we read the video file..
We decode it and convert it
And we are performing detection, on the CPU, With batch size of 1.
We can have the option to skip frames, here we are running inference on each frame..
And then we present the FPS to the screen.
The code for running on GPU, the console-measure-fps-GPU has 2 things to note:
1) The VAAPI drivers environment flag is set to one, telling Gstreamer to use the GPU driver for decode and other operations
2) You see that the inference run on the GPU.. Device=GPU
Another interesting example is vehicle-detection-2sources, cpu or gpu
It is really 2 pipelines..
This is one pipeline: decode-convert-detect-display
And this is the other pipeline
What is interesting is that they both have the same inference-ID.
So this inferences could be treated as one entity
and the parameters like batch size etc. could be specified only in one place
And this is the last samples I wanted to show you, the face-detection-multi-channel
You can see here a string, called PIPELINE_STR, holding a full pipeline with detection
And here is a loop that adds to this string more channels.
As many as you want. 2 in this case
So when you actually run the gstreamer pipeline, you get multiple channels working..
Just for the demonstration, I have added a display to the multi-channel face detection..
You can see here the base string, With the display option that I added.
This will be duplicated 2 time. In here.
You can see the decode, the convert, the detection, And you can see that the inference IDs are the same..
I run it and you see face detection working on 2 streams, in parallel
And I can add as many channels as I want very easily..
So basically if I can afford 20 FPS, I will keep on adding channels until the performance will get below 20FPS.
So, this is a very powerful tool for creating pipelines, and benchmarking them on multiple platforms.
If your product manager tell you: I need to stream X channels, at Y FPS, and run inference using these DL models..
Just build a pipeline, it should take an hour, and run it on the platform to measure the performance.
There are many more things to talk about the Gstreamer plug-in,
Please read the full documentations for more details or ask a question in the forum.
Thank you