Replies: 1 comment
-
Your ESP32-CAM URL For ESP32-CAM streaming, try using the stream endpoint (usually import cv2
from ultralytics import YOLO
model = YOLO('best.pt')
url = 'https://stackoverflow.com/questions/37158506/errorconnection-to-http-192-xxx-xxx-xx8080-refused:81/stream' # Try stream endpoint
# For MJPEG stream
cap = cv2.VideoCapture(url)
while cap.isOpened():
success, frame = cap.read()
if success:
results = model(frame, conf=0.2, imgsz=320)
annotated_frame = results[0].plot()
cv2.imshow("ESP32-CAM", annotated_frame)
if cv2.waitKey(1) & 0xFF == ord("q"):
break
cap.release()
cv2.destroyAllWindows() Check your ESP32-CAM firmware documentation for the correct streaming endpoint URL and ensure it supports continuous video streaming rather than just single image capture. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I’m trying to use YOLOv8 with an ESP32-CAM. I want to stream video from the ESP32-CAM to a local server, and then run object detection using YOLOv8 in Python.
I wrote the following code:
However, the code doesn’t work as expected. I'm not very experienced in this area, so I’m not sure what I’m doing wrong. I assumed that the
predict()
function could take a video stream URL directly.My goal is to:
Am I trying to do too much considering the hardware limitations of the ESP32-CAM?
Should I approach this differently?
Any help or guidance would be greatly appreciated.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions