nehulagrawal commited on
Commit
983d232
1 Parent(s): 44d7314

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -28
README.md CHANGED
@@ -113,34 +113,16 @@ model.overrides['max_det'] = 1000 # maximum number of detections per image
113
 
114
  # initialize video capture
115
  # Open the video file
116
- video_path = "path/to/your/video/file.mp4"
117
- cap = cv2.VideoCapture(video_path)
118
-
119
- # Loop through the video frames
120
- while cap.isOpened():
121
- # Read a frame from the video
122
- success, frame = cap.read()
123
-
124
- if success:
125
- # Run YOLOv8 inference on the frame
126
- results = model(frame)
127
-
128
- # Visualize the results on the frame
129
- annotated_frame = results[0].plot()
130
-
131
- # Display the annotated frame
132
- cv2.imshow("YOLOv8 Inference", annotated_frame)
133
-
134
- # Break the loop if 'q' is pressed
135
- if cv2.waitKey(1) & 0xFF == ord("q"):
136
- break
137
- else:
138
- # Break the loop if the end of the video is reached
139
- break
140
-
141
- # Release the video capture object and close the display window
142
- cap.release()
143
- cv2.destroyAllWindows()
144
  ```
145
 
146
  ## Training Details
 
113
 
114
  # initialize video capture
115
  # Open the video file
116
+ # set image
117
+ image = '/path/to/your/document/images'
118
+
119
+ # perform inference
120
+ results = model.predict(image)
121
+
122
+ # observe results
123
+ print(results[0].boxes)
124
+ render = render_result(model=model, image=image, result=results[0])
125
+ render.show()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  ```
127
 
128
  ## Training Details