DeepStream equivalent package for tensorflow.keras.applications.mobilenet_v2.preprocess_input package

• Hardware Platform (Jetson / GPU) : GPU
• DeepStream Version : deepstream-7.0
• TensorRT Version : 8.6.1.6
• NVIDIA GPU Driver Version (valid for GPU only): 550.90.07
• Issue Type( questions, new requirements, bugs) : Questions
Question :

  • We are writing inference code using gstreamer pipeline using deepstream for one of the classification model using gstreamer element - nvdspreprocess.
  • Now we have 4-5 steps of preprocessing that needs to be done before running the AI model, which are
                    From tensorflow.keras.applications.mobilenet_v2 import preprocess_input
                    import cv2
                    input_frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
                    input_frame = cv2.resize(input_frame, (64, 64))
                    input_frame = input_frame[:,:,:3]
                    input_frame = input_frame.reshape((3,64,64))
                    input_frame = preprocess_input(input_frame)
                    frame_batched = np.expand_dims(input_frame,axis=0)
  • We have figured out other preprocessing steps, but could not find the alternative for tensorflow.keras.applications.mobilenet_v2.preprocess_input package. Can you suggest how we can implement this in the nvdspreprocess.

Relevant python package links for reference:

  1. Implement the user-defined processing,
  2. Modify the configuration file as follows
    # custom library .so path having custom functionality
custom-lib-path=/opt/nvidia/deepstream/deepstream/lib/gst-plugins/libcustom2d_preprocess.so
    # custom tensor preparation function name having predefined input/outputs
    # check the default custom library nvdspreprocess_lib for more info
custom-tensor-preparation-function=CustomTensorPreparation

Rewrite the above python code into c/cpp code, which is exactly what libcustom2d_preprocess.so needs to do

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.