Spaces:
Sleeping
Sleeping
Download src/handwriting/preprocess.py from lzpiece/IntelligentHandwrittenCGS: direct link, hf CLI and curl.
- Browser
- Download file 186 Bytes
-
https://huggingface.co/spaces/lzpiece/IntelligentHandwrittenCGS/resolve/main/src/handwriting/preprocess.py
- Command line
-
hf download hf://spaces/lzpiece/IntelligentHandwrittenCGS/src/handwriting/preprocess.py
-
curl -L -o preprocess.py https://huggingface.co/spaces/lzpiece/IntelligentHandwrittenCGS/resolve/main/src/handwriting/preprocess.py
186 Bytes
| from __future__ import annotations | |
| import torch | |
| MNIST_MEAN = 0.1307 | |
| MNIST_STD = 0.3081 | |
| def normalize_mnist(x: torch.Tensor) -> torch.Tensor: | |
| return (x - MNIST_MEAN) / MNIST_STD | |