Skip to content

Commit

Permalink
improve setup script, reduce libs .so size (strip)
Browse files Browse the repository at this point in the history
  • Loading branch information
M4TH1EU committed Aug 4, 2024
1 parent 87e2d6d commit 59a5494
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
16 changes: 14 additions & 2 deletions build_alpr_api.sh
Original file line number Diff line number Diff line change
@@ -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
#!/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
2 changes: 2 additions & 0 deletions build_and_setup_ultimatealvr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flask
pillow
Pillow
ultimateAlprSdk

0 comments on commit 59a5494

Please sign in to comment.