Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a4b4ecd8
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
a4b4ecd8
编写于
2月 26, 2019
作者:
L
lujun
提交者:
GitHub
2月 26, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15906 from junjun315/fix-api-doc-20190220
Fix util-plot for py3
上级
8e439ccf
23560d08
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
9 deletion
+10
-9
python/paddle/utils/plot.py
python/paddle/utils/plot.py
+8
-7
python/paddle/utils/preprocess_img.py
python/paddle/utils/preprocess_img.py
+2
-2
未找到文件。
python/paddle/utils/plot.py
浏览文件 @
a4b4ecd8
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
# limitations under the License.
# limitations under the License.
import
os
import
os
import
six
class
PlotData
(
object
):
class
PlotData
(
object
):
...
@@ -60,9 +61,9 @@ class Ploter(object):
...
@@ -60,9 +61,9 @@ class Ploter(object):
def
append
(
self
,
title
,
step
,
value
):
def
append
(
self
,
title
,
step
,
value
):
"""
"""
Feed data
Feed data
Args:
Args:
title: assign the group data to this subtitle.
title: assign the group data to this subtitle.
step: the x_axis of data.
step: the x_axis of data.
value: the y_axis of data.
value: the y_axis of data.
...
@@ -71,9 +72,9 @@ class Ploter(object):
...
@@ -71,9 +72,9 @@ class Ploter(object):
.. code-block:: python
.. code-block:: python
plot_curve = Ploter("Curve 1","Curve 2")
plot_curve = Ploter("Curve 1","Curve 2")
plot_curve.append(title="Curve 1",step=1,value=1)
plot_curve.append(title="Curve 1",step=1,value=1)
"""
"""
assert
isinstance
(
title
,
basestring
)
assert
isinstance
(
title
,
six
.
string_types
)
assert
self
.
__plot_data__
.
has_key
(
title
)
assert
title
in
self
.
__plot_data__
data
=
self
.
__plot_data__
[
title
]
data
=
self
.
__plot_data__
[
title
]
assert
isinstance
(
data
,
PlotData
)
assert
isinstance
(
data
,
PlotData
)
data
.
append
(
step
,
value
)
data
.
append
(
step
,
value
)
...
@@ -89,7 +90,7 @@ class Ploter(object):
...
@@ -89,7 +90,7 @@ class Ploter(object):
.. code-block:: python
.. code-block:: python
plot_curve = Ploter()
plot_curve = Ploter()
plot_cure.plot()
plot_cure.plot()
"""
"""
if
self
.
__plot_is_disabled__
():
if
self
.
__plot_is_disabled__
():
return
return
...
...
python/paddle/utils/preprocess_img.py
浏览文件 @
a4b4ecd8
...
@@ -122,7 +122,7 @@ class ImageClassificationDatasetCreater(preprocess_util.DatasetCreater):
...
@@ -122,7 +122,7 @@ class ImageClassificationDatasetCreater(preprocess_util.DatasetCreater):
def
create_dataset_from_list
(
self
,
path
):
def
create_dataset_from_list
(
self
,
path
):
data
=
[]
data
=
[]
label_set
=
[]
label_set
=
[]
for
line
in
open
(
file_list
):
for
line
in
open
(
path
):
items
=
line
.
rstrip
.
split
()
items
=
line
.
rstrip
.
split
()
image_path
=
items
[
0
]
image_path
=
items
[
0
]
label_name
=
items
[
1
]
label_name
=
items
[
1
]
...
@@ -141,7 +141,7 @@ class ImageClassificationDatasetCreater(preprocess_util.DatasetCreater):
...
@@ -141,7 +141,7 @@ class ImageClassificationDatasetCreater(preprocess_util.DatasetCreater):
path: the path of the image dataset.
path: the path of the image dataset.
"""
"""
if
self
.
from_list
:
if
self
.
from_list
:
return
create_dataset_from_list
(
path
)
return
self
.
create_dataset_from_list
(
path
)
label_set
=
preprocess_util
.
get_label_set_from_dir
(
path
)
label_set
=
preprocess_util
.
get_label_set_from_dir
(
path
)
data
=
[]
data
=
[]
for
l_name
in
list
(
label_set
.
keys
()):
for
l_name
in
list
(
label_set
.
keys
()):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录