Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleX
提交
0f858449
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看板
提交
0f858449
编写于
5月 19, 2020
作者:
S
sunyanfang01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the vis.py
上级
87a1222c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
12 deletion
+19
-12
paddlex/interpret/core/_session_preparation.py
paddlex/interpret/core/_session_preparation.py
+18
-4
paddlex/interpret/visualize.py
paddlex/interpret/visualize.py
+1
-8
未找到文件。
paddlex/interpret/core/_session_preparation.py
浏览文件 @
0f858449
...
...
@@ -13,15 +13,29 @@
#limitations under the License.
import
os
import
os.path
as
osp
import
paddle.fluid
as
fluid
import
numpy
as
np
from
paddle.fluid.param_attr
import
ParamAttr
from
..as_data_reader.readers
import
preprocess_image
root_path
=
os
.
environ
[
'HOME'
]
root_path
=
os
.
path
.
join
(
root_path
,
'.paddlex'
)
h_pre_models
=
os
.
path
.
join
(
root_path
,
"pre_models"
)
h_pre_models_kmeans
=
os
.
path
.
join
(
h_pre_models
,
"kmeans_model.pkl"
)
def
gen_user_home
():
if
"HOME"
in
os
.
environ
:
home_path
=
os
.
environ
[
"HOME"
]
if
os
.
path
.
exists
(
home_path
)
and
os
.
path
.
isdir
(
home_path
):
return
home_path
return
os
.
path
.
expanduser
(
'~'
)
root_path
=
gen_user_home
()
root_path
=
osp
.
join
(
root_path
,
'.paddlex'
)
h_pre_models
=
osp
.
join
(
root_path
,
"pre_models"
)
if
not
osp
.
exists
(
h_pre_models
):
if
not
osp
.
exists
(
root_path
):
os
.
makedirs
(
root_path
)
url
=
"https://bj.bcebos.com/paddlex/interpret/pre_models.tar.gz"
pdx
.
utils
.
download_and_decompress
(
url
,
path
=
root_path
)
h_pre_models_kmeans
=
osp
.
join
(
h_pre_models
,
"kmeans_model.pkl"
)
def
paddle_get_fc_weights
(
var_name
=
"fc_0.w_0"
):
...
...
paddlex/interpret/visualize.py
浏览文件 @
0f858449
...
...
@@ -21,14 +21,7 @@ import paddlex as pdx
from
.interpretation_predict
import
interpretation_predict
from
.core.interpretation
import
Interpretation
from
.core.normlime_base
import
precompute_normlime_weights
def
gen_user_home
():
if
"HOME"
in
os
.
environ
:
home_path
=
os
.
environ
[
"HOME"
]
if
os
.
path
.
exists
(
home_path
)
and
os
.
path
.
isdir
(
home_path
):
return
home_path
return
os
.
path
.
expanduser
(
'~'
)
from
.core._session_preparation
import
gen_user_home
def
visualize
(
img_file
,
model
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录