mirror of
https://github.com/iperov/DeepFaceLab.git
synced 2025-07-06 04:52:13 -07:00
update FANSeg
This commit is contained in:
parent
6f4ea69d4d
commit
18d93376fc
4 changed files with 61 additions and 17 deletions
|
@ -27,6 +27,7 @@ class SampleGeneratorFace(SampleGeneratorBase):
|
|||
output_sample_types=[],
|
||||
add_sample_idx=False,
|
||||
generators_count=4,
|
||||
raise_on_no_data=True,
|
||||
**kwargs):
|
||||
|
||||
super().__init__(samples_path, debug, batch_size)
|
||||
|
@ -42,8 +43,12 @@ class SampleGeneratorFace(SampleGeneratorBase):
|
|||
samples = SampleLoader.load (SampleType.FACE, self.samples_path)
|
||||
self.samples_len = len(samples)
|
||||
|
||||
self.initialized = False
|
||||
if self.samples_len == 0:
|
||||
raise ValueError('No training data provided.')
|
||||
if raise_on_no_data:
|
||||
raise ValueError('No training data provided.')
|
||||
else:
|
||||
return
|
||||
|
||||
index_host = mplib.IndexHost(self.samples_len)
|
||||
|
||||
|
@ -66,7 +71,13 @@ class SampleGeneratorFace(SampleGeneratorBase):
|
|||
SubprocessGenerator.start_in_parallel( self.generators )
|
||||
|
||||
self.generator_counter = -1
|
||||
|
||||
|
||||
self.initialized = True
|
||||
|
||||
#overridable
|
||||
def is_initialized(self):
|
||||
return self.initialized
|
||||
|
||||
def __iter__(self):
|
||||
return self
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue