MCPcopy Create free account
hub / github.com/D-Robotics/rdk_model_zoo / pre_process

Method pre_process

samples/vision/modnet/runtime/python/modnet.py:160–200  ·  view source on GitHub ↗

Convert a BGR image to float32 NCHW RGB input for hbm_runtime. The preprocessing pipeline: 1. BGR -> RGB 2. Normalize to [-1, 1]: ``(pixel - 127.5) / 127.5`` 3. Resize with padding to ``(ref_size, ref_size)`` 4. HWC -> NCHW, add batch dimension Args:

(
        self, image: np.ndarray
    )

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

predictMethod · 0.95

Calls 1

_resize_with_paddingMethod · 0.95

Tested by

no test coverage detected