NaveenKumar5 commited on
Commit
4f922f4
·
verified ·
1 Parent(s): 85c5021

Create Yolov8n train.pt

Browse files
Files changed (1) hide show
  1. Yolov8n train.pt +24 -0
Yolov8n train.pt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ pip install inference
2
+
3
+ # Import the InferencePipeline object
4
+ from inference import InferencePipeline
5
+ import cv2
6
+
7
+ def my_sink(result, video_frame):
8
+ if result.get("output_image"): # Display an image from the workflow response
9
+ cv2.imshow("Workflow Image", result["output_image"].numpy_image)
10
+ cv2.waitKey(1)
11
+ print(result) # do something with the predictions of each frame
12
+
13
+
14
+ # initialize a pipeline object
15
+ pipeline = InferencePipeline.init_with_workflow(
16
+ api_key="dxkgGGHSZ3DI8XzVn29U",
17
+ workspace_name="naveen-kumar-hnmil",
18
+ workflow_id="detect-count-and-visualize-5",
19
+ video_reference=0, # Path to video, device id (int, usually 0 for built in webcams), or RTSP stream url
20
+ max_fps=30,
21
+ on_prediction=my_sink
22
+ )
23
+ pipeline.start() #start the pipeline
24
+ pipeline.join() #wait for the pipeline thread to finish