libffcv / ffcv

FFCV: Fast Forward Computer Vision (and other ML workloads!)
https://ffcv.io
Apache License 2.0
2.79k stars 180 forks source link

Grayscale Image Datasets #351

Open gsaltintas opened 9 months ago

gsaltintas commented 9 months ago

Hello, First of all thank you for this package, it is a game changer! I was wondering if there is a preferred way of using grayscale image datasets, like MNIST, with FFCV. Since torchvision dataset yields PIL images, I don't think it is suitable to use BytesField or NDArrayField in the DatasetWriter. I was able to use ffcv with MNIST by manually adding a num_channels parameter to image decoders and commenting out this line in the RGBImageField but I was wondering if there was a built-in way that I am missing.

Thanks

andrewilyas commented 9 months ago

Hi @gsaltintas ! We are still working on merging this in but there is a grayscale fork pending a PR Review here: https://github.com/libffcv/ffcv/pull/176. I think that should suit your needs!

gsaltintas commented 9 months ago

Thank you! I was not aware of the PR, it looks similar to my local patch. I will refer to it.