Shortcuts

Note

You are reading the documentation for MMEditing 0.x, which will soon be deprecated by the end of 2022. We recommend you upgrade to MMEditing 1.0 to enjoy fruitful new features and better performance brought by OpenMMLab 2.0. Check out the changelog, code and documentation of MMEditing 1.0 for more details.

Source code for mmedit.datasets.comp1k_dataset

# Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp

import mmcv

from .base_matting_dataset import BaseMattingDataset
from .registry import DATASETS


[docs]@DATASETS.register_module() class AdobeComp1kDataset(BaseMattingDataset): """Adobe composition-1k dataset. The dataset loads (alpha, fg, bg) data and apply specified transforms to the data. You could specify whether composite merged image online or load composited merged image in pipeline. Example for online comp-1k dataset: :: [ { "alpha": 'alpha/000.png', "fg": 'fg/000.png', "bg": 'bg/000.png' }, { "alpha": 'alpha/001.png', "fg": 'fg/001.png', "bg": 'bg/001.png' }, ] Example for offline comp-1k dataset: :: [ { "alpha": 'alpha/000.png', "merged": 'merged/000.png', "fg": 'fg/000.png', "bg": 'bg/000.png' }, { "alpha": 'alpha/001.png', "merged": 'merged/001.png', "fg": 'fg/001.png', "bg": 'bg/001.png' }, ] """
[docs] def load_annotations(self): """Load annotations for Adobe Composition-1k dataset. It loads image paths from json file. Returns: dict: Loaded dict. """ data_infos = mmcv.load(self.ann_file) for data_info in data_infos: for key in data_info: data_info[key] = osp.join(self.data_prefix, data_info[key]) return data_infos
Read the Docs v: latest
Versions
latest
stable
1.x
v0.16.0
v0.15.2
v0.15.1
v0.15.0
v0.14.0
v0.13.0
v0.12.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.