Spaces:
Runtime error
Runtime error
Download hyvideo/utils/data_utils.py from ItsMeBell/HunyuanVideo: direct link, hf CLI and curl.
- Browser
- Download file 321 Bytes
-
https://huggingface.co/spaces/ItsMeBell/HunyuanVideo/resolve/main/hyvideo/utils/data_utils.py
- Command line
-
hf download hf://spaces/ItsMeBell/HunyuanVideo/hyvideo/utils/data_utils.py
-
curl -L -o data_utils.py https://huggingface.co/spaces/ItsMeBell/HunyuanVideo/resolve/main/hyvideo/utils/data_utils.py
321 Bytes
| import numpy as np | |
| import math | |
| def align_to(value, alignment): | |
| """align hight, width according to alignment | |
| Args: | |
| value (int): height or width | |
| alignment (int): target alignment factor | |
| Returns: | |
| int: the aligned value | |
| """ | |
| return int(math.ceil(value / alignment) * alignment) | |