Apply passed in transforms for HuggingFace Datasets.
(examples, transform, image_key, mode='RGB')
| 36 | |
| 37 | |
| 38 | def hf_datasets_augs_helper(examples, transform, image_key, mode='RGB'): |
| 39 | """Apply passed in transforms for HuggingFace Datasets.""" |
| 40 | images = [transform(image.convert(mode)) for image in examples[image_key]] |
| 41 | return {image_key: images} |
| 42 | |
| 43 | |
| 44 | def append_dims(x, target_dims): |
nothing calls this directly
no outgoing calls
no test coverage detected