Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
ca4a7224
P
PaddleX
项目概览
PaddlePaddle
/
PaddleX
通知
138
Star
4
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
43
列表
看板
标记
里程碑
合并请求
5
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
43
Issue
43
列表
看板
标记
里程碑
合并请求
5
合并请求
5
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ca4a7224
编写于
8月 05, 2020
作者:
M
mamingjie-China
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update some log
上级
ac619fad
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
12 deletion
+16
-12
paddlex/command.py
paddlex/command.py
+6
-3
paddlex/tools/dataset_split/coco_split.py
paddlex/tools/dataset_split/coco_split.py
+3
-3
paddlex/tools/dataset_split/imagenet_split.py
paddlex/tools/dataset_split/imagenet_split.py
+1
-0
paddlex/tools/dataset_split/seg_split.py
paddlex/tools/dataset_split/seg_split.py
+3
-3
paddlex/tools/dataset_split/voc_split.py
paddlex/tools/dataset_split/voc_split.py
+3
-3
未找到文件。
paddlex/command.py
浏览文件 @
ca4a7224
...
...
@@ -93,7 +93,10 @@ def arg_parser():
default
=
False
,
help
=
"split dataset with the split value"
)
parser
.
add_argument
(
"--form"
,
"-f"
,
default
=
None
,
help
=
"define dataset format"
)
"--form"
,
"-f"
,
default
=
None
,
help
=
"define dataset format(ImageNet/COCO/VOC/Seg)"
)
parser
.
add_argument
(
"--dataset_dir"
,
"-dd"
,
...
...
@@ -104,12 +107,12 @@ def arg_parser():
"--val_value"
,
"-vv"
,
default
=
None
,
help
=
"define the value of validation dataset"
)
help
=
"define the value of validation dataset
(E.g 0.2)
"
)
parser
.
add_argument
(
"--test_value"
,
"-tv"
,
default
=
None
,
help
=
"define the value of test dataset"
)
help
=
"define the value of test dataset
(E.g 0.1)
"
)
return
parser
...
...
paddlex/tools/dataset_split/coco_split.py
浏览文件 @
ca4a7224
...
...
@@ -16,19 +16,19 @@ import os.path as osp
import
random
import
json
from
.utils
import
MyEncoder
import
paddlex.utils.logging
as
logging
def
split_coco_dataset
(
dataset_dir
,
val_percent
,
test_percent
,
save_dir
):
if
not
osp
.
exists
(
osp
.
join
(
dataset_dir
,
"annotations.json"
)):
raise
ValueE
rror
(
"
\'
annotations.json
\'
is not found in {}!"
.
format
(
logging
.
e
rror
(
"
\'
annotations.json
\'
is not found in {}!"
.
format
(
dataset_dir
))
try
:
from
pycocotools.coco
import
COCO
except
:
print
(
logging
.
error
(
"pycococotools is not installed, follow this doc install pycocotools: https://paddlex.readthedocs.io/zh_CN/develop/install.html#pycocotools"
)
return
annotation_file
=
osp
.
join
(
dataset_dir
,
"annotations.json"
)
coco
=
COCO
(
annotation_file
)
...
...
paddlex/tools/dataset_split/imagenet_split.py
浏览文件 @
ca4a7224
...
...
@@ -15,6 +15,7 @@
import
os.path
as
osp
import
random
from
.utils
import
list_files
,
is_pic
import
paddlex.utils.logging
as
logging
def
split_imagenet_dataset
(
dataset_dir
,
val_percent
,
test_percent
,
save_dir
):
...
...
paddlex/tools/dataset_split/seg_split.py
浏览文件 @
ca4a7224
...
...
@@ -15,14 +15,14 @@
import
os.path
as
osp
import
random
from
.utils
import
list_files
,
is_pic
,
replace_ext
,
read_seg_ann
import
paddlex.utils.logging
as
logging
def
split_seg_dataset
(
dataset_dir
,
val_percent
,
test_percent
,
save_dir
):
if
not
osp
.
exists
(
osp
.
join
(
dataset_dir
,
"JPEGImages"
)):
raise
ValueError
(
"
\'
JPEGImages
\'
is not found in {}!"
.
format
(
dataset_dir
))
logging
.
error
(
"
\'
JPEGImages
\'
is not found in {}!"
.
format
(
dataset_dir
))
if
not
osp
.
exists
(
osp
.
join
(
dataset_dir
,
"Annotations"
)):
raise
ValueE
rror
(
"
\'
Annotations
\'
is not found in {}!"
.
format
(
logging
.
e
rror
(
"
\'
Annotations
\'
is not found in {}!"
.
format
(
dataset_dir
))
all_image_files
=
list_files
(
osp
.
join
(
dataset_dir
,
"JPEGImages"
))
...
...
paddlex/tools/dataset_split/voc_split.py
浏览文件 @
ca4a7224
...
...
@@ -16,14 +16,14 @@ import os.path as osp
import
random
import
xml.etree.ElementTree
as
ET
from
.utils
import
list_files
,
is_pic
,
replace_ext
import
paddlex.utils.logging
as
logging
def
split_voc_dataset
(
dataset_dir
,
val_percent
,
test_percent
,
save_dir
):
if
not
osp
.
exists
(
osp
.
join
(
dataset_dir
,
"JPEGImages"
)):
raise
ValueError
(
"
\'
JPEGImages
\'
is not found in {}!"
.
format
(
dataset_dir
))
logging
.
error
(
"
\'
JPEGImages
\'
is not found in {}!"
.
format
(
dataset_dir
))
if
not
osp
.
exists
(
osp
.
join
(
dataset_dir
,
"Annotations"
)):
raise
ValueE
rror
(
"
\'
Annotations
\'
is not found in {}!"
.
format
(
logging
.
e
rror
(
"
\'
Annotations
\'
is not found in {}!"
.
format
(
dataset_dir
))
all_image_files
=
list_files
(
osp
.
join
(
dataset_dir
,
"JPEGImages"
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录