Shortcuts

mmagic.datasets.transforms.values

Module Contents

Classes

CopyValues

Copy the value of source keys to destination keys.

SetValues

Set value to destination keys.

class mmagic.datasets.transforms.values.CopyValues(src_keys, dst_keys)[source]

Bases: mmcv.transforms.BaseTransform

Copy the value of source keys to destination keys.

# TODO Change to dict(dst=src)

It does the following: results[dst_key] = results[src_key] for (src_key, dst_key) in zip(src_keys, dst_keys).

Added keys are the keys in the attribute “dst_keys”.

Required Keys:

  • [SRC_KEYS]

Added Keys:

  • [DST_KEYS]

Parameters
  • src_keys (list[str]) – The source keys.

  • dst_keys (list[str]) – The destination keys.

transform(results)[source]

transform function.

Parameters

results (dict) – A dict containing the necessary information and data for augmentation.

Returns

A dict with a key added/modified.

Return type

dict

__repr__()[source]

Return repr(self).

class mmagic.datasets.transforms.values.SetValues(dictionary)[source]

Bases: mmcv.transforms.BaseTransform

Set value to destination keys.

It does the following: results[key] = value

Added keys are the keys in the dictionary.

Required Keys:

  • None

Added or Modified Keys:

  • keys in the dictionary

Parameters

dictionary (dict) – The dictionary to update.

transform(results: Dict)[source]

transform function.

Parameters

results (dict) – A dict containing the necessary information and data for augmentation.

Returns

A dict with a key added/modified.

Return type

dict

__repr__()[source]

Return repr(self).

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.