FastMOT icon indicating copy to clipboard operation
FastMOT copied to clipboard

[Question] Integrating CrowdDet model to be used with FastMOT

Open aiotko opened this issue 2 years ago • 2 comments

Hi,

Sorry for one more silly question, I only started my way in machine learning and trying to integrate the CrowdDet model to be used with FastMOT. https://github.com/Purkialo/CrowdDet

I tried to convert it to onnx format but couldn't do it. Could you please give me a hint how to do and which parameters should be used for it?

class YOLOv4CSP(YOLO):
    ENGINE_PATH = Path(__file__).parent / 'yolov4-csp.trt'
    MODEL_PATH = Path(__file__).parent /  'yolov4-csp.onnx'
    NUM_CLASSES = 1
    LETTERBOX = True
    NEW_COORDS = True
    INPUT_SHAPE = (3, 640, 640)
    LAYER_FACTORS = [8, 16, 32]
    SCALES = [2.0, 2.0, 2.0]
    ANCHORS = [[12,16, 19,36, 40,28],
               [36,75, 76,55, 72,146],
               [142,110, 192,243, 459,401]]

Thank you very much in advance!

aiotko avatar Oct 18 '21 10:10 aiotko

If you can't convert to ONNX, try torch2trt

GeekAlexis avatar Oct 20 '21 20:10 GeekAlexis

Thank you for the advice, I've tried but there are no expected properties in the model

import torch
from torch2trt import TRTModule

model_trt = TRTModule()
model_trt.load_state_dict(torch.load('rcnn_emd_refine.pth'))
def _load_from_state_dict(
...
  engine_bytes = state_dict[prefix + "engine"]
  ...
  self.input_names = state_dict[prefix + "input_names"]
  self.output_names = state_dict[prefix + "output_names"]

aiotko avatar Oct 21 '21 18:10 aiotko