def cutout_rel_chw(img, box):
    """
    Returns a cut-out of `img` (which is CHW) at the *relative* `box` location.
    `box` is a `(l,t,w,h)`-tuple as usual, but in [0,1]-coordinates relative to
    the image size.
    """
    _, H, W = img.shape
    l, t, w, h = box
    return img[:,int(t*H):int(t*H)+int(h*H)
                ,int(l*W):int(l*W)+int(w*W)]