Closed realliyifei closed 1 year ago
+1
These should both be very easy to do in FFCV since all you need is to make a pytorch dataloader and then follow the instructions here! https://docs.ffcv.io/writing_datasets.html
Let us know if you have any questions!
Thank you!
I have a dataset where the images are float
datatype after being transformed (as below), but FFCV RGBImageField only supports int8
datatype. Therefore, now I only store the raw un-transformed images to the beton format. May I ask where should I add the image transform in the pipeline with the least impact on the training speed? Or there is another way to let FFCV load the image as float
numpy directly?
train_transform = transforms.Compose([
transforms.RandomResizedCrop(224),
CutOut(cutout_factor=0.5),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
normalize = transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
])
Updated: I added to FFCV loader and it works smoothly.
@andrewilyas thanks :) I have a question, how does it batch bboxes if for every image there may be a different numbers of bboxes?
I @FrancescoSaverioZuppichini ! FFCV does support variable-length data with BytesField, but generally things will probably be faster if you just pad everything to the maximum number of boundingboxes and use the NDArrayField.
yes just a reminder that NDArrayField is not included in the tutorial (last section of here) and it is kinda confusing to lots of first-time users
Are there FFCV versions of COCO and Open Image (or equivalents) to speed loading and training?