facebookresearch / detectron2

Detectron2 is a platform for object detection, segmentation and other visual recognition tasks.
https://detectron2.readthedocs.io/en/latest/
Apache License 2.0
30.02k stars 7.41k forks source link

Properly convert a Detectron2 model to ONNX for Deployment #4414

Closed vitorbds closed 2 years ago

vitorbds commented 2 years ago

Hello,

I am trying to convert a Detectron2 model to ONNX format and make inference without use detectron2 dependence in inference stage.

Even is possible to find some information about that here : https://detectron2.readthedocs.io/en/latest/tutorials/deployment.html The implementation of this task is constantly being updated and the information found in this documentation is not clear enough to carry out this task .

Some one can help me with some Demo/Tutorial of how make it ?

@thiagocrepaldi

Some information:

My model was trained using pre-trained weight from:

'faster_rcnn_50': { 'model_path': 'COCO-Detection/faster_rcnn_R_50_FPN_3x.yaml', 'weights_path': 'model_final_280758.pkl' },

I have 4 classes.

Of course now i have my our weight. My model was saved in .pth forrmat.

I used my our dataset, with image ( .png )

Code in Python