Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Add crop_bbox #291

Merged
merged 6 commits into from
Jun 23, 2017
Merged

Add crop_bbox #291

merged 6 commits into from
Jun 23, 2017

Conversation

Hakuyume
Copy link
Member

No description provided.

tensor of shape :math:`(R, 4)`, where :math:`R` is the number of
bounding boxes in the image. The second axis represents attributes of
the bounding box. They are :obj:`(y_min, x_min, y_max, x_max)`,
where the four attributes are coordinates of the bottom left and the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Top left and bottom right

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing out. #294

y_slice (slice): The slice of y axis.
x_slice (slice): The slice of x axis.
allow_outside_center (bool): If this argument is :obj:`False`,
bounding boxes whose centers are outside of the cropping area
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/cropping/cropped

This method is mainly used together with image cropping.
This method translates the coordinates of bounding boxes like
:func:`~chainercv.transforms.translate_bbox`. In addition,
this function truncates the bounding boxes to fit within the cropping area.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.
s/cropping/cropped.

This method translates the coordinates of bounding boxes like
:func:`~chainercv.transforms.translate_bbox`. In addition,
this function truncates the bounding boxes to fit within the cropping area.
If a bounding box does not overlap with the cropping area,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

def crop_bbox(
bbox, y_slice=None, x_slice=None,
allow_outside_center=True, return_param=False):
"""Crop bounding boxes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing because it sound as if bounding boxes are cropped into a smaller piece.

How about "Translate bounding boxes to a cropped region of an image."

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function crops bounding boxes into a smaller piece.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but main purpose of this function is not to crop bounding boxes into smaller pieces.
Its main purpose is to adjust bounding boxes to reflect image cropping.

I think this should be clear in the beginning of the doc.

@yuyu2172
Copy link
Member

LGTM

@yuyu2172 yuyu2172 merged commit fb7d964 into chainer:master Jun 23, 2017
@Hakuyume Hakuyume deleted the add-crop-bbox branch June 25, 2017 03:20
@yuyu2172 yuyu2172 added this to the v0.6 milestone Jul 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants