Download clean/video/fakestormer/datasets/pipelines/functional.py from deepsafe/model-code: direct link, hf CLI and curl.
- Browser
- Download file 381 Bytes
-
https://huggingface.co/deepsafe/model-code/resolve/main/clean/video/fakestormer/datasets/pipelines/functional.py
- Command line
-
hf download hf://deepsafe/model-code/clean/video/fakestormer/datasets/pipelines/functional.py
-
curl -L -o functional.py https://huggingface.co/deepsafe/model-code/resolve/main/clean/video/fakestormer/datasets/pipelines/functional.py
381 Bytes
| # -*- coding: utf-8 -*- | |
| import numpy as np | |
| def _get_pixels(per_pixel, rand_color, patch_size, dtype=np.float32): | |
| if per_pixel: | |
| return np.random.randint(0, 255, patch_size).astype(dtype=dtype) | |
| elif rand_color: | |
| return np.random.randint(0, 255, (1, 1, patch_size[2])).astype(dtype=dtype) | |
| else: | |
| return np.zeros((1, 1, patch_size[2]), dtype=dtype) | |