MCPcopy
hub / github.com/triple-mu/YOLOv8-TensorRT / blob

Function blob

models/utils.py:40–50  ·  view source on GitHub ↗
(im: ndarray, return_seg: bool = False)

Source from the content-addressed store, hash-verified

38
39
40def blob(im: ndarray, return_seg: bool = False) -> ndarray | tuple:
41 seg = None
42 if return_seg:
43 seg = im.astype(np.float32) / 255
44 im = im.transpose([2, 0, 1])
45 im = im[np.newaxis, ...]
46 im = np.ascontiguousarray(im).astype(np.float32) / 255
47 if return_seg:
48 return im, seg
49 else:
50 return im
51
52
53def sigmoid(x: ndarray) -> ndarray:

Callers 7

test_blob_return_segFunction · 0.90
preprocessFunction · 0.90
preprocessFunction · 0.90
preprocessFunction · 0.90
preprocessFunction · 0.90
preprocessFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_blob_return_segFunction · 0.72