Open MubashirWaheed opened 1 month ago
Thanks for opening this issue, a maintainer will get back to you shortly!
@MubashirWaheed Where are you using WebGear and StreamGear APIs in your code? Can you provide the context for each of these APIs? I cannot understand how you're using them, and what is the flow (input - processing - output) of your Python script. If you can explain, that would be great.
@abhiTronix I want to integrate the vidgear library and specifically the streamgear
and webgear
apis in my code. The above shared code is the CustomSink
class. There are two main methods on the class infer
and on_prediction
. Inside the infer based on the detection model objects are detected. In the on_prediction callback I am processing the frame eg annotating the frames.
basically I want to display the stream of frames from the on_prediction
callback to the web page and to achieve this I want to integrate the webgear
and streamgear
APIs
Is there an example available for this?
I tried doing something like this
def main(
weight_path: str,
rtsp_url: str,
zone_configuration_path: str
// other params
) -> None:
sink = CustomSink(weights_path=weight_path, zone_configuration_path=zone_configuration_path, classes=classes)
// maybe I can use webgear like this?
// I tried but it does not work
web = WebGear(source=sink.on_prediction, logging=True)
pipeline = InferencePipeline.init_with_custom_logic(
video_reference=rtsp_url,
on_video_frame=sink.infer,
on_prediction=sink.on_prediction
)
here are the docs: https://inference.roboflow.com/using_inference/inference_pipeline/
Issue guidelines
Issue Checklist
Describe your Question
I checked docs and didn't find any example for my use case. I am getting a series of frames after processing and want to show them on the web. So basically a combination of streamgear and webgear. I am using the inference pipeline from roboflow so I can't yield frame like in opencv. I can'rt just pass the
on_prediction
to the webgear config as shown in the exampleYou can read here:https://inference.roboflow.com/using_inference/inference_pipeline/#usage
Terminal log output(Optional)
No response
Python Code(Optional)
VidGear Version
0.3.3
Python version
3.11.8
Operating System version
ubuntu
Any other Relevant Information?
No response