rom1504 / img2dataset

Easily turn large sets of image urls to an image dataset. Can download, resize and package 100M urls in 20h on one machine.
MIT License
3.75k stars 341 forks source link

--resize_mode "center_crop" fails due to change in albumentations #433

Open jonasricker opened 4 months ago

jonasricker commented 4 months ago

Due a change in https://github.com/albumentations-team/albumentations/blob/main/albumentations/augmentations/crops/functional.py, the following line https://github.com/rom1504/img2dataset/blob/a70e10d352ec11fd611b86ab81a29223a16c841e/img2dataset/resizer.py#L186 causes the error "module 'albumentations' has no attribute 'center_crop'".

It looks like one could use the CenterCrop class or recreate center_crop using crop and get_center_crop_coords (https://github.com/albumentations-team/albumentations/blob/de2f0ccdd324c18ab2a30b6e9ef405ded260e272/albumentations/augmentations/crops/functional.py#L82).