Shortcuts

mmagic.datasets.controlnet_dataset

Module Contents

Classes

ControlNetDataset

Demo dataset to test ControlNet. Modified from https://github.com/lllyas

class mmagic.datasets.controlnet_dataset.ControlNetDataset(ann_file: str = 'prompt.json', data_root: str = './data/fill50k', control_key='source', image_key='target', pipeline: List[Union[dict, Callable]] = [])[source]

Bases: mmengine.dataset.BaseDataset

Demo dataset to test ControlNet. Modified from https://github.com/lllyas viel/ControlNet/blob/16ea3b5379c1e78a4bc8e3fc9cae8d65c42511b1/tutorial_data set.py # noqa.

You can download the demo data from https://huggingface.co/lllyasviel/ControlNet/blob/main/training/fill50k.zip # noqa and then unzip the file to the data folder.

Parameters
  • ann_file (str) – Path to the annotation file. Defaults to ‘prompt.json’ as ControlNet’s default.

  • data_root (str) – Path to the data root. Defaults to ‘./data/fill50k’.

  • pipeline (list[dict | callable]) – A sequence of data transforms.

load_data_list() List[dict][source]

Load annotations from an annotation file named as self.ann_file

Returns

A list of annotation.

Return type

list[dict]

Read the Docs v: latest
Versions
latest
stable
0.x
Downloads
pdf
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.