Hard to understand how to use denormalize?

A little rant, a little show me how I can help?

Docs show here a denormalize function and below that, state

The imagenet norm and denorm functions are stored as constants inside the library named imagenet_norm and imagenet_denorm

However, release notes say that’s actually incorrect post 1.0.14. They have been removed.

Only way I could find to denormalize is this:

learn.model.eval()
x, _ = next(iter(bb_db.valid_dl))
preds = learn.model(x)

_, denorm = normalize_funcs(*imagenet_stats)

im = x[0]
im = denorm(im)
im = to_np(im).transpose(1,2,0)
fig, ax = plt.subplots(1)
ax.imshow(im)

That the expected way? Create function from stats used for databunch?

Worth updating the docs to mention that the supplied imagenet_norm and denorm don’t exist?