Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from deepfakes:master #161

Open
wants to merge 313 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
313 commits
Select commit Hold shift + click to select a range
3b95c3c
Update python 3.7 pins
torzdf Aug 2, 2022
c79ed76
re-pin Tensorflow Probability
torzdf Aug 2, 2022
997db77
pin max numpy version to 1.22.x
torzdf Aug 2, 2022
6cd3012
Revert "pin max numpy version to 1.22.x"
torzdf Aug 2, 2022
629c02a
Add "custom" mask
torzdf Aug 5, 2022
26dde3c
Add CPU option to BiSeNet and MTCNN
torzdf Aug 8, 2022
39ac1f5
setup.py - Fix AMD conflicts
torzdf Aug 10, 2022
ee25a31
bugfix: setup.py - Fix issue with Conda AMD install
torzdf Aug 12, 2022
c0d0f04
bufix: mask plugin: Fix error when no mask is selected
torzdf Aug 18, 2022
73111dd
Minor updates:
torzdf Aug 19, 2022
3295089
lib.detected_face.Mask
torzdf Aug 19, 2022
a2de4a9
lib.align.aligned_face updates
torzdf Aug 19, 2022
5e73437
lib.align updates:
torzdf Aug 19, 2022
2beceff
Data Augmentation update (#1263)
torzdf Aug 21, 2022
5ad580c
Update README.md
torzdf Aug 21, 2022
e9bac5d
typofix
torzdf Aug 22, 2022
66845ea
bugfix: Alignments - Thumbnail generation check
torzdf Aug 22, 2022
0837273
bugfix: CV2 error on previews
torzdf Aug 22, 2022
76dbc4c
bugfix: setup.py
torzdf Aug 23, 2022
1919366
setup.py - cleanup installers
torzdf Aug 23, 2022
b288771
typofix: setup.py
torzdf Aug 23, 2022
9e503bd
bugfix: debug landmarks
torzdf Aug 23, 2022
326110f
bugfix - timelapse image loader
torzdf Aug 25, 2022
9bd86eb
setup - Exit with errorcode if any packages failed
torzdf Aug 26, 2022
1022651
Bugfix: convert - Gif Writer
torzdf Aug 26, 2022
58926e9
Typofix: tools.preview
torzdf Aug 26, 2022
04b197e
convert: reduce RAM consumption
torzdf Aug 27, 2022
2a7c18a
bugfixes:
torzdf Aug 28, 2022
0507726
utils.debug_time - thread support
torzdf Aug 28, 2022
f3b88d5
bugfix: Get correct output size for learn mask
torzdf Aug 29, 2022
fe8e34f
bugfix: Generator for AMD
torzdf Aug 29, 2022
de1068b
Bugfix: Preview - show predictions at correct size
torzdf Aug 30, 2022
97da625
typing fix
torzdf Aug 30, 2022
13cfb3f
extract: Add batch processing mode
torzdf Aug 31, 2022
dc18c74
Bugfix: Preview for extract in batch mode
torzdf Sep 1, 2022
477e3e2
bugfix: Train: Toggle mask when 'learn_mask' is selected
torzdf Sep 2, 2022
8fdb856
Bugfix: Display preview image in gui
torzdf Sep 2, 2022
ae7793e
bugfix: convert - Process final items on truncated batch
torzdf Sep 2, 2022
c60aca8
bugfix - gui extract preview on batch mode
torzdf Sep 7, 2022
681b775
bugfix: preview color order for RGB models
torzdf Sep 7, 2022
7da2cc3
Training - Use custom preview pop-out
torzdf Sep 7, 2022
89d124c
Sort - Add Batch Mode. Speed up yaw sort
torzdf Sep 7, 2022
6985495
sort - lower log level
torzdf Sep 7, 2022
42a010b
bugfix: Windows Mousewheel in preview
torzdf Sep 7, 2022
98d0176
Overhaul sort:
torzdf Sep 13, 2022
952d799
Bugfixes:
torzdf Sep 13, 2022
2d312a9
Minor updates and fixups
torzdf Sep 14, 2022
8a803e2
bugfix: Suppress OMP error on CPU Windows version
torzdf Sep 18, 2022
a8f22cc
Extract updates:
torzdf Sep 18, 2022
5ba07ea
bugfix: Extract - don't put empty batches through aligner
torzdf Sep 18, 2022
f5fa5b4
Extract filter: Allow saving of filtered images
torzdf Sep 18, 2022
71726c1
Extract: Add metric information to debug images
torzdf Sep 19, 2022
50d2379
Aligner filter - set sensible defaults
torzdf Sep 21, 2022
de11b4c
Bugfix: Extract. numbering issue when binning results
torzdf Sep 23, 2022
892d862
Bugfix: Alignments tool - don't error on from-faces job
torzdf Sep 23, 2022
1c8eb24
Bugfix: Correct naming of alignments file for videos with dots in fil…
torzdf Sep 23, 2022
a7d0898
sort tool: Add sort by roll
torzdf Sep 23, 2022
8776e21
Extract: Add roll filter to aligner filters
torzdf Sep 23, 2022
fba2e6e
Bugfix: Alignments tool sorting error in 'from-faces'
torzdf Sep 23, 2022
376c419
Bugfix: Manual tool. Explicitly disable aligner filters
torzdf Sep 24, 2022
e5356a4
Alignments update:
torzdf Sep 25, 2022
9e23f83
Bugfix: sort. Don't error on callback in SortMulti
torzdf Sep 25, 2022
e2a77e7
Alignments Tool - Typing, Documentation + Re-org
torzdf Sep 26, 2022
5805d76
alignments tool - Remove-face - Minor update
torzdf Sep 26, 2022
c79175c
Alignments Tool updates
torzdf Sep 26, 2022
220335f
bugfix: Extract: Add video_meta to alignments dict
torzdf Sep 26, 2022
765e385
Extract: Typing and standardization
torzdf Sep 30, 2022
856067b
typofix: tools.mask
torzdf Sep 30, 2022
6f48d7f
Phaze-A - Sym384 Preset
torzdf Oct 1, 2022
1f31af2
bugfix: Aligner size filter to int64
torzdf Oct 4, 2022
f1e3339
Add vggface2 to extraction pipeline
torzdf Oct 10, 2022
403f981
bugfix: Catch learn-mask error when no mask type selected
torzdf Oct 12, 2022
a061290
typing: lib.gui.popup_session
torzdf Oct 12, 2022
8910ae5
bugfix: fix gui initialization too early
torzdf Oct 12, 2022
47867a0
typing: lib.gui.analysis.stats
torzdf Oct 13, 2022
f32f460
Refactoring
torzdf Oct 15, 2022
a7c3159
docs update
torzdf Oct 16, 2022
dab823a
Typing - lib.gui.display_command
torzdf Oct 17, 2022
2e8ef5e
GUI - Preview updates
torzdf Oct 20, 2022
d1a7f7a
bugfix: Don't error if preview unsuccessfully read
torzdf Oct 23, 2022
1d1face
Update Face Filter
torzdf Oct 31, 2022
bfaa465
Bugfix - Alignments tool. Use full path when updating png header
torzdf Nov 1, 2022
0f5d2e8
Face-filter updates:
torzdf Nov 4, 2022
128a4d0
Merge branch 'staging'
torzdf Nov 4, 2022
cb8ec69
Aligner updates
torzdf Nov 8, 2022
23857be
Merge branch 'staging'
torzdf Nov 8, 2022
c698f45
Aligner - Add feature position filter
torzdf Nov 8, 2022
113b7d7
Aligner filters bugfixes
torzdf Nov 9, 2022
b27331c
Merge branch 'staging'
torzdf Nov 9, 2022
e3b4576
bugfix - extract filters: spaces in folder names
torzdf Nov 10, 2022
2da1f67
Merge branch 'staging'
torzdf Nov 10, 2022
f4c738d
Reduce LPIPS strength by factor of 10
torzdf Nov 14, 2022
1145b46
Merge branch 'staging'
torzdf Nov 14, 2022
9e2026f
Extract: Implement re-align/2nd pass
torzdf Nov 22, 2022
5fec189
Merge branch 'staging'
torzdf Nov 22, 2022
2faef58
Bugfix - Extract - re-align with identity filtering enabled
torzdf Nov 22, 2022
ffe8f9a
Merge branch 'staging'
torzdf Nov 22, 2022
01b0320
Update _requirements_base.txt
torzdf Dec 15, 2022
8c63b7a
Merge branch 'staging'
torzdf Dec 15, 2022
48c886b
Allow decoding errors
torzdf Dec 18, 2022
6913e42
Merge branch 'staging'
torzdf Dec 18, 2022
ac6bda7
bugfix: Mask tool, fix faces input type
torzdf Dec 19, 2022
dd64ed5
Merge branch 'staging'
torzdf Dec 19, 2022
84ae600
Bugfix - TF Version check
torzdf Dec 19, 2022
d1e09f7
Merge branch 'staging'
torzdf Dec 19, 2022
eefffe2
Bugfix: AMD. Pin numpy, matplotlib and numexpr
torzdf Dec 20, 2022
ef55d24
Merge branch 'staging'
torzdf Dec 20, 2022
d750af1
bump TF to version 2.10
torzdf Dec 20, 2022
ddedb52
Update tests for tf2.10
torzdf Dec 20, 2022
bcef3b4
Merge branch 'staging'
torzdf Dec 20, 2022
dc94ed9
DirectML Support (#1291)
torzdf Jan 6, 2023
2f16f8a
Bugfix - Phaze-A, monkeypatch EfficientNet for MixedPrecision
torzdf Jan 7, 2023
0dbeafb
bugfix: sysinfo
torzdf Jan 9, 2023
edd7e52
docs: typofix
torzdf Jan 9, 2023
c455601
Linux - ROCm (AMD) support
torzdf Jan 11, 2023
28cb2fc
Unhide options for ROCm
torzdf Jan 11, 2023
80f6328
Bugfixes
torzdf Jan 13, 2023
34b5584
bugfix:
torzdf Jan 17, 2023
110f53d
bugfix - skip tkinter unit tests
torzdf Jan 17, 2023
798e591
unit test updates
torzdf Jan 17, 2023
e2d84be
bugfix: - Alignment tool - remove faces:
torzdf Jan 18, 2023
1d19aea
bugfix - numexpr. ignore OMP_NUM_THREADS EnvVar
torzdf Jan 18, 2023
c474858
bugfix: Alignments tool - remove faces:
torzdf Jan 18, 2023
eaa33ae
Korean translations added (#1287)
DonOhhhh Jan 18, 2023
4f79ea4
bugfix: macos - raise tensorflow-metal max version
torzdf Jan 19, 2023
a1ef5ed
tests:
torzdf Jan 21, 2023
b4212de
bugfix: pin numpy
torzdf Feb 3, 2023
8a5ee6d
Bugfix: Patch extract memory leak in batch mode
torzdf Feb 10, 2023
4a5a109
Bugfix: Disable batch mode patch for non-Linux machines
torzdf Feb 10, 2023
757088f
bugfix: Linux installer -cpu mode
torzdf Feb 11, 2023
2028579
Preview - Allow mask color/opacity configuration
torzdf Feb 13, 2023
6fd57f0
bugfix: OrderedDict type for python<3.9
torzdf Feb 13, 2023
7887703
bugfix - Colorchooser fixes
torzdf Feb 13, 2023
0c1d1e3
Bugfix: Color order on preview with learn_mask
torzdf Feb 14, 2023
74f4b6f
Bugfix: Preview fail on input size > output size
torzdf Feb 16, 2023
f2c1086
bugfix: Prevent settings popup from stealing focus
torzdf Feb 19, 2023
637dc3b
bugfix - utils unit test
torzdf Feb 20, 2023
cd929e0
bugfix: preview tool unit test
torzdf Feb 20, 2023
cd94b7e
Mask tool update:
torzdf Feb 20, 2023
d0a8d59
mask tool: Add batch-mode
torzdf Feb 20, 2023
a076afa
bugfix: mask tool memory leak in batch-mode
torzdf Feb 21, 2023
ec95c19
alignments tool - Add batch mode
torzdf Feb 24, 2023
216ef38
alignments tool - batch jobs to run in process
torzdf Feb 24, 2023
e2ad3e2
add ru locale (#1311)
andentze Apr 27, 2023
013f301
bugfix: Locales for Windows
torzdf Jun 6, 2023
50a5113
locales: Add GUI menu translations
torzdf Jun 7, 2023
a66214c
locales: Add global extract settings
torzdf Jun 8, 2023
02239d4
locales: Train settings
torzdf Jun 11, 2023
77723a6
bugfix: config encoding - force to utf-8
torzdf Jun 12, 2023
4e58bcd
ClipFaker (#4)
bryanlyon Jun 14, 2023
ac8206e
bugfix: Extract - rotation in detection
torzdf Jun 15, 2023
e0eda1c
bugfix: Extract memory leak
torzdf Jun 16, 2023
8f08832
Fixed UnicodeDecodeError (#1316)
che3000 Jun 16, 2023
e8a3016
create even more RU translations (#1322)
andentze Jun 17, 2023
82e927d
bugfix: Preview tool Don't error if too few images
torzdf Jun 18, 2023
03f5c67
Remove plaidML support (#1325)
torzdf Jun 21, 2023
c3f38bf
bugfix: Windows installer - venv creation
torzdf Jun 21, 2023
a903a55
bugfix: Correctly read event data in GUI
torzdf Jun 21, 2023
e4ba12a
tests: Fix event-reader test
torzdf Jun 21, 2023
6a3b674
Rebase code (#1326)
torzdf Jun 27, 2023
4819d5b
bugfixes:
torzdf Jun 27, 2023
dd03aa8
setup.py: Revert redundant conda check
torzdf Jun 27, 2023
caa97d2
bugfix: Sphjinx Requirements
torzdf Jun 27, 2023
bb532c6
typofix: sphinx_requirements.txt
torzdf Jun 27, 2023
adc96b7
bugfix: Sphinx Requirements
torzdf Jun 27, 2023
efa4471
typing:
torzdf Jun 28, 2023
4b20316
bugfix: manual tool - alignments saving
torzdf Jun 28, 2023
99fd844
bugfix: plugins.aligner - predict dtype
torzdf Jun 28, 2023
467ff6b
bugfix: Handle dtype change for cv2-dnn aligner
torzdf Jun 28, 2023
b870c7d
typofix
torzdf Jun 28, 2023
ce86d09
bugfix: git communication fixes
torzdf Jun 30, 2023
4e7e5fe
bugfix: graph pop-up - log/linear switching
torzdf Jun 30, 2023
8fb96b0
mask tool: log and exit if batch not using folder
torzdf Jun 30, 2023
f4c912e
bugfix: GUI force stdout/stderr reading to utf-8
torzdf Jun 30, 2023
2bf529a
bugfix: Optimizer save error on older models
torzdf Jun 30, 2023
c22e105
bugfix: setup.py - fix logic ordering
torzdf Jun 30, 2023
1bcc151
bugfix: lib.gui.wrapper - Allow errors in stdout
torzdf Jul 1, 2023
93d5a1a
bugfix: DirectML backend GPU stats
torzdf Jul 6, 2023
efbbe55
bugfix: Pillow version pinning
torzdf Jul 6, 2023
c39a77f
bugfix: setup.py pull in zlib-wapi on nvidia windows
torzdf Jul 6, 2023
6a3b4ed
Training fixes:
torzdf Jul 8, 2023
c4204c7
Updates:
torzdf Jul 8, 2023
fb7084e
Merge branch 'clip' into clip3
torzdf Jul 8, 2023
c34756c
fixes
torzdf Jul 11, 2023
1786d7a
Merge pull request #1330 from torzdf/clip3
torzdf Jul 11, 2023
12814ce
bugfix: Manual tool - face filtering
torzdf Jul 12, 2023
31eff9c
macos fixes
torzdf Jul 14, 2023
81e3bf5
Merge pull request #1331 from torzdf/macos
torzdf Jul 14, 2023
0bba6ff
bugfix: train - fix occasional mem leak in preview
torzdf Aug 6, 2023
68a3322
bugfix: train - fix learn_mask training
torzdf Aug 9, 2023
cf0efff
Learning Rate finder (#1341)
torzdf Aug 22, 2023
5d00025
bugfix: error loading images with special chars
torzdf Aug 27, 2023
603fdc2
Phaze A - Allow outputs divisible by 16
torzdf Sep 1, 2023
460a229
bugfix: edge case NaN in pose estimation
torzdf Sep 1, 2023
4588adb
remove debug code
torzdf Sep 1, 2023
8388241
bugfix: Always load images as 3 channel color
torzdf Sep 1, 2023
48aca14
bugfix: LR finder. Reset optimizer state
torzdf Sep 8, 2023
a660eda
Convert: Add face scale option
torzdf Sep 9, 2023
e80ae04
Convert - Patch writer (#1352)
torzdf Sep 28, 2023
f23c87c
bugfix: Preview tool regression
torzdf Sep 29, 2023
3336772
bugfix: patch writer - remove hard coded values
torzdf Sep 30, 2023
8e6c6c3
patch writer: Sort the json file by key
torzdf Oct 4, 2023
4557331
bugfix: Preview in GUI when converting to vid/gif
torzdf Oct 24, 2023
a62a85c
bugfix: setup.py - Force pip for imagio-ffmpeg
torzdf Nov 17, 2023
b72b730
setup.py:
torzdf Jan 5, 2024
2a38451
bugfix: Convert - patch writer. Fix TIFF metadata
torzdf Jan 7, 2024
b25f484
bugfix: Patch writer - handle filenames which are only numeric
torzdf Jan 10, 2024
dea021c
bugfix - setup.py
torzdf Jan 12, 2024
d1dfce8
setup.py - fix ldconfig errors
torzdf Mar 1, 2024
7a16f75
Add Mask importing to the mask tool (#1376)
torzdf Mar 12, 2024
23944c3
Update requirements
torzdf Mar 12, 2024
af95dbb
Bugfix: mask tool. Prevent hangiing when input is folder of frames
torzdf Mar 13, 2024
63b4d91
Bugfix: Mask tool - correctly name imported mask
torzdf Mar 18, 2024
1009254
logging
torzdf Mar 20, 2024
1d3c59c
Bugfix: Extract error on rotate faces
torzdf Mar 20, 2024
9ddc838
Bugfix: Correct loss labels when graphing
torzdf Mar 20, 2024
aaa63ff
bugfix: logger, don't import numpy unless required
torzdf Mar 21, 2024
180fe97
lib.training - Outpu useful error message if non-faceswap training im…
torzdf Mar 22, 2024
2b08b8d
typofix: tools.manual lower loglevel for mask removal
torzdf Mar 25, 2024
4502824
Add mask dilation/erosion option for training
torzdf Mar 26, 2024
97a8421
lib.align.aligned_face - Add split_mask method
torzdf Apr 3, 2024
a9d87ae
linting: Remove pylint hint for logger
torzdf Apr 3, 2024
9839014
linting: Reduce Class min-public-methods and fix spacing
torzdf Apr 3, 2024
70c064c
Minor fixups and linting
torzdf Apr 3, 2024
ab8199e
linting + typing
torzdf Apr 3, 2024
64a7b58
bugfix: setup/sysinfo - Don't look for files in non-existant path
torzdf Apr 3, 2024
95b4431
Deprecate multi-character cli switches
torzdf Apr 5, 2024
b1caa03
Fix tests for new cli switches
torzdf Apr 6, 2024
118e615
bugfix: tests - change -it switch to -i
torzdf Apr 6, 2024
1c081ae
Add ability to export and import alignment data (#1383)
torzdf Apr 15, 2024
3d5b962
linting: typo-fix
torzdf Apr 16, 2024
957734d
convert: Bugfix: Update legacy .png video alignments to include video…
torzdf Apr 17, 2024
ec2a95a
tests: Fix alignment tool process_video test
torzdf Apr 17, 2024
3f69d9f
manual tool: bugfx: don't error when getting mesh for non-existant face
torzdf Apr 17, 2024
d75898f
Bugfixes for video file alignments storage:
torzdf Apr 18, 2024
2bad105
bugfix: Alignment tool, auto-detect alignments
torzdf Apr 19, 2024
96528ee
lib.align.detected_face: Split Mask objects to own aligned_mask module
torzdf Apr 19, 2024
dce7d98
lib.align: Split lib.align.alignments to smaller modules:
torzdf Apr 19, 2024
696692d
Fixups
torzdf Apr 21, 2024
be42b04
Bugfix: Alignment file video key lookup for very old alignment files
torzdf Apr 21, 2024
0f94779
bugfix: Alignments remove version check for video file extension update
torzdf Apr 21, 2024
13dd5b3
bugfix: Alignments - correctly update keys for multiple underscores i…
torzdf Apr 26, 2024
8c3bc39
bugfix: Patch writer. Correctly split frame number from the end of fi…
torzdf May 10, 2024
1f4fcff
bugfix: Alignments, prevent duplicate backup alignment file names
torzdf May 19, 2024
c8652ec
Training preview: Correctly display blur/kernel amount on mask
torzdf Jun 2, 2024
ea63f1e
Mask tool. Add ability to output custom imported masks
torzdf Jun 28, 2024
b6ac7b8
bugfix: Manual tool. Allow working with image folders at EEN values > 1
torzdf Jul 5, 2024
3f53ee9
Bugfix: Convert - Correctly error if a valid mask has not been selected
torzdf Aug 2, 2024
6fe300e
pin numpy to < 2.0
torzdf Aug 2, 2024
cbaad14
Bugfix: Linux installer - pin git to < 2.45
torzdf Aug 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
161 changes: 161 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: ci/build

on:
push:
pull_request:
paths-ignore:
- docs/**
- "**/README.md"

jobs:
build_conda:
name: conda (${{ matrix.os }}, ${{ matrix.backend }})
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
backend: ["nvidia", "cpu"]
include:
- os: "ubuntu-latest"
backend: "rocm"
- os: "windows-latest"
backend: "directml"
steps:
- uses: actions/checkout@v3
- name: Set cache date
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to manually reset cache
CACHE_NUMBER: 1
REQ_FILE: ./requirements/requirements_${{ matrix.backend }}.txt
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-${{ matrix.backend }}-conda-${{ env.CACHE_NUMBER }}-${{ env.DATE }}-${{ hashFiles('./requirements/requirements.txt', env.REQ_FILE) }}
- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: "3.10"
auto-update-conda: true
activate-environment: faceswap
- name: Conda info
run: conda info && conda list
- name: Install
run: |
python setup.py --installer --${{ matrix.backend }}
pip install flake8 pylint mypy pytest pytest-mock wheel pytest-xvfb
pip install types-attrs types-cryptography types-pyOpenSSL types-PyYAML types-setuptools
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --select=E9,F63,F7,F82 --show-source
flake8 . --exit-zero
- name: MyPy Typing
continue-on-error: true
run: |
mypy .
- name: SysInfo
run: python -c "from lib.sysinfo import sysinfo ; print(sysinfo)"
- name: Simple Tests
# These backends will fail as GPU drivers not available
if: matrix.backend != 'rocm' && matrix.backend != 'nvidia' && matrix.backend != 'directml'
run: |
FACESWAP_BACKEND="${{ matrix.backend }}" py.test -v tests/;
- name: End to End Tests
# These backends will fail as GPU drivers not available
# macOS fails on first extract test with 'died with <Signals.SIGSEGV: 11>'
if: matrix.backend != 'rocm' && matrix.backend != 'nvidia' && matrix.backend != 'directml' && matrix.os != 'macos-latest'
run: |
FACESWAP_BACKEND="${{ matrix.backend }}" python tests/simple_tests.py;

build_linux:
name: "pip (ubuntu-latest, ${{ matrix.backend }})"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
backend: ["cpu"]
include:
- backend: "cpu"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: './requirements/requirements_${{ matrix.backend }}.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pylint mypy pytest pytest-mock pytest-xvfb wheel
pip install types-attrs types-cryptography types-pyOpenSSL types-PyYAML types-setuptools
pip install -r ./requirements/requirements_${{ matrix.backend }}.txt
- name: List installed packages
run: pip freeze
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --select=E9,F63,F7,F82 --show-source
# exit-zero treats all errors as warnings.
flake8 . --exit-zero
- name: MyPy Typing
continue-on-error: true
run: |
mypy .
- name: Simple Tests
run: |
FACESWAP_BACKEND="${{ matrix.backend }}" py.test -v tests/;
- name: End to End Tests
run: |
FACESWAP_BACKEND="${{ matrix.backend }}" python tests/simple_tests.py;

build_windows:
name: "pip (windows-latest, ${{ matrix.backend }})"
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10"]
backend: ["cpu", "directml"]
include:
- backend: "cpu"
- backend: "directml"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: './requirements/requirements_${{ matrix.backend }}.txt'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pylint mypy pytest pytest-mock wheel
pip install types-attrs types-cryptography types-pyOpenSSL types-PyYAML types-setuptools
pip install -r ./requirements/requirements_${{ matrix.backend }}.txt
- name: List installed packages
run: pip freeze
- name: Set Backend EnvVar
run: echo "FACESWAP_BACKEND=${{ matrix.backend }}" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --select=E9,F63,F7,F82 --show-source
# exit-zero treats all errors as warnings.
flake8 . --exit-zero
- name: MyPy Typing
continue-on-error: true
run: |
mypy .
- name: Simple Tests
run: py.test -v tests
- name: End to End Tests
run: python tests/simple_tests.py
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
!/update_deps.py

# Support files
!_travis/
!_travis/*.py
!/.github/
!/.github/workflows/
!/.github/workflows/*.yml
!.install/
!.install/**
!config/
Expand All @@ -35,11 +36,13 @@
!tests/**/*.py

# Core files
!.fs_cache
!lib/
!lib/**/
!lib/**/*.py
!lib/gui/**/icons/*.png
!lib/gui/**/themes/default.json
!lib/gui/**/presets/**/*.json
!plugins/
!plugins/**/
!plugins/**/*.py
Expand Down
34 changes: 26 additions & 8 deletions .install/linux/faceswap_setup_x64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DIR_CONDA="$HOME/miniconda3"
CONDA_EXECUTABLE="${DIR_CONDA}/bin/conda"
CONDA_TO_PATH=false
ENV_NAME="faceswap"
PYENV_VERSION="3.9"
PYENV_VERSION="3.10"

DIR_FACESWAP="$HOME/faceswap"
VERSION="nvidia"
Expand All @@ -35,6 +35,13 @@ info () {
done <<< "$(echo "$1" | fmt -cu -w 70)"
}

warn () {
# output warning message
while read -r line ; do
echo -e "\e[33mWARNING\e[97m $line"
done <<< "$(echo "$1" | fmt -cu -w 70)"
}

error () {
# output error message.
while read -r line ; do
Expand Down Expand Up @@ -127,11 +134,11 @@ ask_version() {
# Ask which version of faceswap to install
while true; do
default=1
read -rp $'\e[36m'"Select: 1 (NVIDIA), 2 (AMD), 3 (CPU) [default: $default]: "$'\e[97m' vers
read -rp $'\e[36mSelect:\t1: NVIDIA\n\t2: AMD (ROCm)\n\t3: CPU\n'"[default: $default]: "$'\e[97m' vers
vers="${vers:-${default}}"
case $vers in
1) VERSION="nvidia" ; break ;;
2) VERSION="amd" ; PYENV_VERSION="3.8" ; break ;;
2) VERSION="rocm" ; break ;;
3) VERSION="cpu" ; break ;;
* ) echo "Invalid selection." ;;
esac
Expand Down Expand Up @@ -259,7 +266,7 @@ conda_opts () {
echo ""
info "Faceswap will be installed inside a Conda Environment. If an environment already\
exists with the name specified then it will be deleted."
ask "Please specify a name for the Faceswap Conda Environmnet" "ENV_NAME"
ask "Please specify a name for the Faceswap Conda Environment" "ENV_NAME"
}

faceswap_opts () {
Expand All @@ -273,6 +280,12 @@ faceswap_opts () {
latest graphics card drivers installed from the relevant vendor. Please select the version\
of Faceswap you wish to install."
ask_version
if [ $VERSION == "rocm" ] ; then
warn "ROCm support is experimental. Please make sure that your GPU is supported by ROCm and that \
ROCm has been installed on your system before proceeding. Installation instructions: \
https://docs.amd.com/bundle/ROCm_Installation_Guidev5.0/page/Overview_of_ROCm_Installation_Methods.html"
sleep 2
fi
}

post_install_opts() {
Expand Down Expand Up @@ -309,6 +322,10 @@ review() {
fi
echo " - Faceswap will be installed in '$DIR_FACESWAP'"
echo " - Installing for '$VERSION'"
if [ $VERSION == "rocm" ] ; then
echo -e " \e[33m- Note: Please ensure that ROCm is supported by your GPU\e[97m"
echo -e " \e[33m and is installed prior to proceeding.\e[97m"
fi
if $DESKTOP ; then echo " - A Desktop shortcut will be created" ; fi
if ! ask_yesno "Do you wish to continue?" "No" ; then exit ; fi
}
Expand Down Expand Up @@ -346,7 +363,7 @@ delete_env() {
}

create_env() {
# Create Python 3.8 env for faceswap
# Create Python 3.10 env for faceswap
delete_env
info "Creating Conda Virtual Environment..."
yellow ; "$CONDA_EXECUTABLE" create -n "$ENV_NAME" -q python="$PYENV_VERSION" -y
Expand All @@ -363,7 +380,9 @@ activate_env() {
install_git() {
# Install git inside conda environment
info "Installing Git..."
yellow ; conda install git -q -y
# TODO On linux version 2.45.2 makes the font fixed TK pull in Python from
# graalpy, which breaks pretty much everything
yellow ; conda install "git<2.45" -q -y
}

delete_faceswap() {
Expand All @@ -384,8 +403,7 @@ clone_faceswap() {
setup_faceswap() {
# Run faceswap setup script
info "Setting up Faceswap..."
if [ $VERSION != "cpu" ] ; then args="--$VERSION" ; else args="" ; fi
python "$DIR_FACESWAP/setup.py" --installer $args
python -u "$DIR_FACESWAP/setup.py" --installer --$VERSION
}

create_gui_launcher () {
Expand Down
Binary file added .install/macos/app.zip
Binary file not shown.
Loading