I built a pipeline for face detection and recognition based on Python deepstream_test_2,The pipeline structure is as follows:
filesrc --> h264parse --> nvv4l2decoder --> nvstreammux --> nvinfer(pgie) --> nvinfer(sgie1) --> nvvideoconvert --> nvdsosd --> nvegltransform --> nveglglessink
I want to perform the following operations for each face image when the primary network outputs the results:
# scale pixel values face_pixels = face_pixels.astype('float32') mean, std = face_pixels.mean(), face_pixels.std() face_pixels = (face_pixels - mean) / std
And then pass it to Facenet model.Therefore, I want to standardize the detected faces in pgie’s Sink Pad.
pgiesrcpad = pgie.get_static_pad("sink") if not pgiesrcpad: sys.stderr.write(" Unable to get sink pad of pgiesrcpad\n") pgiesrcpad.add_probe(Gst.PadProbeType.BUFFER, sgie1_sink_pad_buffer_probe, 0)
How can I implement it in method sgie1_sink_pad_buffer_probe?