mirror of
https://github.com/facefusion/facefusion-labs.git
synced 2026-05-22 23:59:40 +02:00
2e6394565a
* add sync batchnorm * replace random.choice with hash * fifty percent reduction * fix discriminator input * restore dataset.py * Remove duplicates * add discriminator_ratio to config * fix onnx export bug: replace round() with int() * Fix embedding naming * Introduce ModelWithConfigCheckpoint callback (#86) * Fix dist ini * Style: Refactor typing and improve code clarity in training.py (#88) * Add type casting for trainer params * Add type casting for trainer params * Add type casting for trainer params * Remove inplace activations for torch.compile compatibility (#89) * Fix README * improvise with norm layers & weighted average * add skip layer * use gelu instead of leaky_relu * cleanup * cleanup * Update dependencies * Different defaults and enable validation * Different defaults and enable validation * Revert to higher batch size * Just use copy over copy2 --------- Co-authored-by: harisreedhar <h4harisreedhar.s.s@gmail.com> Co-authored-by: NeuroDonu <112660822+NeuroDonu@users.noreply.github.com> Co-authored-by: Harisreedhar <46858047+harisreedhar@users.noreply.github.com>
105 lines
1.4 KiB
Markdown
105 lines
1.4 KiB
Markdown
CrossFace
|
|
=========
|
|
|
|
> Seamless face embedding across various models.
|
|
|
|

|
|
|
|
|
|
Preview
|
|
-------
|
|
|
|

|
|
|
|
|
|
Installation
|
|
------------
|
|
|
|
```
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
|
|
Setup
|
|
-----
|
|
|
|
This `config.ini` utilizes the MegaFace dataset to train the CrossFace model for SimSwap.
|
|
|
|
```
|
|
[training.dataset]
|
|
file_pattern = .datasets/megaface/**/*.jpg
|
|
```
|
|
|
|
```
|
|
[training.loader]
|
|
batch_size = 128
|
|
num_workers = 8
|
|
split_ratio = 0.95
|
|
```
|
|
|
|
```
|
|
[training.model]
|
|
source_path = .models/arcface_w600k_r50.pt
|
|
target_path = .models/arcface_simswap.pt
|
|
```
|
|
|
|
```
|
|
[training.trainer]
|
|
max_epochs = 4096
|
|
strategy = auto
|
|
precision = 16-mixed
|
|
```
|
|
|
|
```
|
|
[training.optimizer]
|
|
learning_rate = 0.001
|
|
```
|
|
|
|
```
|
|
[training.logger]
|
|
logger_path = .logs
|
|
logger_name = crossface_simswap
|
|
```
|
|
|
|
```
|
|
[training.output]
|
|
directory_path = .outputs
|
|
file_pattern = crossface_simswap_{epoch}_{step}
|
|
resume_path = .outputs/last.ckpt
|
|
```
|
|
|
|
```
|
|
[exporting]
|
|
directory_path = .exports
|
|
source_path = .outputs/last.ckpt
|
|
target_path = .exports/crossface_simswap.onnx
|
|
ir_version = 10
|
|
opset_version = 15
|
|
```
|
|
|
|
|
|
Training
|
|
--------
|
|
|
|
Train the model.
|
|
|
|
```
|
|
python train.py
|
|
```
|
|
|
|
Launch the TensorBoard to monitor the training.
|
|
|
|
```
|
|
tensorboard --logdir .logs
|
|
```
|
|
|
|
|
|
Exporting
|
|
---------
|
|
|
|
Export the model to ONNX.
|
|
|
|
```
|
|
python export.py
|
|
```
|