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

[pytorch] Add PyTorch backend integration #261

Closed
9 tasks done
fg-mindee opened this issue May 17, 2021 · 1 comment
Closed
9 tasks done

[pytorch] Add PyTorch backend integration #261

fg-mindee opened this issue May 17, 2021 · 1 comment
Assignees
Labels
critical High priority framework: pytorch Related to PyTorch backend module: datasets Related to doctr.datasets module: models Related to doctr.models module: transforms Related to doctr.transforms topic: build Related to dependencies and build
Milestone

Comments

@fg-mindee
Copy link
Contributor

fg-mindee commented May 17, 2021

Integrating PyTorch as a possible backend is a natural evolution of DocTR. Two questions need to be answered though, I added some suggestions.

How do we add the PyTorch counterpart of an object / class / function?

For module my_module.py,

  • we create my_module.tf.py and put the rest in my_module.pt.py. If there are non framework-related features, they can be kept in my_module. The latter will reference the tf or pytorch implementation depending on the ibrary build
  • we add a folder for each framework, and put the module named the same way in each folder for each framework.

Where do we start?

Here are my thoughts on all DocTR modules:

  • datasets: the loader.py module and the call of each dataset
  • documents: nothing framework-specific
  • models: every module will be impacted
  • transforms: the call methods will be impacted if we cannot used plain torchvision transforms
  • utils: nothing framework-specific

How do we ensure that each build is running correctly?

  • edit the setup.py to build the specified version
  • add CI jobs to run the installation for each framework (probably will have to rethink unittests for each separate framework build)

Next steps

@fg-mindee
Copy link
Contributor Author

Closing this since ONNX support and reference script are a bit far off from this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical High priority framework: pytorch Related to PyTorch backend module: datasets Related to doctr.datasets module: models Related to doctr.models module: transforms Related to doctr.transforms topic: build Related to dependencies and build
Projects
None yet
Development

No branches or pull requests

1 participant