Added methods to the dataloader to automatically generate controls for line, mask, inpainting, depth, and pose.

This commit is contained in:
Jaret Burkett
2025-04-09 13:35:04 -06:00
parent 615b0d0e94
commit 96ba2fd129
5 changed files with 205 additions and 11 deletions

View File

@@ -687,6 +687,7 @@ class SliderConfig:
self.targets.append(target)
print(f"Built {len(self.targets)} slider targets (with permutations)")
ControlTypes = Literal['depth', 'line', 'pose', 'inpaint', 'mask']
class DatasetConfig:
"""
@@ -803,6 +804,13 @@ class DatasetConfig:
# debug the frame count and frame selection. You dont need this. It is for debugging.
self.debug: bool = kwargs.get('debug', False)
# automatic controls
self.controls: List[ControlTypes] = kwargs.get('controls', [])
if isinstance(self.controls, str):
self.controls = [self.controls]
# remove empty strings
self.controls = [control for control in self.controls if control.strip() != '']
def preprocess_dataset_raw_config(raw_config: List[dict]) -> List[dict]: