Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
0814b2b3
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看板
提交
0814b2b3
编写于
5月 19, 2020
作者:
J
jiangjiajun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify interpret
上级
88095e18
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
8 addition
and
5 deletion
+8
-5
paddlex/__init__.py
paddlex/__init__.py
+3
-1
paddlex/interpret/core/_session_preparation.py
paddlex/interpret/core/_session_preparation.py
+2
-2
paddlex/interpret/core/interpretation_algorithms.py
paddlex/interpret/core/interpretation_algorithms.py
+2
-1
paddlex/interpret/core/normlime_base.py
paddlex/interpret/core/normlime_base.py
+1
-1
未找到文件。
paddlex/__init__.py
浏览文件 @
0814b2b3
...
@@ -29,7 +29,6 @@ from . import cls
...
@@ -29,7 +29,6 @@ from . import cls
from
.
import
slim
from
.
import
slim
from
.
import
convertor
from
.
import
convertor
from
.
import
tools
from
.
import
tools
from
.
import
interpret
from
.
import
deploy
from
.
import
deploy
try
:
try
:
...
@@ -51,4 +50,7 @@ load_model = cv.models.load_model
...
@@ -51,4 +50,7 @@ load_model = cv.models.load_model
datasets
=
cv
.
datasets
datasets
=
cv
.
datasets
log_level
=
2
log_level
=
2
from
.
import
interpret
__version__
=
'0.2.0.github'
__version__
=
'0.2.0.github'
paddlex/interpret/core/_session_preparation.py
浏览文件 @
0814b2b3
...
@@ -18,7 +18,7 @@ import paddle.fluid as fluid
...
@@ -18,7 +18,7 @@ import paddle.fluid as fluid
import
paddlex
as
pdx
import
paddlex
as
pdx
import
numpy
as
np
import
numpy
as
np
from
paddle.fluid.param_attr
import
ParamAttr
from
paddle.fluid.param_attr
import
ParamAttr
from
.
.as_data_reader.readers
import
preprocess_image
from
paddlex.interpret
.as_data_reader.readers
import
preprocess_image
def
gen_user_home
():
def
gen_user_home
():
if
"HOME"
in
os
.
environ
:
if
"HOME"
in
os
.
environ
:
...
@@ -125,4 +125,4 @@ def compute_features_for_kmeans(data_content):
...
@@ -125,4 +125,4 @@ def compute_features_for_kmeans(data_content):
images
=
preprocess_image
(
data_content
)
# transpose to [N, 3, H, W], scaled to [0.0, 1.0]
images
=
preprocess_image
(
data_content
)
# transpose to [N, 3, H, W], scaled to [0.0, 1.0]
result
=
exe
.
run
(
prog
,
fetch_list
=
[
resized_features
],
feed
=
{
'image'
:
images
})
result
=
exe
.
run
(
prog
,
fetch_list
=
[
resized_features
],
feed
=
{
'image'
:
images
})
return
result
[
0
][
0
]
return
result
[
0
][
0
]
\ No newline at end of file
paddlex/interpret/core/interpretation_algorithms.py
浏览文件 @
0814b2b3
...
@@ -17,9 +17,10 @@ import numpy as np
...
@@ -17,9 +17,10 @@ import numpy as np
import
time
import
time
from
.
import
lime_base
from
.
import
lime_base
from
..as_data_reader.readers
import
read_image
from
._session_preparation
import
paddle_get_fc_weights
,
compute_features_for_kmeans
,
h_pre_models_kmeans
from
._session_preparation
import
paddle_get_fc_weights
,
compute_features_for_kmeans
,
h_pre_models_kmeans
from
.normlime_base
import
combine_normlime_and_lime
,
get_feature_for_kmeans
,
load_kmeans_model
from
.normlime_base
import
combine_normlime_and_lime
,
get_feature_for_kmeans
,
load_kmeans_model
from
paddlex.interpret.as_data_reader.readers
import
read_image
import
cv2
import
cv2
...
...
paddlex/interpret/core/normlime_base.py
浏览文件 @
0814b2b3
...
@@ -16,7 +16,7 @@ import os
...
@@ -16,7 +16,7 @@ import os
import
numpy
as
np
import
numpy
as
np
import
glob
import
glob
from
.
.as_data_reader.readers
import
read_image
from
paddlex.interpret
.as_data_reader.readers
import
read_image
from
.
import
lime_base
from
.
import
lime_base
from
._session_preparation
import
compute_features_for_kmeans
,
h_pre_models_kmeans
from
._session_preparation
import
compute_features_for_kmeans
,
h_pre_models_kmeans
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录