####################################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2020 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.
####################################################################################################

# tf_gpu_memory_fraction: 0.2 is specified for device with limited memory
# resource such as Nano. Smaller value can limit Tensorflow GPU usage;
# and larger value may increase performance but may also cause Out-Of-Memory
# issues. Please tune a proper value.

infer_config {
  unique_id: 5
  gpu_ids: 0
  max_batch_size: 1
  backend {
    triton {
      model_name: "mobilenet_v1"
      version: -1
      model_repo {
        root: "../../triton_model_repo"
        log_level: 2
        tf_gpu_memory_fraction: 0.25
        tf_disable_soft_placement: 0
        strict_model_config: true
        # Minimum compute capacity for Nano
        min_compute_capacity: 5.3
        # Triton runtime would reserve zero pinned memory
        pinned_memory_pool_byte_size: 0
        # Triton runtime would reserve 16MB CUDA device memory
        cuda_device_memory { device: 0, memory_pool_byte_size: 16777216 }
      }
    }
  }

  preprocess {
    network_format: IMAGE_FORMAT_RGB
    tensor_order: TENSOR_ORDER_NONE
    maintain_aspect_ratio: 0
    normalize {
      scale_factor: 0.0078125
      channel_offsets: [128, 128, 128]
    }
  }

  postprocess {
    triton_classification {
      threshold:0.2
    }
  }

  extra {
    copy_input_to_host_buffers: false
    output_buffer_pool_size: 2
  }
}
input_control {
  process_mode: PROCESS_MODE_FULL_FRAME
  interval: 0
}
