-
Notifications
You must be signed in to change notification settings - Fork 304
FPN - Add min/max size params for pre-processing. #830
Changes from all commits
b1cca53
451c216
ea816f8
b27316c
99a0a35
f1ad965
2f2d262
98e5058
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,8 @@ class FasterRCNNFPNResNet(FasterRCNN): | |
A subclass of this class should have :obj:`_base` and :obj:`_models`. | ||
""" | ||
|
||
def __init__(self, n_fg_class=None, pretrained_model=None): | ||
def __init__(self, n_fg_class=None, pretrained_model=None, | ||
min_size=800, max_size=1333): | ||
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.
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. That was a versioning mistake. It will be added on L39. |
||
param, path = utils.prepare_pretrained_model( | ||
{'n_fg_class': n_fg_class}, pretrained_model, self._models) | ||
|
||
|
@@ -35,6 +36,7 @@ def __init__(self, n_fg_class=None, pretrained_model=None): | |
extractor=extractor, | ||
rpn=RPN(extractor.scales), | ||
head=Head(param['n_fg_class'] + 1, extractor.scales), | ||
min_size=min_size, max_size=max_size | ||
) | ||
|
||
if path == 'imagenet': | ||
|
@@ -56,10 +58,10 @@ class FasterRCNNFPNResNet50(FasterRCNNFPNResNet): | |
Feature Pyramid Networks for Object Detection. CVPR 2017 | ||
|
||
Args: | ||
n_fg_class (int): The number of classes excluding the background. | ||
pretrained_model (string): The weight file to be loaded. | ||
This can take :obj:`'coco'`, `filepath` or :obj:`None`. | ||
The default value is :obj:`None`. | ||
n_fg_class (int): The number of classes excluding the background. | ||
pretrained_model (string): The weight file to be loaded. | ||
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. Why did you change the indentation? 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. The rest of the code is indented with 4 space. 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. This was my mistake. Thank you for fixing! |
||
This can take :obj:`'coco'`, `filepath` or :obj:`None`. | ||
The default value is :obj:`None`. | ||
|
||
* :obj:`'coco'`: Load weights trained on train split of \ | ||
MS COCO 2017. \ | ||
|
@@ -74,6 +76,9 @@ class FasterRCNNFPNResNet50(FasterRCNNFPNResNet): | |
* `filepath`: A path of npz file. In this case, :obj:`n_fg_class` \ | ||
must be specified properly. | ||
* :obj:`None`: Do not load weights. | ||
min_size (int): A preprocessing paramter for :meth:`prepare`. Please \ | ||
refer to :meth:`prepare`. | ||
max_size (int): A preprocessing paramter for :meth:`prepare`. | ||
|
||
""" | ||
|
||
|
@@ -99,10 +104,10 @@ class FasterRCNNFPNResNet101(FasterRCNNFPNResNet): | |
Feature Pyramid Networks for Object Detection. CVPR 2017 | ||
|
||
Args: | ||
n_fg_class (int): The number of classes excluding the background. | ||
pretrained_model (string): The weight file to be loaded. | ||
This can take :obj:`'coco'`, `filepath` or :obj:`None`. | ||
The default value is :obj:`None`. | ||
n_fg_class (int): The number of classes excluding the background. | ||
pretrained_model (string): The weight file to be loaded. | ||
This can take :obj:`'coco'`, `filepath` or :obj:`None`. | ||
The default value is :obj:`None`. | ||
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. |
||
|
||
* :obj:`'coco'`: Load weights trained on train split of \ | ||
MS COCO 2017. \ | ||
|
@@ -117,6 +122,9 @@ class FasterRCNNFPNResNet101(FasterRCNNFPNResNet): | |
* `filepath`: A path of npz file. In this case, :obj:`n_fg_class` \ | ||
must be specified properly. | ||
* :obj:`None`: Do not load weights. | ||
min_size (int): A preprocessing paramter for :meth:`prepare`. Please \ | ||
refer to :meth:`prepare`. | ||
max_size (int): A preprocessing paramter for :meth:`prepare`. | ||
|
||
""" | ||
|
||
|
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.
How about this?
docstring
will be confusing when it rendered by sphinx.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.
This was done in the same style as the faster-rcnn docs with regards to the param.
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.
I see.