From dc74b776b4e2385c8091b24be0f9c452a27b6bc8 Mon Sep 17 00:00:00 2001 From: Mathieu Broillet Date: Fri, 11 Jul 2025 16:30:37 +0200 Subject: [PATCH] optimized build script --- alpr_api.py | 4 ++-- build_alpr_api.sh | 2 +- build_and_setup_ultimatealvr.sh | 2 ++ templates/index.html | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/alpr_api.py b/alpr_api.py index 7439be0..13ecdf8 100644 --- a/alpr_api.py +++ b/alpr_api.py @@ -45,9 +45,9 @@ else: "openvino_enabled": True, "openvino_device": "CPU", "npu_enabled": False, - "klass_lpci_enabled": True, # License Plate Country Identification + "klass_lpci_enabled": False, # License Plate Country Identification "klass_vcr_enabled": False, # Vehicle Color Recognition (paid) - "klass_vmmr_enabled": True, # Vehicle Make and Model Recognition + "klass_vmmr_enabled": False, # Vehicle Make and Model Recognition "klass_vbsr_enabled": False, # Vehicle Body Style Recognition (paid) "license_token_file": "", "license_token_data": "", diff --git a/build_alpr_api.sh b/build_alpr_api.sh index b05a81b..13b98f6 100755 --- a/build_alpr_api.sh +++ b/build_alpr_api.sh @@ -9,6 +9,6 @@ python3.10 -m pip install --upgrade pip pyinstaller python3.10 -m pip install ./wheel/ultimateAlprSdk-3.14.1-cp310-cp310-linux_x86_64.whl pip install -r requirements.txt -pyinstaller --noconfirm --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" +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 79d9d5a..d0d30ee 100755 --- a/build_and_setup_ultimatealvr.sh +++ b/build_and_setup_ultimatealvr.sh @@ -168,6 +168,8 @@ mv "$BIN_DIR/plugins.xml" "$BUILD_DIR/libs" # Move the assets to the root directory mv "$SDK_DIR/assets" "$BUILD_DIR/assets" +# Removes unused models (only keeps TensorFlow and OpenVINO basic license plat recognition) +rm -Rf "$BUILD_DIR/assets/images" "$BUILD_DIR/assets/models.amlogic_npu" "$BUILD_DIR/assets/models.tensorrt" $BUILD_DIR/assets/models/ultimateALPR-SDK_klass* $BUILD_DIR/assets/models/ultimateALPR-SDK_*mobile* $BUILD_DIR/assets/models/*korean* $BUILD_DIR/assets/models/*chinese* $BUILD_DIR/assets/models/ultimateALPR-SDK_recogn1x100* $BUILD_DIR/assets/models/ultimateALPR-SDK_recogn1x200* $BUILD_DIR/assets/models/ultimateALPR-SDK_recogn1x300* $BUILD_DIR/assets/models/ultimateALPR-SDK_recogn1x400* $BUILD_DIR/assets/models.openvino/ultimateALPR-SDK_klass* # Deactivate and clean up the build virtual environment echo "Deactivating and cleaning up virtual environment..." diff --git a/templates/index.html b/templates/index.html index fbc8bf4..6dfbd03 100644 --- a/templates/index.html +++ b/templates/index.html @@ -132,7 +132,7 @@
-