Merge branch 'master' into python-10

This commit is contained in:
Oleksandr Chychkan
2022-02-22 21:04:36 -08:00
committed by GitHub
18 changed files with 174 additions and 10 deletions
+31
View File
@@ -0,0 +1,31 @@
# This workflow warns and then closes issues and PRs that have had no activity for a specified amount of time.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/actions/stale
name: Mark stale issues and pull requests
on:
schedule:
- cron: '45 14 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: -1
days-before-issue-stale: 30
days-before-close: -1
days-before-issue-close: 45
stale-issue-message: 'The issue is tagged as "stale issue" due to no activity in 30 days. If there is no activity for 15 more days, the issue will be closed.'
stale-issue-label: 'stale issue'
close-issue-message: 'Closing this issue due to no activity in last 45 days'
+7
View File
@@ -4,6 +4,10 @@ This project provides scripts inspired by [DeepFaceLab_Linux](https://github.com
You'll need `git`, `ffmpeg`, `python3` and python module `virtualenv` available to be able to execute these scripts. The scripts will create a virtual env sandbox and will install all necessary dependencies there, so your main installation of `python3` will be left intact.
## NOTE: Apple M1 chip
Currently there's limited support for Apple M1 laptops. You can do model training, but the XSeg editor currently does not work (the DeepFaceLab codebase is not compatible with PyQt6).
## Setup
**Tools**
@@ -14,6 +18,9 @@ Make sure you have installed:
- [Python 3](https://www.python.org/) (check with `python3 --version`)
- [Virtualenv](https://github.com/pypa/virtualenv) (check with `virtualenv --version`)
For **Apple M1** laptops you also need [hdf5](https://formulae.brew.sh/formula/hdf5) lib installed.
Check if you have it with `brew ls --versions hdf5`. Install it with `brew install hdf5`.
**Clone and setup**
1. Clone this repository (`git clone https://github.com/chychkan/DeepFaceLab_MacOS.git`)
+4 -3
View File
@@ -1,7 +1,7 @@
numpy==1.19.5
numpy==1.21.4
opencv-contrib-python-headless==4.1.2.30
scipy==1.7.1
tensorflow==2.6.0
scipy==1.7.2
tensorflow==2.7.0
colorama==0.4.4
tqdm==4.62.3
ffmpeg-python==0.2.0
@@ -9,3 +9,4 @@ Pillow==8.4.0
scikit-image==0.18.3
h5py==3.1.0
PyQt5==5.15.4
numexpr==2.7.3
+2 -1
View File
@@ -1,7 +1,7 @@
numpy==1.19.2
opencv-contrib-python-headless==4.1.2.30
scipy==1.5.4
tensorflow==2.6.0
tensorflow==2.6.1
colorama==0.4.4
tqdm==4.62.3
ffmpeg-python==0.2.0
@@ -9,3 +9,4 @@ Pillow==8.4.0
scikit-image==0.17.2
h5py==3.1.0
PyQt5==5.15.4
numexpr==2.7.3
+4 -3
View File
@@ -1,7 +1,7 @@
numpy==1.19.5
numpy==1.21.4
opencv-contrib-python-headless==4.5.1.48
scipy==1.7.1
tensorflow==2.6.0
scipy==1.7.2
tensorflow==2.7.0
colorama==0.4.4
tqdm==4.62.3
ffmpeg-python==0.2.0
@@ -9,3 +9,4 @@ Pillow==8.4.0
scikit-image==0.18.3
h5py==3.1.0
PyQt5==5.15.4
numexpr==2.7.3
+13
View File
@@ -0,0 +1,13 @@
numpy==1.21.4
opencv-python==4.5.5.62
numexpr==2.8.1
h5py==3.1.0
tqdm==4.62.3
colorama==0.4.4
cython==0.29.26
ffmpeg-python==0.2.0
Pillow==8.4.0
scikit-image==0.19.1
scipy==1.8.0
tensorflow-macos==2.7.0
PyQt6==6.2.3
+42 -3
View File
@@ -6,9 +6,19 @@ set -e
mkdir -p .dfl
mkdir -p workspace
is_arm64() {
[ "$(uname -m)" == "arm64" ]
}
is_arm64 && echo "Running on Apple M1 chip"
if [ ! -d .dfl/DeepFaceLab ]; then
echo "Cloning DeepFaceLab"
git clone --depth 1 "https://github.com/iperov/DeepFaceLab.git" .dfl/DeepFaceLab
git clone --no-single-branch --depth 1 "https://github.com/chychkan/DeepFaceLab.git" .dfl/DeepFaceLab
if is_arm64; then
(cd .dfl/DeepFaceLab; git checkout support-arm64)
fi
fi
if [ ! -d .dfl/env ]; then
@@ -17,14 +27,43 @@ fi
source .dfl/env/bin/activate
python -m pip install --upgrade pip
version=$(python -V | cut -f 2 -d ' ' | cut -f 1,2 -d .)
reqs_file='requirements.txt'
version_suffix=''
if [[ ! -z "$version" && -f "requirements_$version.txt" ]]; then
reqs_file="requirements_$version.txt"
version_suffix="_$version"
fi
architecture_suffix=''
if is_arm64 && [ -f "requirements${version_suffix}_arm64.txt" ]; then
architecture_suffix="_arm64"
fi
reqs_file="requirements${version_suffix}${architecture_suffix}.txt"
echo "Using $reqs_file for $(python -V)"
pip install -r $reqs_file
if is_arm64; then
if [[ -z "$(brew ls --versions hdf5)" ]]; then
echo "ERROR: HDF5 needs to be installed to run DeepFaceLab on M1 chip."
echo "You can install it with 'brew install hdf5'. For more details, see https://formulae.brew.sh/formula/hdf5"
echo "Once it is installed, run ./scripts/0_setup.sh again"
exit 1
fi
cython_pkg="$(cat $reqs_file | grep -E 'cython==.+')"
pip --no-cache-dir install "$cython_pkg"
numpy_pkg="$(cat $reqs_file | grep -E 'numpy==.+')"
pip install "$numpy_pkg"
h5py_pkg="$(cat $reqs_file | grep -E 'h5py==.+')"
HDF5_DIR="$(brew --prefix hdf5)" pip --no-cache-dir install --no-build-isolation "$h5py_pkg"
fi
pip --no-cache-dir install -r $reqs_file
echo "Done."
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg editor \
--input-dir "$WORKSPACE/data_dst/aligned"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg fetch \
--input-dir "$WORKSPACE/data_dst/aligned"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg remove_labels \
--input-dir "$WORKSPACE/data_dst/aligned"
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg apply \
--input-dir "$WORKSPACE/data_dst/aligned" \
--model-dir "$WORKSPACE/model"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg remove \
--input-dir "$WORKSPACE/data_dst/aligned"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg editor \
--input-dir "$WORKSPACE/data_src/aligned"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg fetch \
--input-dir "$WORKSPACE/data_src/aligned"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg remove_labels \
--input-dir "$WORKSPACE/data_src/aligned"
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg apply \
--input-dir "$WORKSPACE/data_src/aligned" \
--model-dir "$WORKSPACE/model"
+6
View File
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" xseg remove \
--input-dir "$WORKSPACE/data_src/aligned"
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
cd "$(dirname $0)/.."
source scripts/env.sh
python "$DFL_MAIN" train \
--training-data-src-dir "$WORKSPACE/data_src/aligned" \
--training-data-dst-dir "$WORKSPACE/data_dst/aligned" \
--model-dir "$WORKSPACE/model" \
--model XSeg