def resize(anns, size, output_size):
    """
    Parameters
    ----------
    anns : List[Dict]
        Sequences of annotation of objects, containing `bbox` of [l, t, w, h].
    size : Sequence[int]
        Size of the original image.
    output_size : Union[Number, Sequence[int]]
        Desired output size. If size is a sequence like (w, h), the output size will be matched to this.
        If size is an int, the smaller edge of the image will be matched to this number maintaing
        the aspect ratio. i.e, if width > height, then image will be rescaled to
        (output_size * width / height, output_size)
    """
    w, h = size
    if isinstance(output_size, int):
        if (w <= h and w == output_size) or (h <= w and h == output_size):
            return anns
        if w < h:
            ow = output_size
            sw = sh = ow / w
        else:
            oh = output_size
            sw = sh = oh / h
    else:
        ow, oh = output_size
        sw = ow / w
        sh = oh / h
    new_anns = []
    for ann in anns:
        bbox = list(ann['bbox'])
        bbox[0] *= sw
        bbox[1] *= sh
        bbox[2] *= sw
        bbox[3] *= sh
        new_anns.append({**ann, "bbox": bbox})
    return new_anns