####################################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
####################################################################################################


infer_config {
  unique_id: 1
  gpu_ids: [0]
  max_batch_size: 16
  backend {
    triton {
      model_name: "peoplenet_transformer"
      version: -1
      # To run Triton client remote inference, users need enable 'grpc' block.
      # And deploy Triton server for the model repository directory, run
      # tritonserver --model-repository=triton_tao_model_repo
      grpc {
        url: "localhost:8001"
        enable_cuda_buffer_sharing: true
      }
    }
    inputs: [ {
      name: "inputs"
    }]
    outputs: [
      {name: "pred_boxes"},
      {name: "pred_logits"}
    ]
    output_mem_type: MEMORY_TYPE_CPU
  }

  preprocess {
    network_format: MEDIA_FORMAT_NONE
    tensor_order: TENSOR_ORDER_LINEAR
    tensor_name: "inputs"
    maintain_aspect_ratio: 0
    frame_scaling_hw: FRAME_SCALING_HW_DEFAULT
    frame_scaling_filter: 1
    normalize {
      scale_factor: 0.017507
      channel_offsets: [123.675,116.280,103.53]
    }
  }

  postprocess {
    labelfile_path: "../../triton_tao_model_repo/peoplenet_transformer/labels.txt"
    detection {
      num_detected_classes: 4
      custom_parse_bbox_func: "NvDsInferParseCustomDDETRTAO"
      per_class_params {
        key: 0
        value { pre_threshold: 0.4 }
      }
      nms {
        confidence_threshold:0.5
        topk:20
        iou_threshold:0.5
      }
    }
  }

  extra {
    copy_input_to_host_buffers: false
    output_buffer_pool_size: 2
  }

  custom_lib {
    path: "/opt/nvidia/deepstream/deepstream/lib/libnvds_infercustomparser.so"
  }
}

input_control {
  process_mode: PROCESS_MODE_FULL_FRAME
  operate_on_gie_id: -1
  interval: 0
}

