CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

Read data from memory

Open Mushroom-Head opened this issue 10 years ago • 4 comments

Hi,

I'd like to test CNN in a realtime imaging application. This application needs to directly read the data from memory. How can I do that in CNTK? Are there any useful APIs to read the data?

Thanks

Mushroom-Head avatar Mar 02 '16 04:03 Mushroom-Head

I assume you want to run a model against a life image stream? Perhaps the C# eval wrapper is a starting point? Putting the image in a file and push in into the eval functionality ...

most image analysis requires preprocessing of the image (resolution adjustment, finding hot-spots, flipping or mirroring) ... some of this is already in the imagereader ...

wolfma61 avatar Mar 03 '16 14:03 wolfma61

@Mushroom-Head I did succeed to integrate my model/images with the C# wrapper, see #160 as it could help you resolve some issues I had.

rold2007 avatar Mar 03 '16 21:03 rold2007

My test data is written on memory from camera. So, they have no file name(data is not jpg, png or other image formats). However, I think ImageReader needs the image file name list. I expect BinaryReader can be used to this application. But I cannot find any documents about BinaryReader. I want to know a method to read binary data from memory.

Mushroom-Head avatar Mar 08 '16 11:03 Mushroom-Head

Can you please take a look at this file and see if this is what you want? https://github.com/Microsoft/CNTK/blob/master/Source/Readers/ImageReader/ByteReader.h Basically, you would provide another flavor of ByteReader, where bytes are coming from memory.

mradmila avatar Mar 15 '16 00:03 mradmila