Open faranaziz opened 3 years ago
Hi, I would not waste to much time with the C++ dataset loader and would instead write my own C++ tensor loading routine. There's a very useful function in libtorch : torch::from_blob(). It allows you to load any C++ array into a PyTorch tensor. It works like this: torch::from_blob(pointerToFloatDataArray,{dimension1,dimension2,...});
OK, Thanks. You use it to load PNG / JPEG images that you first read into a C++ array?
I use it with spectrograms data but yes that's the same principle. If you want to use it with pictures, you would have to load your png/jpeg images into c++ memory arrays (using functions not provided with libtorch) and then upload those arrays to pytorch tensors using torch::from_blob.
Pseudo-code for one image would be something like that: char* rgbArray=loadImage(...); torch::Tensor imgTensor = torch::from_blob(rgbArray, {channels, width, height}, torch::kFloat);
Thanks! You generate the spectrograms offline using Python (npy) and then read them from C++?
I generate spectrograms in real time directly in C++. I've created this library for my software SpectraLayers.
Library looks amazing. Does it only work as a plug-in?
And you use U-net for process spectograms?
If you're referring to SpectraLayers, it's both a plugin and a stand-alone application. I indeed use U-Net for several spectrogram processing (for most AI-driven processes, actually).
Yes, I register on steinberg but no can download. Will try again later.
You can download SpectraLayers directly from here: https://www.steinberg.net/en/support/downloads/downloads_spectralayers_7.html
Thanks! How did you read a wav file into a torch::tensor? Using any third party? Thanks.
Dear team, thanks you for great project! I try write data loader in C++ for training, but not much success. Did you try this code on an open source DB?