提交 0814b2b3 编写于 作者: J jiangjiajun

modify interpret

上级 88095e18
...@@ -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'
...@@ -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
...@@ -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
......
...@@ -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.
先完成此消息的编辑!
想要评论请 注册