libffcv / ffcv

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

Operation between fields. #147

Closed erow closed 2 years ago

erow commented 2 years ago

I find it difficult to conduct operations between fields. In my case, a sample consists of two images: A and B. I have to ensure the consistency of the operations on the two images. For instance, I can easily implement it on the PyTorch style dataset:

i, j, h, w = get_crop_c(height, width, scale, ratio)

resize_crop_c(temp_buffer, i, i + h, j, j + w,
             A)

resize_crop_c(temp_buffer, i, i + h, j, j + w,
              B)

Is it possible to use the same random crop on two fields?

GuillaumeLeclerc commented 2 years ago

HI! This will be easier in the next release. You can already play with this with the new_codegen branch (currently being tested)