MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / hf_datasets_augs_helper

Function hf_datasets_augs_helper

k_diffusion/utils.py:38–41  ·  view source on GitHub ↗

Apply passed in transforms for HuggingFace Datasets.

(examples, transform, image_key, mode='RGB')

Source from the content-addressed store, hash-verified

36
37
38def 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
44def append_dims(x, target_dims):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected