diff --git a/python/paddle_serving_app/reader/__init__.py b/python/paddle_serving_app/reader/__init__.py index aa605ddd31e1b0cf9d380b409fdc513d68cd56f7..f3f93f41f9874f63bfb31bfc782372045aa0b3fe 100644 --- a/python/paddle_serving_app/reader/__init__.py +++ b/python/paddle_serving_app/reader/__init__.py @@ -21,12 +21,3 @@ from .lac_reader import LACReader from .senta_reader import SentaReader #from .imdb_reader import IMDBDataset from .ocr_reader import OCRReader - -if os.path.exists('libgpupreprocess.so'): - from libgpupreprocess import Image2Gpubuffer, Gpubuffer2Image, RGB2BGR, BGR2RGB - from libgpupreprocess import Div, Sub, Normalize, CenterCrop, Resize, ResizeByFactor -else: - from .image_reader import ImageReader, File2Image, URL2Image - from .image_reader import Sequential, Normalize, Base64ToImage - from .image_reader import CenterCrop, Resize, Transpose, Div - from .image_reader import RGB2BGR, BGR2RGB, ResizeByFactor diff --git a/python/setup.py.app.in b/python/setup.py.app.in index 1e08ee3e4abdd392490da0e6166abb3f5902a863..78b379046d9397a239cbae5ea89bd3941bb0bc16 100644 --- a/python/setup.py.app.in +++ b/python/setup.py.app.in @@ -40,12 +40,6 @@ max_version, mid_version, min_version = python_version() if '${PACK}' == 'ON': copy_lib() -if os.path.exists('../core/preprocess/hwvideoframe/libgpupreprocess.so'): - os.system('mkdir -p ./paddle_serving_app/reader/lib') - os.system('cp ../core/preprocess/hwvideoframe/libgpupreprocess.so ./paddle_serving_app/reader') - os.system('cp ../core/preprocess/hwvideoframe/cuda/libgpu.so ./paddle_serving_app/reader/lib') - os.system('export LD_LIBRARY_PATH="./paddle_serving_app/reader/lib"') - REQUIRED_PACKAGES = [ 'six >= 1.10.0', 'sentencepiece<=0.1.92', 'opencv-python<=4.2.0.32', 'pillow', 'pyclipper' @@ -59,7 +53,11 @@ packages=['paddle_serving_app', 'paddle_serving_app.reader.pddet', 'paddle_serving_app.reader.lib'] -package_data={} +if os.path.exists('../core/preprocess/hwvideoframe/libgpupreprocess.so'): + package_data={'paddle_serving_app': ['../core/preprocess/hwvideoframe/libgpupreprocess.so'],} +else: + package_data={} + package_dir={'paddle_serving_app': '${PADDLE_SERVING_BINARY_DIR}/python/paddle_serving_app', 'paddle_serving_app.proto':