Skip to content
Snippets Groups Projects
Commit b34ee7a6 authored by michael.divia's avatar michael.divia
Browse files

?

parent fb637e01
Branches
No related tags found
No related merge requests found
......@@ -55,12 +55,12 @@ with Hailo(hef_path) as hailo:
output_path = "/tmp/captured.png"
cv2.imwrite(output_path, frame)
os.system(f"feh --fullscreen {output_path}")
# --- 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)
# --- Preprocess (normalize + layout + batch) ---
image = frame.astype(np.float32) # Convert to float32
image -= [123.68, 116.779, 103.939] # Subtract ImageNet mean
image = np.transpose(image, (2, 0, 1)) # HWC → CHW
image = np.expand_dims(image, axis=0) # Add batch dimension
print("-- Running inference...")
inference_results = hailo.run(image)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment