riotu-lab / deepstream-facenet

Demo app on using Deepstream 5.0 with Facenet
43 stars 13 forks source link

The pixel values are standardized. #12

Open LUOQING1994 opened 3 years ago

LUOQING1994 commented 3 years ago

Hi! After the first level network model obtains the face, the image needs to be standardized first.(Refer to here)

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 Tracker model.Therefore, I want to standardize the detected faces in face_detector's Sink Pad.

facedetectorsrcpad = face_detector.get_static_pad("sink")
if not facedetectorsrcpad:
   sys.stderr.write(" Unable to get sink pad of facedetector\n")
facedetectorsrcpad.add_probe(Gst.PadProbeType.BUFFER, sgie1_sink_pad_buffer_probe, 0)

How can I implement it in method sgie1_sink_pad_buffer_probe?

xya22er commented 3 years ago

You don't need to do this