globals:
  repo_url: https://github.com/open-mmlab/mmdetection/tree/main
  codebase_dir: ../mmdetection
  checkpoint_force_download: False
  images:
    input_img: &input_img ../mmdetection/demo/demo.jpg
    test_img: &test_img ./tests/data/tiger.jpeg
  metric_info: &metric_info
    box AP: # named after metafile.Results.Metrics
      metric_key: coco/bbox_mAP # eval OrderedDict key name
      tolerance: 0.2 # metric ±n%
      multi_value: 100
    mask AP:
      metric_key: coco/segm_mAP
      tolerance: 1 # metric ±n%
      multi_value: 100
    PQ:
      metric_key: '?'
      tolerance: 0.1 # metric ±n%
  convert_image: &convert_image
    input_img: *input_img
    test_img: *test_img
  backend_test: &default_backend_test True
  sdk:
    sdk_static: &sdk_static configs/mmdet/detection/detection_sdk_static.py
    sdk_dynamic: &sdk_dynamic configs/mmdet/detection/detection_sdk_dynamic.py
#    sdk_seg_static: &sdk_seg_static configs/mmdet/instance-seg/instance-seg_sdk_static.py
    sdk_seg_dynamic: &sdk_seg_dynamic configs/mmdet/instance-seg/instance-seg_sdk_dynamic.py

onnxruntime:
  pipeline_ort_static_fp32: &pipeline_ort_static_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/detection_onnxruntime_static.py

  pipeline_ort_dynamic_fp32: &pipeline_ort_dynamic_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/detection_onnxruntime_dynamic.py

  pipeline_seg_ort_static_fp32: &pipeline_seg_ort_static_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/instance-seg/instance-seg_onnxruntime_static.py

  pipeline_seg_ort_dynamic_fp32: &pipeline_seg_ort_dynamic_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/instance-seg/instance-seg_onnxruntime_dynamic.py

tensorrt:
  pipeline_trt_static_fp32: &pipeline_trt_static_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/detection_tensorrt_static-800x1344.py

  pipeline_trt_static_fp16: &pipeline_trt_static_fp16
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_static-800x1344.py

  pipeline_trt_static_int8: &pipeline_trt_static_int8
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/detection_tensorrt-int8_static-800x1344.py

  pipeline_trt_dynamic_fp32: &pipeline_trt_dynamic_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_dynamic
    deploy_config: configs/mmdet/detection/detection_tensorrt_dynamic-320x320-1344x1344.py

  pipeline_trt_dynamic_fp16: &pipeline_trt_dynamic_fp16
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_dynamic
    deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_dynamic-320x320-1344x1344.py

  pipeline_trt_dynamic_int8: &pipeline_trt_dynamic_int8
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_dynamic
    deploy_config: configs/mmdet/detection/detection_tensorrt-int8_dynamic-320x320-1344x1344.py

  # ============= seg ================
  pipeline_seg_trt_static_fp32: &pipeline_seg_trt_static_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_seg_dynamic
    deploy_config: configs/mmdet/instance-seg/instance-seg_tensorrt_static-800x1344.py

  pipeline_seg_trt_static_fp16: &pipeline_seg_trt_static_fp16
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_seg_dynamic
    deploy_config: configs/mmdet/instance-seg/instance-seg_tensorrt-fp16_static-800x1344.py

  pipeline_seg_trt_static_int8: &pipeline_seg_trt_static_int8
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_seg_dynamic
    deploy_config: configs/mmdet/instance-seg/instance-seg_tensorrt-int8_static-800x1344.py

  pipeline_seg_trt_dynamic_fp32: &pipeline_seg_trt_dynamic_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    sdk_config: *sdk_seg_dynamic
    deploy_config: configs/mmdet/instance-seg/instance-seg_tensorrt_dynamic-320x320-1344x1344.py

  pipeline_seg_trt_dynamic_fp16: &pipeline_seg_trt_dynamic_fp16
    convert_image: *convert_image
    backend_test: *default_backend_test
    sdk_config: *sdk_seg_dynamic
    deploy_config: configs/mmdet/instance-seg/instance-seg_tensorrt-fp16_dynamic-320x320-1344x1344.py

  pipeline_seg_trt_dynamic_int8: &pipeline_seg_trt_dynamic_int8
    convert_image: *convert_image
    backend_test: *default_backend_test
    # sdk_config: *sdk_seg_dynamic
    deploy_config: configs/mmdet/instance-seg/instance-seg_tensorrt-int8_dynamic-320x320-1344x1344.py

openvino:
  pipeline_openvino_dynamic_fp32: &pipeline_openvino_dynamic_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/detection_openvino_dynamic-800x1344.py

  # ============= seg ================
  pipeline_seg_openvino_dynamic_fp32: &pipeline_seg_openvino_dynamic_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/instance-seg/instance-seg_openvino_dynamic-800x1344.py

ncnn:
  pipeline_ncnn_static_fp32: &pipeline_ncnn_static_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/single-stage_ncnn_static-800x1344.py

  pipeline_ncnn_dynamic_fp32: &pipeline_ncnn_dynamic_fp32
    convert_image: *convert_image
    backend_test: False
    deploy_config: configs/mmdet/detection/single-stage_ncnn_dynamic.py

pplnn:
  pipeline_pplnn_dynamic_fp32: &pipeline_pplnn_dynamic_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    deploy_config: configs/mmdet/detection/detection_pplnn_dynamic-800x1344.py

  # ============= seg ================
  pipeline_seg_pplnn_dynamic_fp32: &pipeline_seg_pplnn_dynamic_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    deploy_config: configs/mmdet/instance-seg/instance-seg_pplnn_dynamic-800x1344.py

torchscript:
  pipeline_ts_fp32: &pipeline_ts_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    deploy_config: configs/mmdet/detection/detection_torchscript.py

  # ============= seg ================
  pipeline_seg_ts_fp32: &pipeline_seg_ts_fp32
    convert_image: *convert_image
    backend_test: *default_backend_test
    deploy_config: configs/mmdet/instance-seg/instance-seg_torchscript.py

models:
  - name: YOLOV3
    metafile: configs/yolo/metafile.yml
    model_configs:
      - configs/yolo/yolov3_d53_8xb8-320-273e_coco.py
    pipelines:
      - *pipeline_ts_fp32
      - *pipeline_ort_dynamic_fp32
      - deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_dynamic-64x64-608x608.py
        convert_image: *convert_image
        backend_test: *default_backend_test
        sdk_config: *sdk_dynamic
      - *pipeline_ncnn_static_fp32
      - *pipeline_openvino_dynamic_fp32


  - name: SSD
    metafile: configs/ssd/metafile.yml
    model_configs:
      - configs/ssd/ssd300_coco.py
    pipelines: # special cases
      - *pipeline_ts_fp32
      - *pipeline_ort_static_fp32
      - deploy_config: configs/mmdet/detection/detection_tensorrt_dynamic-300x300-512x512.py
        convert_image: *convert_image
        backend_test: *default_backend_test
        sdk_config: *sdk_dynamic
      - deploy_config: configs/mmdet/detection/single-stage_ncnn_static-300x300.py
        convert_image: *convert_image
        backend_test: False

  - name: RetinaNet
    metafile: configs/retinanet/metafile.yml
    model_configs:
      - configs/retinanet/retinanet_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_ts_fp32
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_ncnn_static_fp32
      - *pipeline_pplnn_dynamic_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: Cascade Mask R-CNN
    metafile: configs/cascade_rcnn/metafile.yml
    model_configs:
      - configs/cascade_rcnn/cascade_mask_rcnn_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_seg_ts_fp32
      - *pipeline_seg_ort_dynamic_fp32
      - *pipeline_seg_trt_dynamic_fp32
      - *pipeline_seg_openvino_dynamic_fp32

  - name: FCOS
    metafile: configs/fcos/metafile.yml
    model_configs:
      - configs/fcos/fcos_r50_caffe_fpn_gn-head_1x_coco.py
    pipelines:
      - *pipeline_ts_fp32
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_ncnn_static_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: FSAF
    metafile: configs/fsaf/metafile.yml
    model_configs:
      - configs/fsaf/fsaf_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_ts_fp32
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_ncnn_static_fp32
      - *pipeline_pplnn_dynamic_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: YOLOX
    metafile: configs/yolox/metafile.yml
    model_configs:
      - configs/yolox/yolox_s_8xb8-300e_coco.py
    pipelines:
      - *pipeline_ts_fp32
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_ncnn_static_fp32
      - deploy_config: configs/mmdet/detection/detection_openvino_dynamic-640x640.py
        convert_image: *convert_image
        backend_test: False

  - name: Faster R-CNN
    metafile: configs/faster_rcnn/metafile.yml
    model_configs:
      - configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_ts_fp32
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_ncnn_static_fp32
      - *pipeline_pplnn_dynamic_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: ATSS
    metafile: configs/atss/metafile.yml
    model_configs:
      - configs/atss/atss_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: Cascade R-CNN
    metafile: configs/cascade_rcnn/metafile.yml
    model_configs:
      - configs/cascade_rcnn/cascade_rcnn_r50_caffe_fpn_1x_coco.py
    pipelines:
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_pplnn_dynamic_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: GFL
    metafile: configs/gfl/metafile.yml
    model_configs:
      - configs/gfl/gfl_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_ort_dynamic_fp32
      - *pipeline_trt_dynamic_fp32
      - *pipeline_openvino_dynamic_fp32

  - name: DETR
    metafile: configs/detr/metafile.yml
    model_configs:
      - configs/detr/detr_r50_8xb2-150e_coco.py
    pipelines:
      - *pipeline_ort_dynamic_fp32
      - deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_dynamic-64x64-800x800.py
        convert_image: *convert_image
        backend_test: *default_backend_test
        sdk_config: *sdk_dynamic

  - name: CenterNet
    metafile: configs/centernet/metafile.yml
    model_configs:
      - configs/centernet/centernet_r18_8xb16-crop512-140e_coco.py
    pipelines:
      - *pipeline_ort_dynamic_fp32
      - deploy_config: configs/mmdet/detection/detection_tensorrt-fp16_dynamic-64x64-800x800.py
        convert_image: *convert_image
        backend_test: *default_backend_test
        sdk_config: *sdk_dynamic

  - name: Mask R-CNN
    metafile: configs/mask_rcnn/metafile.yml
    model_configs:
      - configs/mask_rcnn/mask-rcnn_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_seg_ts_fp32
      - *pipeline_seg_ort_dynamic_fp32
      - *pipeline_seg_trt_dynamic_fp32
      - *pipeline_seg_openvino_dynamic_fp32

  - name: Swin Transformer
    metafile: configs/swin/metafile.yml
    model_configs:
      - configs/swin/mask_rcnn_swin-t-p4-w7_fpn_1x_coco.py
    pipelines:
      - *pipeline_seg_ort_dynamic_fp32
      - *pipeline_seg_trt_dynamic_fp32

  - name: RTMDet
    metafile: configs/rtmdet/metafile.yml
    model_configs:
      - configs/rtmdet/rtmdet_s_8xb32-300e_coco.py
    pipelines:
      - *pipeline_ort_dynamic_fp32
      - deploy_config: configs/mmdet/detection/detection_tensorrt_dynamic-64x64-800x800.py
        convert_image: *convert_image
        backend_test: *default_backend_test
        sdk_config: *sdk_dynamic

  - name: SOLO
    metafile: configs/solo/metafile.yml
    model_configs:
      - configs/solo/solo_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_seg_ort_dynamic_fp32
      - *pipeline_seg_openvino_dynamic_fp32

  - name: SOLOV2
    metafile: configs/solov2/metafile.yml
    model_configs:
      - configs/solov2/solov2_r50_fpn_1x_coco.py
    pipelines:
      - *pipeline_seg_ort_dynamic_fp32
      - *pipeline_seg_openvino_dynamic_fp32
