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

Feature request: include option for exporting classifiers for non-pythonbprograms #6810

Closed
dhombios opened this issue May 23, 2024 · 1 comment
Assignees

Comments

@dhombios
Copy link

What's your use case?

I use orange for analysing the separability of image descriptors extracted by different algorithms in order to use them for image recognition. However, due to some limitations in openCV python bindings, we cannot use it in production, needing to write the final software in c++. As a result, classifiers trained by orange need to be rewritten in c++ (or retrained using a different software that allows exporting them in a format that can be used with that language).

That's a problem orange is quite useful for conducting statistic experiments quicky, but porting the obtained results to production takes some time. However, some classifiers implemented in orange use scikit-learn, so projects like sklearn-onnx or TL2cgen could be used to convert them to a format easier to use from other languages.

What's your proposed solution?

Adding an option to the save model widget to export the model in onnx (or any language independent format)

Are there any alternative solutions?

Another possibility could be exporting models in the native format of the library used for implementing them (for example scikit-learn), so those tools could be used for converting them to a language independent format (right now the resulting pickle file requires orange to be installed in order to use the model)

@ZanMervic
Copy link
Contributor

ZanMervic commented May 31, 2024

Hello,

While there is currently no built-in way to export models in ONNX (or other language-independent formats), you can use the Python Script widget as a workaround to do so.

Below is a simple example of how you might implement this:
image

There is a problem with this approach regarding any preprocessing you might include in the workflow. Since this method does not support preprocessing steps (to my knowledge), you will need to re-implement them in production. Note that some preprocessors are not from scikit-learn, so you might want to check their implementation in the source code.

@janezd janezd closed this as completed Jun 6, 2024
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

3 participants