MCPcopy Index your code
hub / github.com/adobe-research/custom-diffusion / preprocess

Function preprocess

src/diffusers_data_pipeline.py:226–230  ·  view source on GitHub ↗
(image, scale, resample)

Source from the content-addressed store, hash-verified

224
225
226def preprocess(image, scale, resample):
227 image = image.resize((scale, scale), resample=resample)
228 image = np.array(image).astype(np.uint8)
229 image = (image / 127.5 - 1.0).astype(np.float32)
230 return image
231
232
233def collate_fn(examples, with_prior_preservation):

Callers 1

__getitem__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected