From 59a54945ff9c70796dc4cc8e00174540ad8e6c28 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Sun, 4 Aug 2024 20:36:34 +0200 Subject: [PATCH] improve setup script, reduce libs .so size (strip) --- build_alpr_api.sh | 16 ++++++++++++++-- build_and_setup_ultimatealvr.sh | 2 ++ requirements.txt | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/build_alpr_api.sh b/build_alpr_api.sh index bda2251..c5c0916 100755 --- a/build_alpr_api.sh +++ b/build_alpr_api.sh @@ -1,2 +1,14 @@ -pyinstaller --noconfirm --console --add-data libs:. --add-data assets:assets --add-data static:static --add-data templates:templates --name easy-local-alpr-1.4.0-openvinocpu_linux_x86_64 "alpr_api.py" -# optional: --onefile \ No newline at end of file +#!/bin/bash + +VERSION=1.5.0 + +rm -rf buildenv build dist *.spec +python3.10 -m venv buildenv +source buildenv/bin/activate +python3.10 -m pip install --upgrade pip pyinstaller +python3.10 -m pip install ./wheel/ultimateAlprSdk-3.0.0-cp310-cp310-linux_x86_64.whl +pip install -r requirements.txt + +pyinstaller --noconfirm --onefile --console --add-data libs:. --add-data assets:assets --add-data static:static --add-data templates:templates --name easy-local-alpr-$VERSION-openvinocpu_linux_x86_64 "alpr_api.py" +deactivate +rm -rf buildenv \ No newline at end of file diff --git a/build_and_setup_ultimatealvr.sh b/build_and_setup_ultimatealvr.sh index 5de5e38..5d4a3b6 100755 --- a/build_and_setup_ultimatealvr.sh +++ b/build_and_setup_ultimatealvr.sh @@ -155,6 +155,8 @@ mv "$BIN_DIR/dist/"*.whl "$BUILD_DIR" mv "$BIN_DIR/libs" "$BUILD_DIR" mv "$BIN_DIR/plugins.xml" "$BUILD_DIR/libs" +strip "$BUILD_DIR/libs"/*.so* + # Move the assets to the root directory mv "$SDK_DIR/assets" "$BUILD_DIR/assets" diff --git a/requirements.txt b/requirements.txt index ca97d7b..76dfac0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ flask -pillow +Pillow ultimateAlprSdk \ No newline at end of file