hvgp / hyvideo /utils /data_utils.py
Rodneyontherock1067's picture
Upload folder using huggingface_hub
42d94eb verified
raw
history blame contribute delete
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)