(bgr, ctx)
| 5 | |
| 6 | |
| 7 | def 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 | |
| 14 | def postprocess(data, meta, draw, ctx) -> bool: |