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

Deploy the model to C++ #322

Open
Whatsetsthisend opened this issue Jun 24, 2021 · 7 comments
Open

Deploy the model to C++ #322

Whatsetsthisend opened this issue Jun 24, 2021 · 7 comments

Comments

@Whatsetsthisend
Copy link

Can I deploy the pre training model of "segocr simple baseline." to C + +, such as libtorch, but because of your good encapsulation, I can't simply restore the network structure, so I can't convert. The onnx conversion tool in tool seems to only support crnn network, Can you give us the network structure of the pytorch version of segocr simple baseline or some other useful information,thank you.

@innerlee
Copy link
Contributor

because of your good encapsulation

More details would be great

@Whatsetsthisend
Copy link
Author

Whatsetsthisend commented Jun 24, 2021

because of your good encapsulation

More details would be great

Because I haven't touched the use of mmcv before, I don't see a Class similar to the model defined in Pytorch

@innerlee
Copy link
Contributor

Learning mmcv is rewarding since, all mm-series share the same architectural design. You will master pose/segmentation/detection/action/super-resulution/... for free once you know it.

The heart of mmcv is the registry system https://mmcv.readthedocs.io/en/latest/registry.html. Each component is registered and defined independently, so you can combine them at will in the config.

@Whatsetsthisend
Copy link
Author

Learning mmcv is rewarding since, all mm-series share the same architectural design. You will master pose/segmentation/detection/action/super-resulution/... for free once you know it.

The heart of mmcv is the registry system https://mmcv.readthedocs.io/en/latest/registry.html. Each component is registered and defined independently, so you can combine them at will in the config.

Thank you. I'm still working on converting the .pth model to libtorch. I've made progress. Now there should be the last bug. It should be that the forward() function of the default layer in mmocr uses the parameter “img_metas”, But the transform function torch.jit.trace (model, data) in Python can't parse "img_metas”。 I'll modify the forward function later to get the job done, and then I'll be willing to launch a push to contribute to the git.thank you

@Whatsetsthisend
Copy link
Author

First of all, I would like to thank the author for his free and open source, and the efforts of relevant personnel to maintain and answer me carefully. I have completed the C + + transformation of segocr model, but modified the data structure of prediction, so I don't think my current method is particularly good. I will submit the push after I improve it

@innerlee
Copy link
Contributor

@Whatsetsthisend Thanks for your contribution! Sure please make the pull request so that it could help more people

@xinsuinizhuan
Copy link

First of all, I would like to thank the author for his free and open source, and the efforts of relevant personnel to maintain and answer me carefully. I have completed the C + + transformation of segocr model, but modified the data structure of prediction, so I don't think my current method is particularly good. I will submit the push after I improve it

how about the C++ version? Could share to us?

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

No branches or pull requests

3 participants