Hi Nafissa,

You can build OTB with Shark. If you use the superbuild, you can
activate the cmake configuration

OTB_USE_SHARK:BOOL=ON

which will build Shark as an OTB dependency and then build OTB to use
Shark.

Make sure that OTB is also compiled with

OTB_USE_SHARK:BOOL=ON

If you just reconfigure the superbuild after building without Shark, I
think Shark is built, but OTB is not rebuilt to use Shark.

Once everything is OK, you should find that for instance in
otbcli_TrainVectorClassifier the -classifier options allows to choose
between "rf" and "sharkrf". The first one is OpenCV's.

Now, just some feedback. Shark is supposed to be faster in the learning
step because the trees are learned in parallel (by the way, make sure
that OpenMP is used for both Shark and OTB, check the CMakeCache.txt
files in the build directories). Actually, in some cases, Shark can be
way slower than OpenCV. There are several reasons for that. There are
some inefficiencies in Shark when the number of features is very high (a
solution is in progress, see
https://github.com/Shark-ML/Shark/issues/179 for details). Also, Shark
builds full trees, while OpenCV stops at a chosen depth (25 by default).

Good luck.

Jordi

On Thu 11-May-2017 at 15:09:38 +0200, Nafissa Sfaksi <[email protected]> wrote: 
> Hello, 
>
> I'am trying to improve my process chain for Sentinel 2 with OTB, and as you 
> said few weeks before, there're two implementations of the Random Forest in 
> OTB; 
> My question is about how can I choose between opencv and shark libs? and if 
> it's possible to force the process to use shark instead of opencv?
>
> Best regards
>
> Le mardi 28 mars 2017 15:31:11 UTC+2, Manuel Grizonnet a écrit :
>
>  Hi,
>
>  note first there are 2 implementations of random forests now available in 
> OTB since release 5.8. One from openCV and the other one from the shark 
> machine learning library (which allows parallel training). Both 
> implementations are wrappers around those libraries and you generally
>  have to dig into libraries documentation to find out such information.
>
>  Regarding the criteria, I think that both opencv and shark implementations 
> use the Gini criterion (for shark I'm quite sure). Would be glad if someone 
> who know a bit more those implementations can confirm this. 
>
>  Note also that I don't think that we have a way in otb to change this 
> criteria with shark implementation even if there is a way to do this in shark 
> base class. Perhaps something that could be added to the 
> SharkMachineLearningModel in the future.
>
>  Regards, 
>
>  2017-03-27 9:46 GMT+02:00 Nafissa Sfaksi <[email protected]>:
>
>  Hi, 
>  With the tool TrainClassifier we can put several parameters but is it 
> possible to see which criteria is used for the method? 
>  I mean the tool use Gini criterion or entropy criterion? 
>  Thanks for reply
>  Nafissa
>
>  -- 
>  -- 
>  Check the OTB FAQ at
>  http://www.orfeo-toolbox.org/FAQ.html
>
>  You received this message because you are subscribed to the Google
>  Groups "otb-users" group.
>  To post to this group, send email to [email protected]
>  To unsubscribe from this group, send email to
>  [email protected]
>  For more options, visit this group at
>  http://groups.google.com/group/otb-users?hl=en
>  --- 
>  You received this message because you are subscribed to the Google Groups 
> "otb-users" group.
>  To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
>  For more options, visit https://groups.google.com/d/optout.
>
>  -- 
>  Manuel Grizonnet
>
> -- 

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to