Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿飞的客栈
Mask_RCNN
提交
94196f5c
M
Mask_RCNN
项目概览
阿飞的客栈
/
Mask_RCNN
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Mask_RCNN
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
94196f5c
编写于
3月 31, 2018
作者:
W
Waleed Abdulla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix comments
上级
38ed3398
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
21 addition
and
11 deletion
+21
-11
config.py
config.py
+1
-1
model.py
model.py
+16
-6
utils.py
utils.py
+4
-4
未找到文件。
config.py
浏览文件 @
94196f5c
...
...
@@ -72,7 +72,7 @@ class Config(object):
RPN_ANCHOR_STRIDE
=
1
# Non-max suppression threshold to filter RPN proposals.
# You can
reduc
e this during training to generate more propsals.
# You can
increas
e this during training to generate more propsals.
RPN_NMS_THRESHOLD
=
0.7
# How many anchors per image to use for RPN training
...
...
model.py
浏览文件 @
94196f5c
...
...
@@ -808,7 +808,9 @@ class DetectionLayer(KE.Layer):
return
(
None
,
self
.
config
.
DETECTION_MAX_INSTANCES
,
6
)
# Region Proposal Network (RPN)
############################################################
# Region Proposal Network (RPN)
############################################################
def
rpn_graph
(
feature_map
,
anchors_per_location
,
anchor_stride
):
"""Builds the computation graph of Region Proposal Network.
...
...
@@ -1223,7 +1225,7 @@ def load_image_gt(dataset, config, image_id, augment=False, augmentation=None,
"""Determines which augmenters to apply to masks."""
return
(
augmenter
.
__class__
.
__name__
in
MASK_AUGMENTERS
)
# Store
original shapes
to compare
# Store
shapes before augmentation
to compare
image_shape
=
image
.
shape
mask_shape
=
mask
.
shape
# Make augmenters deterministic to apply similarly to images and masks
...
...
@@ -1390,7 +1392,7 @@ def build_detection_targets(rpn_rois, gt_class_ids, gt_boxes, gt_masks, config):
# Normalize bbox refinements
bboxes
/=
config
.
BBOX_STD_DEV
# Generate class-specific target masks
.
# Generate class-specific target masks
masks
=
np
.
zeros
((
config
.
TRAIN_ROIS_PER_IMAGE
,
config
.
MASK_SHAPE
[
0
],
config
.
MASK_SHAPE
[
1
],
config
.
NUM_CLASSES
),
dtype
=
np
.
float32
)
for
i
in
pos_ids
:
...
...
@@ -2223,9 +2225,17 @@ class MaskRCNN():
3+: Train Resnet stage 3 and up
4+: Train Resnet stage 4 and up
5+: Train Resnet stage 5 and up
augmentation: Optional. An imgaug (https://github.com/aleju/imgaug) augmentation.
For example, passing imgaug.augmenters.Fliplr(0.5) flips images
right/left 50% of the time.
augmentation: Optional. An imgaug (https://github.com/aleju/imgaug)
augmentation. For example, passing imgaug.augmenters.Fliplr(0.5)
flips images right/left 50% of the time. You can pass complex
augmentations as well. This augmentation applies 50% of the
time, and when it does it flips images right/left half the time
and adds a Gausssian blur with a random sigma in range 0 to 5.
augmentation = imgaug.augmenters.Sometimes(0.5, [
imgaug.augmenters.Fliplr(0.5),
imgaug.augmenters.GaussianBlur(sigma=(0.0, 5.0))
])
"""
assert
self
.
mode
==
"training"
,
"Create model in training mode."
...
...
utils.py
浏览文件 @
94196f5c
...
...
@@ -456,8 +456,8 @@ def resize_mask(mask, scale, padding):
def
minimize_mask
(
bbox
,
mask
,
mini_shape
):
"""Resize masks to a smaller version to
cut
memory load.
Mini-masks can
then
resized back to image scale using expand_masks()
"""Resize masks to a smaller version to
reduce
memory load.
Mini-masks can
be
resized back to image scale using expand_masks()
See inspect_data.ipynb notebook for more details.
"""
...
...
@@ -498,8 +498,8 @@ def mold_mask(mask, config):
def
unmold_mask
(
mask
,
bbox
,
image_shape
):
"""Converts a mask generated by the neural network
in
to a format similar
to it
'
s original shape.
"""Converts a mask generated by the neural network to a format similar
to its original shape.
mask: [height, width] of type float. A small, typically 28x28 mask.
bbox: [y1, x1, y2, x2]. The box to fit the mask in.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录