MCPcopy Create free account
hub / github.com/aidlearning/AidLearning-FrameWork / _process_input

Function _process_input

src/mutilpose/posenet/utils.py:16–25  ·  view source on GitHub ↗
(source_img, scale_factor=1.0, output_stride=16)

Source from the content-addressed store, hash-verified

14
15
16def _process_input(source_img, scale_factor=1.0, output_stride=16):
17 target_width, target_height = valid_resolution(
18 source_img.shape[1] * scale_factor, source_img.shape[0] * scale_factor, output_stride=output_stride)
19 scale = np.array([source_img.shape[0] / target_height, source_img.shape[1] / target_width])
20
21 input_img = cv2.resize(source_img, (target_width, target_height), interpolation=cv2.INTER_LINEAR)
22 input_img = cv2.cvtColor(input_img, cv2.COLOR_BGR2RGB).astype(np.float32)
23 input_img = input_img * (2.0 / 255.0) - 1.0
24 input_img = input_img.reshape(1, target_height, target_width, 3)
25 return input_img, source_img, scale
26
27
28def read_cap(img, scale_factor=1.0, output_stride=16):

Callers 2

read_capFunction · 0.85
read_imgfileFunction · 0.85

Calls 1

valid_resolutionFunction · 0.85

Tested by

no test coverage detected