mirror of
https://github.com/facefusion/facefusion-labs.git
synced 2026-06-25 07:59:55 +02:00
Introduce usage ration to boost datasets (#81)
* Introduce usage rate to boost datasets * Rename to usage ratio
This commit is contained in:
@@ -31,6 +31,7 @@ file_pattern = .datasets/vggface2/**/*.jpg
|
||||
convert_template = vggfacehq_512_to_arcface_128
|
||||
transform_size = 256
|
||||
usage_mode = both
|
||||
usage_ratio = 1
|
||||
batch_mode = same
|
||||
batch_ratio = 0.2
|
||||
```
|
||||
|
||||
@@ -3,6 +3,7 @@ file_pattern =
|
||||
convert_template =
|
||||
transform_size =
|
||||
usage_mode =
|
||||
usage_ratio =
|
||||
batch_mode =
|
||||
batch_ratio =
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ def prepare_datasets(config_parser : ConfigParser) -> List[Dataset[Tensor]]:
|
||||
for config_section in config_parser.sections():
|
||||
|
||||
if config_section.startswith('training.dataset'):
|
||||
config_usage_ratio = config_parser.getint(config_section, 'usage_ratio')
|
||||
__config_parser__ = deepcopy(config_parser)
|
||||
__config_parser__.remove_section(config_section)
|
||||
__config_parser__.add_section('training.dataset.current')
|
||||
@@ -215,7 +216,8 @@ def prepare_datasets(config_parser : ConfigParser) -> List[Dataset[Tensor]]:
|
||||
for key, value in config_parser.items(config_section):
|
||||
__config_parser__.set('training.dataset.current', key, value)
|
||||
|
||||
datasets.append(DynamicDataset(__config_parser__))
|
||||
dynamic_dataset = DynamicDataset(__config_parser__)
|
||||
datasets.extend([ dynamic_dataset ] * config_usage_ratio)
|
||||
|
||||
return datasets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user