CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

How to use the C# wrapper on multiple images simultaneously

Open rold2007 opened this issue 10 years ago • 3 comments

It seems like the test command processes images faster than when I call IEvaluateModelManagedF.Evaluate(). Is it possible to test more than one image with only one call to Evaluate() ? If so, how should I pass the input and how should I interpret the output ?

rold2007 avatar Apr 01 '16 06:04 rold2007

Hi rold2007, Right now using the C# wrapper is slow compared to using a DataReader (CNTK reading directly from a file and processing batches). Also, currently you can only evaluate one set of inputs at a time. This interface is not designed for batch processing. Eventually the Python bindings will be available which will bring greater performance, although probably the best performance will be using the DataReader(s) in CNTK.

Best regards, Gaizka

gaizkan avatar Apr 05 '16 09:04 gaizkan

@gaizkan Thanks for your answer. I usually have to process only a dozen images at a time, so using the DataReader isn't very efficient since it is spending a long time loading the model each time.

How is it that Python bindings will bring more performance than the C# wrapper ? Will the development of the Python bindings be done at the same pace as the C# wrapper (similar API and functionalities) ?

rold2007 avatar Apr 08 '16 03:04 rold2007

Hi rold2007,

The Python bindings refer to the new API that will enable programmatic access to CNTK (i.e. CNTK as a library). The performance should be similar between Python and C#, CLI, etc...(possible minor differences). However, feeding the data should be faster through the API, since there could be an optimization in the data packing. I need to check with the team working on the APIs to confirm that data feeding for evaluation will be available through the API.

gaizkan avatar Apr 11 '16 09:04 gaizkan