This repository has been archived by the owner on Jul 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 304
use scales (tuple of floats) in region_proposal_network #729
Merged
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5812f8e
use scales as tuple of float
knorth55 95181df
fix faster_rcnn_tests to use scales
knorth55 1d76c74
update scale parameter docstring in faster_rcnn
knorth55 c6b6de1
support back compatibility for region_proposal_network scales
knorth55 785ea86
add test for rpn scales
knorth55 97576b8
set scales default value (None) in faster_rcnn.py
knorth55 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto |
||
"""Forward Region Proposal Network. | ||
|
||
Here are notations. | ||
|
@@ -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 floats): The amount of scaling done to each input | ||
image during preprocessing. | ||
|
||
Returns: | ||
(~chainer.Variable, ~chainer.Variable, array, array, array): | ||
|
@@ -127,7 +127,7 @@ def __call__(self, x, img_size, scale=1.): | |
for i in range(n): | ||
roi = self.proposal_layer( | ||
rpn_locs[i].array, rpn_fg_scores[i].array, anchor, img_size, | ||
scale=scale) | ||
scale=scales[i]) | ||
batch_index = i * self.xp.ones((len(roi),), dtype=np.int32) | ||
rois.append(roi) | ||
roi_indices.append(batch_index) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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