-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running workflow on local machine error #690
Comments
Hi there, This is just warning, for now you may not worry. Good that you are pointing this up, will be fixed soon 👍 |
I can't run in local machine because of this error. |
well, that's strange - I suspect there is other issue - could you elaborate more? |
Plse see below. My local computer just hang... (myenv) PS C:\Users\yeong> python demo_roboflow_workflow.py You may be able to resolve this warning by setting You may be able to resolve this warning by setting |
Could you verify the content of Additionally could you export |
I created a virtual env called myenv2 and did a pip install inference there. You may be able to resolve this warning by setting You may be able to resolve this warning by setting ''' |
ok, so this lines:
indicate issue with camera source. What is the setup you run the processing? |
I use my computer webcam |
Ok, From the error I get that you are running on Windows, right? Are you able to consume the camera feed using Opencv? |
i am running on windows. I can consume the camera feed using OpenCV. |
could you please show the script you use to start inference pipeline? |
Import the InferencePipeline objectfrom inference import InferencePipeline def my_sink(result, video_frame): https://app.roboflow.com/fish-laucn/workflows/edit/sahi-people-detection initialize a pipeline objectpipeline = InferencePipeline.init_with_workflow( |
masked your API key, but since you revealed it I strongly recommend rotating |
well - looks good here - are you sure the camera is under device 0? |
I mean does: import cv2
# Open the default camera
cam = cv2.VideoCapture(0)
print(cam.isOpened()) says true? |
(newenv) PS C:\Users\yeong> python
I had rotated my API key |
Ok, honestly I do not know why you cannot grab the video frames in inference pipeline. You can try to override video consumer for inference pipeline with this code: from typing import Any, Callable, Dict, List, Optional, Protocol, Tuple, Union
from inference.core.interfaces.camera.video_source import CV2VideoFrameProducer
class WindowsCV2VideoFrameProducer(CV2VideoFrameProducer):
def __init__(self, video: Union[str, int]):
if isinstance(video, int):
self.stream = cv2.VideoCapture(video, cv2.CAP_DSHOW)
else:
super().__init__(video) and then kick of inference pipeline with from functools import partial
pipeline = InferencePipeline.init_with_workflow(
api_key="xxx",
workspace_name="fish-laucn",
workflow_id="sahi-people-detection",
video_reference=partial(WindowsCV2VideoFrameProducer, video=0), # Path to video, device id (int, usually 0 for built in webcams), or RTSP stream url
max_fps=30,
on_prediction=my_sink
) |
Search before asking
Question
I tried running the below workflow on my local machine and get this error.
SAHI PEOPLE DETECTION:
https://app.roboflow.com/workflows/embed/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ3b3JrZmxvd0lkIjoicTdwQWRlb0xXR3Z5ZVo1RGFFaUoiLCJ3b3Jrc3BhY2VJZCI6ImtyT1RBYm5jRmhvUU1DZExPbGU0IiwidXNlcklkIjoiSW1GTElaU2tHYk55OXpiNFV1cWxNelBScHBRMiIsImlhdCI6MTcyNDgwNzA2M30.Ds34vuWm6zS3zHuozZzAGcgoktqHoRjKvC50MSppS0w
UserWarning: Field "model_type" in BlockManifest has conflict with protected namespace "model_".
You may be able to resolve this warning by setting
model_config['protected_namespaces'] = ()
.UserWarning: Field "model_version" in BlockManifest has conflict with protected namespace "model_".
Additional
No response
The text was updated successfully, but these errors were encountered: