2022-08-09 00:58:06 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
2022-09-10 23:24:22 -04:00
|
|
|
set -e
|
|
|
|
|
|
2022-08-09 00:58:06 -04:00
|
|
|
PYTHON_BINARY=$(which python3)
|
|
|
|
|
|
|
|
|
|
if [[ -z "$PYTHON_BINARY" ]]; then
|
|
|
|
|
echo "python3 not found. Searching for python instead."
|
|
|
|
|
PYTHON_BINARY=$(which python)
|
|
|
|
|
if [[ -z "$PYTHON_BINARY" ]]; then
|
|
|
|
|
echo "Python 3 must be available on your path. Exiting."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo "Creating venv"
|
|
|
|
|
"$PYTHON_BINARY" -m venv venv
|
|
|
|
|
|
|
|
|
|
source venv/bin/activate
|
|
|
|
|
|
|
|
|
|
echo "Installing packages"
|
2022-09-10 23:24:22 -04:00
|
|
|
pip install wheel # Make sure this is installed beforehand
|
2022-08-09 00:58:06 -04:00
|
|
|
|
|
|
|
|
pip install onnxruntime opencv-python==4.5.4.60 pillow numpy pyinstaller
|
|
|
|
|
|
|
|
|
|
echo "Creating binary"
|
2022-09-10 23:24:22 -04:00
|
|
|
pyinstaller --onedir --clean facetracker.py \
|
|
|
|
|
--add-binary venv/lib/python3.*/site-packages/onnxruntime/capi/*.so:onnxruntime/capi
|
2022-08-09 00:58:06 -04:00
|
|
|
|
|
|
|
|
echo "Files should be available in the dist/ folder"
|
|
|
|
|
echo "Done!"
|
|
|
|
|
|