Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
阿飞的客栈
Mask_RCNN
提交
10a364f9
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,发现更多精彩内容 >>
提交
10a364f9
编写于
9月 20, 2018
作者:
W
Waleed
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Comments to explain VIA 2.0 JSON change
上级
80f26b39
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
2 deletion
+4
-2
samples/balloon/balloon.py
samples/balloon/balloon.py
+4
-2
未找到文件。
samples/balloon/balloon.py
浏览文件 @
10a364f9
...
...
@@ -94,7 +94,7 @@ class BalloonDataset(utils.Dataset):
dataset_dir
=
os
.
path
.
join
(
dataset_dir
,
subset
)
# Load annotations
# VGG Image Annotator saves each image in the form:
# VGG Image Annotator
(up to version 1.6)
saves each image in the form:
# { 'filename': '28503151_5b5b7ec140_b.jpg',
# 'regions': {
# '0': {
...
...
@@ -108,6 +108,7 @@ class BalloonDataset(utils.Dataset):
# 'size': 100202
# }
# We mostly care about the x and y coordinates of each region
# Note: In VIA 2.0, regions was changed from a dict to a list.
annotations
=
json
.
load
(
open
(
os
.
path
.
join
(
dataset_dir
,
"via_region_data.json"
)))
annotations
=
list
(
annotations
.
values
())
# don't need the dict keys
...
...
@@ -118,8 +119,9 @@ class BalloonDataset(utils.Dataset):
# Add images
for
a
in
annotations
:
# Get the x, y coordinaets of points of the polygons that make up
# the outline of each object instance. The
r
e are stores in the
# the outline of each object instance. The
s
e are stores in the
# shape_attributes (see json format above)
# The if condition is needed to support VIA versions 1.x and 2.x.
if
type
(
a
[
'regions'
])
is
dict
:
polygons
=
[
r
[
'shape_attributes'
]
for
r
in
a
[
'regions'
].
values
()]
else
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录