nehulagrawal
commited on
Commit
•
983d232
1
Parent(s):
44d7314
Update README.md
Browse files
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 |
-
|
117 |
-
|
118 |
-
|
119 |
-
#
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
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
|