mirror of
https://github.com/facefusion/facefusion-labs.git
synced 2026-05-22 23:59:40 +02:00
117 lines
1.7 KiB
Markdown
117 lines
1.7 KiB
Markdown
Embedding Converter
|
|
===================
|
|
|
|
> Convert face embeddings between various models.
|
|
|
|

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

|
|
|
|
|
|
Installation
|
|
------------
|
|
|
|
```
|
|
pip install -r requirements.txt
|
|
```
|
|
|
|
|
|
Setup
|
|
-----
|
|
|
|
This `config.ini` utilizes the MegaFace dataset to train the Embedding Converter for SimSwap.
|
|
|
|
```
|
|
[preparing.dataset]
|
|
dataset_path = .datasets/megaface/train.rec
|
|
crop_size = 112
|
|
process_limit = 650000
|
|
```
|
|
|
|
```
|
|
[preparing.model]
|
|
source_path = .models/arcface_w600k_r50.onnx
|
|
target_path = .models/arcface_simswap.onnx
|
|
```
|
|
|
|
```
|
|
[preparing.input]
|
|
directory_path = .inputs
|
|
source_path = .inputs/arcface_w600k_r50.npy
|
|
target_path = .inputs/arcface_simswap.npy
|
|
```
|
|
|
|
```
|
|
[training.loader]
|
|
split_ratio = 0.8
|
|
batch_size = 51200
|
|
num_workers = 8
|
|
```
|
|
|
|
```
|
|
[training.trainer]
|
|
learning_rate = 0.001
|
|
max_epochs = 4096
|
|
```
|
|
|
|
```
|
|
[training.output]
|
|
directory_path = .outputs
|
|
file_pattern = arcface_converter_simswap_{epoch}_{step}
|
|
resume_file_path = .outputs/last.ckpt
|
|
```
|
|
|
|
```
|
|
[exporting]
|
|
directory_path = .exports
|
|
source_path = .outputs/last.ckpt
|
|
target_path = .exports/arcface_converter_simswap.onnx
|
|
ir_version = 10
|
|
opset_version = 15
|
|
```
|
|
|
|
```
|
|
[execution]
|
|
providers = CUDAExecutionProvider
|
|
```
|
|
|
|
|
|
Preparing
|
|
---------
|
|
|
|
Prepare the embedding dataset.
|
|
|
|
```
|
|
python prepare.py
|
|
```
|
|
|
|
|
|
Training
|
|
--------
|
|
|
|
Train the Embedding Converter model.
|
|
|
|
```
|
|
python train.py
|
|
```
|
|
|
|
Launch the TensorBoard to monitor the training.
|
|
|
|
```
|
|
tensorboard --logdir=.logs
|
|
```
|
|
|
|
|
|
Exporting
|
|
---------
|
|
|
|
Export the model to ONNX.
|
|
|
|
```
|
|
python export.py
|
|
```
|