Save test images and classification results

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson )
**• DeepStream Version5.1
• JetPack Version (4.5)
**• TensorRT Version7.x

In the test 2 example provided by python, I successfully built a pipeline:

filesrc --> h264parse --> nvv4l2decoder --> nvstreammux --> nvinfer(pgie) --> nvinfer(sgie1)  --> nvvideoconvert --> nvdsosd --> nvegltransform --> nveglglessink

The first level network is a traditional four classification model, and the second level network is the vehicle type detection model.The function is to identify the car first and then the type of car.
My problem is how to save the recognition results of the secondary network and the vehicle images detected by the primary network to the local.

For the classification results. It is a object label which is in NvDsObjectMeta-> classifier_meta_list->label_info_list.
For save car image, please refer to the sample of deepstream_python_apps/apps/deepstream-imagedata-multistream at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub, it shows how to save object image.