def get_hw(in_size: dict) -> tuple:
    """
    从in_size中解析出h和w参数
    - 如果in_size仅有hw这个参数，那么就使用(hw,hw)
    - 如果指定了h和w，那么就是使用(h, w)
    """
    if new_size := in_size.get("hw", False):
        assert isinstance(new_size, int)
        new_size_tuple = (new_size, new_size)
    elif in_size.get("h", False) and in_size.get("w", False):
        assert isinstance(in_size["h"], int)
        assert isinstance(in_size["w"], int)
        new_size_tuple = (in_size["h"], in_size["w"])
    else:
        raise Exception(f"{in_size} error!")
    return new_size_tuple