Convert orfeo model to other ML format?

Hi all

Greetings. First time active visitor to your forum.

Is it possible to convert a model (libsvm, randomforest) produced in Orfeo with ‘TrainImagesClassifier’ to other ML formats such as pytorch or tensorflow ?

Configuration:
20.04 LTS and (currently) OTB 7.0, python 3.7.12

Thanks much for your responses !

Dear @rts,

Thank you for using OTB.

Sadly, I don’t know of any easy way to convert a model to other ML formats. But you may be interested in this remote module that provides a generic, multipurpose deep learning framework based on TensorFlow: OTBTF.

Regards.
Julien :slight_smile:

Dear Julien

Thank you for the response. I had a look at the OTBTF framework. Here is a question.
Do the models produced by OTBTF follow standard TensorFlow formats? I would like to be able to convert a model produced within the OTBTF framework to a PyTorch environment (via ONNX -GitHub - onnx/tensorflow-onnx: Convert TensorFlow, Keras, Tensorflow.js and Tflite models to ONNX). Is that possible?

Appreciating your expertise.
Regards,
rts

I think @remi.cresson is in a better position to answer this question… :innocent:

Hi @rts ,

In OTBTF, Tensorflow performs all computations. So you end up with standard formats (checkpoints, savedmodel). You can work with tf.v1, tf.v2 and keras.

Hope that helps,

Rémi