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

Function preprocess

models/tasks/cls.py:7–11  ·  view source on GitHub ↗
(bgr, ctx)

Source from the content-addressed store, hash-verified

5
6
7def preprocess(bgr, ctx):
8 img = cv2.resize(bgr, (ctx.width, ctx.height))
9 rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
10 tensor = blob(rgb, return_seg=False)
11 return tensor, None
12
13
14def postprocess(data, meta, draw, ctx) -> bool:

Callers

nothing calls this directly

Calls 1

blobFunction · 0.90

Tested by

no test coverage detected