diff --git a/core/preprocess/hwvideoframe/src/resize.cpp b/core/preprocess/hwvideoframe/src/resize.cpp index cea00c95ada4941a470d0e1f1546d193395ba028..d75cf66c4cf50d244f2bda237ff942fcda122dd0 100644 --- a/core/preprocess/hwvideoframe/src/resize.cpp +++ b/core/preprocess/hwvideoframe/src/resize.cpp @@ -35,7 +35,8 @@ std::shared_ptr Resize::operator()( percent = static_cast(_max_size) / static_cast(im_max_size); } resized_width = static_cast(round(input->nppi_size().width * percent)); - resized_height = static_cast(round(input->nppi_size().height * percent)); + resized_height = + static_cast(round(input->nppi_size().height * percent)); } auto output = std::make_shared(resized_height, resized_width); auto ret = resize_linear(input->p_frame(), diff --git a/core/preprocess/hwvideoframe/src/rgb_swap.cpp b/core/preprocess/hwvideoframe/src/rgb_swap.cpp index 9d5a6d64abbbbab345b42134c1c5367fa52ff26f..a123a2323c5621c2875eec29254629f9fb12e35b 100644 --- a/core/preprocess/hwvideoframe/src/rgb_swap.cpp +++ b/core/preprocess/hwvideoframe/src/rgb_swap.cpp @@ -14,8 +14,8 @@ #include -#include "core/preprocess/hwvideoframe/include/utils.h" #include "core/preprocess/hwvideoframe/include/rgb_swap.h" +#include "core/preprocess/hwvideoframe/include/utils.h" const int SwapChannel::_ORDER[CHANNEL_SIZE] = {2, 1, 0}; diff --git a/core/preprocess/nvdec-extractframe/include/ExtractFrameJpeg.h b/core/preprocess/nvdec-extractframe/include/ExtractFrameJpeg.h index 6543bf096882114bb532d631a84d363238e81917..31c98444f9f7f3cbfeeebed98239680c2f34b1fc 100644 --- a/core/preprocess/nvdec-extractframe/include/ExtractFrameJpeg.h +++ b/core/preprocess/nvdec-extractframe/include/ExtractFrameJpeg.h @@ -82,7 +82,7 @@ class ExtractFrameJpeg : public ExtractFrameBase { int jpeg_encode(uint8_t* p_image, int width, int height, - FrameResult &result); + const FrameResult& result); nvjpegHandle_t _nv_jpeg_handler; nvjpegEncoderState_t _nv_enc_state; nvjpegEncoderParams_t _nv_enc_params; diff --git a/python/paddle_serving_app/reader/test_preprocess.py b/python/paddle_serving_app/reader/test_preprocess.py index a487cc05306f320be37bd3893f99a727d43b73ad..82830b1da65db2da3fcb256f5187ad67ad24a0c0 100644 --- a/python/paddle_serving_app/reader/test_preprocess.py +++ b/python/paddle_serving_app/reader/test_preprocess.py @@ -21,6 +21,7 @@ from paddle_serving_app.reader import Sequential, Resize, File2Image import libgpupreprocess as pp import libhwextract + class TestOperators(unittest.TestCase): """ test all operators, e.g. Div, Normalize @@ -172,5 +173,6 @@ class TestOperators(unittest.TestCase): item.free_memory() # have to release memor + if __name__ == '__main__': unittest.main() diff --git a/python/paddle_serving_app/utils/__init__.py b/python/paddle_serving_app/utils/__init__.py index 56551b939a509fbbe59d6ac8f49ad6955e139a81..d8e70508ecb76d149d145c1774d69c4b7e79338e 100644 --- a/python/paddle_serving_app/utils/__init__.py +++ b/python/paddle_serving_app/utils/__init__.py @@ -11,5 +11,6 @@ # 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. +# pylint: disable=doc-string-missing -from .arr2image import Arr2Image \ No newline at end of file +from .arr2image import Arr2Image diff --git a/python/setup.py.app.in b/python/setup.py.app.in index 698f625d92a95231f03fa945ebeb03c233cc111e..9a17f0372fd3f3c626372bf3bdb1cc2f6a922772 100644 --- a/python/setup.py.app.in +++ b/python/setup.py.app.in @@ -40,13 +40,14 @@ max_version, mid_version, min_version = python_version() if '${PACK}' == 'ON': copy_lib() -os.system('mkdir -p ./paddle_serving_app/reader/lib') -os.system('cp -a -f ../core/preprocess/hwvideoframe/libgpupreprocess.so ./paddle_serving_app/reader') -os.system('cp -a -f ../core/preprocess/nvdec-extractframe/libhwextract.so ./paddle_serving_app/reader') -os.system('cp -a -f ../core/preprocess/hwvideoframe/cuda/libgpu.so ./paddle_serving_app/reader/lib') -os.system('cp -a -f ../core/preprocess/nvdec-extractframe/cuda/libhwgpu.so ./paddle_serving_app/reader/lib') -os.system('cp -a -f ../../core/preprocess/nvdec-extractframe/lib/* ./paddle_serving_app/reader/lib') -os.system('export LD_LIBRARY_PATH="./paddle_serving_app/reader/lib"') +if os.path.exists(../core/preprocess/hwvideoframe/libgpupreprocess.so): + os.system('mkdir ./paddle_serving_app/reader/lib') + os.system('cp ../core/preprocess/hwvideoframe/libgpupreprocess.so ./paddle_serving_app/reader') + os.system('cp ../core/preprocess/nvdec-extractframe/libhwextract.so ./paddle_serving_app/reader') + os.system('cp ../core/preprocess/hwvideoframe/cuda/libgpu.so ./paddle_serving_app/reader/lib') + os.system('cp ../core/preprocess/nvdec-extractframe/cuda/libhwgpu.so ./paddle_serving_app/reader/lib') + os.system('cp -a -i ../../core/preprocess/nvdec-extractframe/lib/* ./paddle_serving_app/reader/lib') + os.system('export LD_LIBRARY_PATH="./paddle_serving_app/reader/lib"') REQUIRED_PACKAGES = [ 'six >= 1.10.0', 'sentencepiece', 'opencv-python<=4.2.0.32', 'pillow',