MCPcopy Create free account
hub / github.com/OpenGVLab/UniFormerV2 / crop_boxes

Function crop_boxes

slowfast/datasets/cv2_transform.py:381–391  ·  view source on GitHub ↗

Crop the boxes given the offsets. Args: boxes (array): boxes to crop. x_offset (int): offset on x. y_offset (int): offset on y.

(boxes, x_offset, y_offset)

Source from the content-addressed store, hash-verified

379
380
381def crop_boxes(boxes, x_offset, y_offset):
382 """
383 Crop the boxes given the offsets.
384 Args:
385 boxes (array): boxes to crop.
386 x_offset (int): offset on x.
387 y_offset (int): offset on y.
388 """
389 boxes[:, [0, 2]] = boxes[:, [0, 2]] - x_offset
390 boxes[:, [1, 3]] = boxes[:, [1, 3]] - y_offset
391 return boxes
392
393
394def random_crop_list(images, size, pad_size=0, order="CHW", boxes=None):

Callers 1

random_crop_listFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected