MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / NoOpTransform

Class NoOpTransform

PATH/core/data/transforms/seg_aug_dev.py:135–155  ·  view source on GitHub ↗

A transform that does nothing.

Source from the content-addressed store, hash-verified

133
134
135class NoOpTransform(Transform):
136 """
137 A transform that does nothing.
138 """
139
140 def __init__(self):
141 super().__init__()
142
143 def apply_image(self, img: np.ndarray) -> np.ndarray:
144 return img
145
146 def apply_coords(self, coords: np.ndarray) -> np.ndarray:
147 return coords
148
149 def inverse(self) -> Transform:
150 return self
151
152 def __getattr__(self, name: str):
153 if name.startswith("apply_"):
154 return lambda x: x
155 raise AttributeError("NoOpTransform object has no attribute {}".format(name))
156
157
158class CropTransform(Transform):

Callers 9

inverseMethod · 0.90
get_transformMethod · 0.90
__call__Method · 0.90
get_transformMethod · 0.90
get_transformMethod · 0.90
get_transformMethod · 0.90
tta_mapperMethod · 0.90
get_transformMethod · 0.85
get_transformMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected