face01lib.damo_yolo.damo_internal.structures package

Submodules

face01lib.damo_yolo.damo_internal.structures.bounding_box module

class BoxList(bbox, image_size, mode='xyxy')[ソース]

ベースクラス: object

This class represents a set of bounding boxes. The bounding boxes are represented as a Nx4 Tensor. In order to uniquely determine the bounding boxes with respect to an image, we also store the corresponding image dimensions. They can contain extra information that is specific to each bounding box, such as labels.

add_field(field, field_data)[ソース]
area()[ソース]
clip_to_image(remove_empty=True)[ソース]
convert(mode)[ソース]
copy_with_fields(fields, skip_missing=False)[ソース]
crop(box)[ソース]

Cropss a rectangular region from this bounding box. The box is a 4-tuple defining the left, upper, right, and lower pixel coordinate.

fields()[ソース]
get_field(field)[ソース]
has_field(field)[ソース]
resize(size, *args, **kwargs)[ソース]

Returns a resized copy of this bounding box :param size: The requested size in pixels, as a 2-tuple:

(width, height).

to(device)[ソース]
transpose(method)[ソース]

Transpose bounding box (flip or rotate in 90 degree steps) :param method: One of PIL.Image.FLIP_LEFT_RIGHT,

PIL.Image.FLIP_TOP_BOTTOM, PIL.Image.ROTATE_90, PIL.Image.ROTATE_180, PIL.Image.ROTATE_270, PIL.Image.TRANSPOSE or PIL.Image.TRANSVERSE.

face01lib.damo_yolo.damo_internal.structures.boxlist_ops module

boxlist_iou(boxlist1, boxlist2)[ソース]

Compute the intersection over union of two set of boxes. The box order must be (xmin, ymin, xmax, ymax). :param box1: (BoxList) bounding boxes, sized [N,4]. :param box2: (BoxList) bounding boxes, sized [M,4].

戻り値:

(tensor) iou, sized [N,M].

Reference:

https://github.com/chainer/chainercv/blob/master/chainercv/utils/bbox/bbox_iou.py

cat_boxlist(bboxes)[ソース]

Concatenates a list of BoxList (having the same image size) into a single BoxList :param bboxes: :type bboxes: list[BoxList]

remove_small_boxes(boxlist, min_size)[ソース]

Only keep boxes with both sides >= min_size :param boxlist: :type boxlist: Boxlist :param min_size: :type min_size: int

face01lib.damo_yolo.damo_internal.structures.image_list module

class ImageList(tensors, image_sizes, pad_sizes)[ソース]

ベースクラス: object

Structure that holds a list of images (of possibly varying sizes) as a single tensor. This works by padding the images to the same size, and storing in a field the original sizes of each image

to(*args, **kwargs)[ソース]
to_image_list(tensors, size_divisible=0, max_size=None)[ソース]

tensors can be an ImageList, a torch.Tensor or an iterable of Tensors. It can't be a numpy array. When tensors is an iterable of Tensors, it pads the Tensors with zeros so that they have the same shape

Module contents