Shortcuts

EditDataSample

class mmedit.structures.EditDataSample(*, metainfo: Optional[dict] = None, **kwargs)[source]

A data structure interface of MMEditing. They are used as interfaces between different components.

The attributes in EditDataSample are divided into several parts:

  • gt_img: Ground truth image(s).

  • pred_img: Image(s) of model predictions.

  • ref_img: Reference image(s).

  • mask: Mask in Inpainting.

  • trimap: Trimap in Matting.

  • gt_alpha: Ground truth alpha image in Matting.

  • pred_alpha: Predicted alpha image in Matting.

  • gt_fg: Ground truth foreground image in Matting.

  • pred_fg: Predicted foreground image in Matting.

  • gt_bg: Ground truth background image in Matting.

  • pred_bg: Predicted background image in Matting.

  • gt_merged: Ground truth merged image in Matting.

Examples:

 >>> import torch
 >>> import numpy as np
 >>> from mmedit.structures import EditDataSample, PixelData
 >>> data_sample = EditDataSample()
 >>> img_meta = dict(img_shape=(800, 1196, 3))
 >>> img = torch.rand((3, 800, 1196))
 >>> gt_img = PixelData(data=img, metainfo=img_meta)
 >>> data_sample.gt_img = gt_img
 >>> assert 'img_shape' in data_sample.gt_img.metainfo_keys()
<EditDataSample(

    META INFORMATION

    DATA FIELDS
    _gt_img: <PixelData(

            META INFORMATION
            img_shape: (800, 1196, 3)

            DATA FIELDS
            data: tensor([[[0.8069, 0.4279,  ..., 0.6603, 0.0292],

                        ...,

                        [0.8139, 0.0908,  ..., 0.4964, 0.9672]]])
        ) at 0x1f6ae000af0>
    gt_img: <PixelData(

            META INFORMATION
            img_shape: (800, 1196, 3)

            DATA FIELDS
            data: tensor([[[0.8069, 0.4279,  ..., 0.6603, 0.0292],

                        ...,

                        [0.8139, 0.0908,  ..., 0.4964, 0.9672]]])
        ) at 0x1f6ae000af0>
) at 0x1f6a5a99a00>
property ema: mmedit.structures.edit_data_sample.EditDataSample

This is the function to fetch ema results.

Returns

Results of the ema model.

Return type

EditDataSample

property fake_img: Union[mmedit.structures.pixel_data.PixelData, torch.Tensor]

This is the function to fetch fake_img.

Returns

The fake img.

Return type

Union[PixelData, Tensor]

property gt_alpha: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_alpha.

Returns

data element

Return type

PixelData

property gt_bg: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_bg.

Returns

data element

Return type

PixelData

property gt_fg: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_fg.

Returns

data element

Return type

PixelData

property gt_heatmap: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_heatmap.

Returns

data element

Return type

PixelData

property gt_img: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_img in PixelData.

Returns

data element

Return type

PixelData

property gt_label

This the function to fetch gt label.

Returns

gt label.

Return type

LabelData

property gt_merged: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_merged in PixelData.

Returns

_description_

Return type

PixelData

property gt_samples: mmedit.structures.edit_data_sample.EditDataSample

This is the function to fetch gt_samples.

Returns

gt samples.

Return type

EditDataSample

property gt_unsharp: mmedit.structures.pixel_data.PixelData

This is the function to fetch gt_unsharp in PixelData.

Returns

data element

Return type

PixelData

property img_lq: mmedit.structures.pixel_data.PixelData

This is the function to fetch img_lq in PixelData.

Returns

data element

Return type

PixelData

property mask: mmedit.structures.pixel_data.PixelData

This is the function to fetch mask.

Returns

data element

Return type

PixelData

property noise: torch.Tensor

This is the function to fetch noise.

Returns

noise.

Return type

torch.Tensor

property orig: mmedit.structures.edit_data_sample.EditDataSample

This is the function to fetch original results.

Returns

Results of the ema model.

Return type

EditDataSample

property pred_alpha: mmedit.structures.pixel_data.PixelData

This is the function to fetch pred_alpha.

Returns

data element

Return type

PixelData

property pred_bg: mmedit.structures.pixel_data.PixelData

This is the function to fetch pred_bg in PixelData.

Returns

data element

Return type

PixelData

property pred_fg: mmedit.structures.pixel_data.PixelData

This is the function to fetch pred_fg.

Returns

_description_

Return type

PixelData

property pred_heatmap: mmedit.structures.pixel_data.PixelData

This is the function to fetch pred_heatmap.

Returns

data element

Return type

PixelData

property pred_img: mmedit.structures.pixel_data.PixelData

This is the function to fetch pred_img in PixelData.

Returns

data element

Return type

PixelData

property ref_img: mmedit.structures.pixel_data.PixelData

This is the function to fetch ref_img.

Returns

data element

Return type

PixelData

property ref_lq: mmedit.structures.pixel_data.PixelData

This is the function to fetch ref_lq.

Returns

data element

Return type

PixelData

property sample_model: str

This is the function to fetch sample model.

Returns

Mode of Sample model.

Return type

str

set_gt_label(value: Union[numpy.ndarray, torch.Tensor, Sequence[numbers.Number], numbers.Number]) mmedit.structures.edit_data_sample.EditDataSample[source]

Set label of gt_label.

property trimap: mmedit.structures.pixel_data.PixelData

This is the function to fetch trimap.

Returns

data element

Return type

PixelData

Read the Docs v: zyh/doc-notfound-extend
Versions
master
latest
stable
zyh-doc-notfound-extend
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.