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

Using value from batch within pipeline transforms #291

Open tavisshore opened 1 year ago

tavisshore commented 1 year ago

My dict contains an image and a heading angle float. Is it possible to use the heading tensors from the same dict to crop my images with an FFCV custom fast transform?

Thanks

andrewilyas commented 1 year ago

If it really is just a single float per example, I'd recommend keeping the array of floats in memory, and then using a custom transform with inds (https://docs.ffcv.io/ffcv_examples/transform_with_inds.html) to access the right one. Let me know if this doesn't work!