Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Integrating CrowdDet model to be used with FastMOT #216

Open
aiotko opened this issue Oct 18, 2021 · 2 comments
Open

[Question] Integrating CrowdDet model to be used with FastMOT #216

aiotko opened this issue Oct 18, 2021 · 2 comments

Comments

@aiotko
Copy link

aiotko commented Oct 18, 2021

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!

@GeekAlexis
Copy link
Owner

If you can't convert to ONNX, try torch2trt

@aiotko
Copy link
Author

aiotko commented Oct 21, 2021

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"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants