MCPcopy Index your code
hub / github.com/PaddlePaddle/PaddleDetection / to_array

Method to_array

deploy/python/clrnet_postprocess.py:80–92  ·  view source on GitHub ↗
(self, sample_y_range, img_w, img_h)

Source from the content-addressed store, hash-verified

78 return lane_xs
79
80 def to_array(self, sample_y_range, img_w, img_h):
81 self.sample_y = range(sample_y_range[0], sample_y_range[1],
82 sample_y_range[2])
83 sample_y = self.sample_y
84 img_w, img_h = img_w, img_h
85 ys = np.array(sample_y) / float(img_h)
86 xs = self(ys)
87 valid_mask = (xs >= 0) & (xs < 1)
88 lane_xs = xs[valid_mask] * img_w
89 lane_ys = ys[valid_mask] * img_h
90 lane = np.concatenate(
91 (lane_xs.reshape(-1, 1), lane_ys.reshape(-1, 1)), axis=1)
92 return lane
93
94 def __iter__(self):
95 return self

Callers 1

visualizeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected