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

use scales (tuple of floats) in region_proposal_network #729

Merged
merged 6 commits into from
Nov 7, 2018

Conversation

knorth55
Copy link
Contributor

@knorth55 knorth55 commented Nov 6, 2018

x is (N, C, H, W) and scale is scalar value.
I modify to use scales: (N, ).

@@ -82,8 +82,8 @@ def __call__(self, x, img_size, scale=1.):
Its shape is :math:`(N, C, H, W)`.
img_size (tuple of ints): A tuple :obj:`height, width`,
which contains image size after scaling.
scale (float): The amount of scaling done to the input images after
reading them from files.
scales (tuple of float): The amount of scaling done to the input
Copy link
Member

Choose a reason for hiding this comment

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

tuple of floats

Copy link
Member

Choose a reason for hiding this comment

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

I guess it is better to make the definition clear that scaling parameter can be different for each image.
Perhaps:
The amount of scaling done to each input image during preprocessing?

Similarly, please change the rest of the definition for scales (they are currently not consistent, but it would be better to use the same wording for all of them).

@@ -132,7 +132,7 @@ def __call__(self, x, scale=1.):

Args:
x (~chainer.Variable): 4D image variable.
scale (float): Amount of scaling applied to the raw image
scales (tuple of float): Amount of scaling applied to the raw image
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -79,7 +79,7 @@ def __call__(self, imgs, bboxes, labels, scale):
the definition, which means that the range of the value
is :math:`[0, L - 1]`. :math:`L` is the number of foreground
classes.
scale (float or ~chainer.Variable): Amount of scaling applied to
scale (~chainer.Variable): Amount of scaling applied to
Copy link
Member

Choose a reason for hiding this comment

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

scales

@knorth55
Copy link
Contributor Author

knorth55 commented Nov 7, 2018

Thx for the review. I updated.

@@ -112,10 +112,10 @@ def n_class(self):
# Total number of classes including the background.
return self.head.n_class

def __call__(self, x, scale=1.):
def __call__(self, x, scales):
Copy link
Member

Choose a reason for hiding this comment

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

The default value should be set in order to prevent this from becoming no-compat

@@ -67,7 +67,7 @@ def __init__(
self.loc = L.Convolution2D(
mid_channels, n_anchor * 4, 1, 1, 0, initialW=initialW)

def __call__(self, x, img_size, scale=1.):
def __call__(self, x, img_size, scales):
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@knorth55 knorth55 removed the no-compat label Nov 7, 2018
@knorth55
Copy link
Contributor Author

knorth55 commented Nov 7, 2018

Thanks, updated :)

@knorth55 knorth55 changed the title use scales (tuple of float) in region_proposal_network use scales (tuple of floats) in region_proposal_network Nov 7, 2018
@knorth55 knorth55 added this to the 0.12 milestone Nov 7, 2018
@yuyu2172 yuyu2172 merged commit cff67f2 into chainer:master Nov 7, 2018
@knorth55 knorth55 deleted the faster-rcnn-scales branch November 8, 2018 05:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants