(bgr, ctx)
| 12 | |
| 13 | |
| 14 | def preprocess(bgr, ctx): |
| 15 | img, ratio, dwdh = letterbox(bgr, (ctx.width, ctx.height)) |
| 16 | rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB) |
| 17 | tensor = blob(rgb, return_seg=False) |
| 18 | return tensor, (ratio, dwdh) |
| 19 | |
| 20 | |
| 21 | def postprocess(data, meta, draw, ctx) -> bool: |