diff --git a/python/pokedex_rpi.py b/python/pokedex_rpi.py index cc31896de81e93a901c343828590d2961d3e4ebe..34dca023eeeb731aa9817d3c5033d6087edc1c73 100644 --- a/python/pokedex_rpi.py +++ b/python/pokedex_rpi.py @@ -58,8 +58,9 @@ with Hailo(hef_path) as hailo: # --- Preprocess image --- image = frame.astype(np.float32) / 255.0 # Normalize to [0, 1] - image = np.expand_dims(image, axis=0) # Add batch dimension - image = np.transpose(image, (0, 3, 1, 2)) # NHWC ? NCHW if required (check your model) + image = np.expand_dims(image, axis=0) # Add batch dimension → (1, H, W, C) + image = np.transpose(image, (0, 3, 1, 2)) # NHWC → NCHW + image = np.ascontiguousarray(image) # Ensure buffer is C-contiguous print("-- Running inference...")