Hello,
I succeeded in deploying workflow on my raspberry pi as self-hosted server. I have connected USB camera to my Rasspberry Pi and it is running locally. I see information about detection in my terminal but I can not open livestream video on which there will be visible the zone,bounding boxes etc. How to do that?
I have tried to use code from other tutorials but I have failed.
For test I have used this tutorial and workflow: LINK
This is my standard code from roboflow:
from inference import InferencePipeline
import cv2
def my_sink(result, video_frame):
if result.get("output_image"): # Display an image from the workflow response
cv2.imshow("Workflow Image", result["output_image"].numpy_image)
cv2.waitKey(1)
# Do something with the predictions of each frame
print(result)
# 2. Initialize a pipeline object
pipeline = InferencePipeline.init_with_workflow(
api_key="***",
workspace_name="warehouse-test-mauta",
workflow_id="red-zone-monitoring",
video_reference=0, # Path to video, device id (int, usually 0 for built in webcams), or RTSP stream url
max_fps=30,
on_prediction=my_sink
)
# 3. Start the pipeline and wait for it to finish
pipeline.start()
pipeline.join()