Skip to content

WIP: Update shark rf

Jordi Inglada requested to merge jinglada/otb:update-shark-rf into develop


Update the superbuild version of Shark


There has been some recent work on the Random Forest implementation in Shark which would be nice to have in OTB. It is a complete reimplementation to improve memory footprint and speed.

There is a minor API change which needs a small change in otbSharkRandomForestsMachineLearningModel.h

Shark assumes that the labels are in the set [0 ... nbClasses-1]. Shark RF models have been updated in order to translate from the original labels to the format expected by Shark. The serialization of the RF model includes the label dictionary. A function to compute the label dictionary has bee added to otbSharkUtils.h

There are also API changes which affect the use of autoencoders in the dimensionality reduction module.

We suggest that no backwards compatibility to previous versions of Shark is maintained, since the likelihood that a user builds an old version of Shark outside the superbuild is very low.

Implementation Details

Classes and files


No new applications.


A test for the relabeling function has been added.


Additional notes

List remaining open issues if any, and additional notes.

Merge request reports