diff --git a/scripts/environment.yaml b/scripts/environment.yaml new file mode 100644 index 0000000..80f65e4 --- /dev/null +++ b/scripts/environment.yaml @@ -0,0 +1,7 @@ +name: lama-cleaner +channels: + - defaults + - conda-forge +dependencies: + - conda + diff --git a/scripts/pack.sh b/scripts/pack.sh new file mode 100644 index 0000000..b44dccc --- /dev/null +++ b/scripts/pack.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +set -e + +export PYTHONNOUSERSITE=1 + +BUILD_DIST=lama-cleaner +BUILD_ENV=installer + +echo "Creating a distributable package.." + +source ~/miniconda3/etc/profile.d/conda.sh + +conda install -c conda-forge -y conda-pack + +conda env create --prefix $BUILD_ENV -f environment.yaml +conda activate ./$BUILD_ENV + +conda pack --n-threads -1 --prefix $BUILD_ENV --format tar + +mkdir -p ${BUILD_DIST}/$BUILD_ENV + +echo "Copy project file.." +chmod u+x start.sh +cp start.sh $BUILD_DIST + +cd $BUILD_DIST +tar -xf ../${BUILD_ENV}.tar -C $BUILD_ENV + +cd .. +rm -rf $BUILD_ENV +rm ${BUILD_ENV}.tar + +zip -r $BUILD_DIST.zip $BUILD_DIST + diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100755 index 0000000..d4d24c6 --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +source installer/bin/activate + +conda-unpack + +conda --version +git --version + +echo Using `which pip3` +pip3 install lama-cleaner + +# TODO: add model input prompt +lama-cleaner --device cpu --model lama