Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| df355d7b72 | |||
| 4a83e56dd9 | |||
| e4d0993da4 | |||
| 90dc16b81a | |||
| a1c6ebd2c6 | |||
| a3ab8d8b63 | |||
| cff388ea89 | |||
| cb5dbb53ec | |||
| 00c38c0bbc | |||
| 9bd56f3676 | |||
| 889af19a8d | |||
| be70ea702a | |||
| e8c28574ba | |||
| f5c2785d90 | |||
| 5e8e545290 | |||
| ad71977d83 | |||
| ab84544bcc | |||
| 8304db3da2 | |||
| b410297f6c | |||
| 3c5bd39f54 | |||
| c3d454d42c | |||
| 1279075260 | |||
| e2f58c8720 | |||
| 0a84ef8109 | |||
| 647239a43a | |||
| da9fce58bb | |||
| cbd95e41cc | |||
| cefee05b83 | |||
| fa8f1ba31c | |||
| 3a33c70ad4 | |||
| 7dcb9568c9 | |||
| 6bf4d54800 | |||
| 4686ceeb04 | |||
| b6c2ed848d | |||
| ff5c3f1f0b | |||
| a3f6898f49 | |||
| c660a1fc92 | |||
| 14cbc4aeff |
@@ -0,0 +1,12 @@
|
||||
# See https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "pip"
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
open-pull-requests-limit: 5
|
||||
pull-request-branch-name:
|
||||
separator: "-"
|
||||
reviewers:
|
||||
- "chychkan"
|
||||
@@ -0,0 +1,35 @@
|
||||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
||||
|
||||
name: Verify setup
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: macos-10.15
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python --version
|
||||
python -m pip install --upgrade pip
|
||||
python -m pip install virtualenv
|
||||
virtualenv --version
|
||||
- name: Run 0_setup.sh
|
||||
run: |
|
||||
./scripts/0_setup.sh
|
||||
@@ -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`)
|
||||
|
||||
+11
-9
@@ -1,10 +1,12 @@
|
||||
numpy==1.17.0
|
||||
opencv-python==4.1.0.25
|
||||
scipy==1.4.1
|
||||
tensorflow==1.15.2
|
||||
colorama==0.4.3
|
||||
tqdm==4.47.0
|
||||
numpy==1.21.4
|
||||
opencv-contrib-python-headless==4.1.2.30
|
||||
scipy==1.7.2
|
||||
tensorflow==2.7.4
|
||||
colorama==0.4.4
|
||||
tqdm==4.62.3
|
||||
ffmpeg-python==0.2.0
|
||||
Pillow==7.2.0
|
||||
scikit-image==0.17.2
|
||||
h5py==2.10.0
|
||||
Pillow==8.4.0
|
||||
scikit-image==0.18.3
|
||||
h5py==3.1.0
|
||||
PyQt5==5.15.4
|
||||
numexpr==2.7.3
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
numpy==1.22.2
|
||||
numexpr==2.8.1
|
||||
opencv-python==4.5.5.62
|
||||
scipy==1.8.0
|
||||
tensorflow==2.8.4
|
||||
colorama==0.4.4
|
||||
tqdm==4.62.3
|
||||
ffmpeg-python==0.2.0
|
||||
Pillow==8.4.0
|
||||
scikit-image==0.19.2
|
||||
h5py==3.6.0
|
||||
PyQt5==5.15.4
|
||||
@@ -0,0 +1,12 @@
|
||||
numpy==1.19.2
|
||||
opencv-contrib-python-headless==4.1.2.30
|
||||
scipy==1.5.4
|
||||
tensorflow==2.6.2
|
||||
colorama==0.4.4
|
||||
tqdm==4.62.3
|
||||
ffmpeg-python==0.2.0
|
||||
Pillow==8.4.0
|
||||
scikit-image==0.17.2
|
||||
h5py==3.1.0
|
||||
PyQt5==5.15.4
|
||||
numexpr==2.7.3
|
||||
@@ -0,0 +1,12 @@
|
||||
numpy==1.21.4
|
||||
opencv-contrib-python-headless==4.5.1.48
|
||||
scipy==1.7.2
|
||||
tensorflow==2.7.4
|
||||
colorama==0.4.4
|
||||
tqdm==4.62.3
|
||||
ffmpeg-python==0.2.0
|
||||
Pillow==8.4.0
|
||||
scikit-image==0.18.3
|
||||
h5py==3.1.0
|
||||
PyQt5==5.15.4
|
||||
numexpr==2.7.3
|
||||
@@ -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.11.0
|
||||
PyQt6==6.2.3
|
||||
+56
-3
@@ -1,13 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
cd "$(dirname $0)/.."
|
||||
|
||||
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"
|
||||
cd .dfl
|
||||
git clone "https://github.com/iperov/DeepFaceLab.git"
|
||||
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
|
||||
@@ -16,6 +27,48 @@ fi
|
||||
|
||||
source .dfl/env/bin/activate
|
||||
|
||||
pip install -r requirements.txt
|
||||
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
|
||||
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)"
|
||||
|
||||
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"
|
||||
elif [ "$version" == "3.10" ]; then
|
||||
(cd .dfl/DeepFaceLab; git checkout support-opencv45)
|
||||
|
||||
numpy_pkg="$(cat $reqs_file | grep -E 'numpy==.+')"
|
||||
pip install "$numpy_pkg"
|
||||
fi
|
||||
|
||||
pip --no-cache-dir install -r $reqs_file
|
||||
|
||||
echo "Done."
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
cd "$(dirname $0)/.."
|
||||
source scripts/env.sh
|
||||
|
||||
rm -fr "$WORKSPACE/data_src/*"
|
||||
rm -fr "$WORKSPACE/data_dst/*"
|
||||
rm -fr "$WORKSPACE/model/*"
|
||||
rm -fr $WORKSPACE/data_src/*
|
||||
rm -fr $WORKSPACE/data_dst/*
|
||||
rm -fr $WORKSPACE/model/*
|
||||
|
||||
Executable
+6
@@ -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"
|
||||
Executable
+6
@@ -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"
|
||||
Executable
+6
@@ -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
@@ -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
@@ -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"
|
||||
Executable
+6
@@ -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"
|
||||
Executable
+6
@@ -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"
|
||||
Executable
+6
@@ -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
@@ -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
@@ -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"
|
||||
Executable
+9
@@ -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
|
||||
@@ -2,3 +2,5 @@ DFL_MAIN=.dfl/DeepFaceLab/main.py
|
||||
WORKSPACE=workspace
|
||||
|
||||
source .dfl/env/bin/activate
|
||||
|
||||
set -e
|
||||
|
||||
Executable
+6
@@ -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"
|
||||
Reference in New Issue
Block a user