MCPcopy Create free account
hub / github.com/HYUNJS/SGT / __init__

Method __init__

projects/Datasets/Transforms/transform.py:10–22  ·  view source on GitHub ↗
(self, fraction, S_rand, V_rand, format='BGR')

Source from the content-addressed store, hash-verified

8
9class HueTransform(Transform):
10 def __init__(self, fraction, S_rand, V_rand, format='BGR'):
11 super().__init__()
12 self._set_attributes(locals())
13 if format == 'BGR':
14 cvt_format_in = cv2.COLOR_BGR2HSV
15 cvt_format_out = cv2.COLOR_HSV2BGR
16 elif format == 'RGB':
17 cvt_format_in = cv2.COLOR_RGB2HSV
18 cvt_format_out = cv2.COLOR_HSV2RGB
19 else:
20 raise Exception("Image format only accepts BGR and RGB")
21 self.cvt_format_in = cvt_format_in
22 self.cvt_format_out = cvt_format_out
23
24 def apply_coords(self, coords):
25 return coords

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected