diff --git a/deploy/python/build_gallery.py b/deploy/python/build_gallery.py index 7b69a04d77422d428c33278da52e8ae10d34a8ca..28fd08388b4b51be7e9ec982a064b7219cb5115a 100644 --- a/deploy/python/build_gallery.py +++ b/deploy/python/build_gallery.py @@ -12,10 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. import os -import sys - -__dir__ = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) import cv2 import faiss @@ -23,10 +19,10 @@ import numpy as np from tqdm import tqdm import pickle -from python.predict_rec import RecPredictor - -from utils import logger -from utils import config +from paddleclas.deploy.utils import logger, config +from paddleclas.deploy.utils.predictor import Predictor +from paddleclas.deploy.python.predict_rec import RecPredictor +from paddleclas.deploy.python.predict_rec import RecPredictor def split_datafile(data_file, image_root, delimiter="\t"): diff --git a/deploy/python/predict_det.py b/deploy/python/predict_det.py index 37a7bf5018c3b5dc78e897b532303f70b0d3957d..b3832d32eb9f70660b5f064b2834ae019f1acde5 100644 --- a/deploy/python/predict_det.py +++ b/deploy/python/predict_det.py @@ -11,29 +11,23 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -import os -import sys - -__dir__ = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) - -from utils import logger -from utils import config -from utils.predictor import Predictor -from utils.get_image_list import get_image_list -from det_preprocess import det_preprocess -from preprocess import create_operators - import os import argparse import time +from functools import reduce + import yaml import ast -from functools import reduce -import cv2 import numpy as np +import cv2 import paddle +from paddleclas.deploy.utils import logger, config +from paddleclas.deploy.utils.predictor import Predictor +from paddleclas.deploy.utils.get_image_list import get_image_list +from paddleclas.deploy.python.preprocess import create_operators +from paddleclas.deploy.python.det_preprocess import det_preprocess + class DetPredictor(Predictor): def __init__(self, config): diff --git a/deploy/python/predict_rec.py b/deploy/python/predict_rec.py index e243358108edb7fe6f86ad9bd6a9f46c6b2c3040..4cc9384f238b7d4eed21c4a22c06a3f687406338 100644 --- a/deploy/python/predict_rec.py +++ b/deploy/python/predict_rec.py @@ -12,20 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. import os -import sys - -__dir__ = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) import cv2 import numpy as np -from utils import logger -from utils import config -from utils.predictor import Predictor -from utils.get_image_list import get_image_list -from preprocess import create_operators -from postprocess import build_postprocess +from paddleclas.deploy.utils import logger, config +from paddleclas.deploy.utils.predictor import Predictor +from paddleclas.deploy.utils.get_image_list import get_image_list +from paddleclas.deploy.python.preprocess import create_operators +from paddleclas.deploy.python.postprocess import build_postprocess class RecPredictor(Predictor): diff --git a/deploy/python/predict_system.py b/deploy/python/predict_system.py index 2398755357ceb260e3e2e08ae903d0238b531bbd..44ff8a2e14d8cd181f2c59e28efb6e110b3b48f4 100644 --- a/deploy/python/predict_system.py +++ b/deploy/python/predict_system.py @@ -12,24 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. import os -import sys - -__dir__ = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.abspath(os.path.join(__dir__, '../'))) - import copy -import cv2 + import numpy as np +import cv2 import faiss import pickle -from python.predict_rec import RecPredictor -from python.predict_det import DetPredictor - -from utils import logger -from utils import config -from utils.get_image_list import get_image_list -from utils.draw_bbox import draw_bbox_results +from paddleclas.deploy.utils import logger, config +from paddleclas.deploy.utils.get_image_list import get_image_list +from paddleclas.deploy.utils.draw_bbox import draw_bbox_results +from paddleclas.deploy.python.predict_rec import RecPredictor +from paddleclas.deploy.python.predict_det import DetPredictor class SystemPredictor(object):