MobileNet SSD TensorRT Deploy

代码

这里用到的是 jkjung-avt 提供的源码

修改以下内容:

  • tensorrt_demos/ssd/build_engine.py

    1
    2
    'num_classes': your_classes
    'input_order': [0, 2, 1], # order of loc_data, conf_data, priorbox_data
  • Patch /usr/local/lib/python3.?/dist-packages/graphsurgeon/node_manipulation.py by adding the following line (around line #42):

    1
    2
    3
    4
    5
    6
    7
    def shape(node):
    ......
    node.name = name or node.name
    node.op = op or node.op or node.name
    + node.attr["dtype"].type = 1
    for key, val in kwargs.items():
    ......
  • tensorflow_models/research/object_detection/anchor_generators/multiple_grid_anchor_generator.py

    1
    2
    3
    4
    5
    6
        if base_anchor_size is None:
    base_anchor_size = [1.0, 1.0]
    + base_anchor_size = tf.constant(base_anchor_size, dtype=tf.float32)
    box_specs_list = []
    if scales is None or not scales:
    scales = [min_scale + (max_scale - min_scale) * i / (num_layers - 1)

部署

参考资料

  1. https://github.com/jkjung-avt/tensorrt_demos
  2. https://github.com/AastaNV/TRT_object_detection
0%