Closed stuartcrobinson closed 6 months ago
👋 Hello @stuartcrobinson, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.
If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.
Python>=3.8.0 with all requirements.txt installed including PyTorch>=1.8. To get started:
git clone https://github.com/ultralytics/yolov5 # clone
cd yolov5
pip install -r requirements.txt # install
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training, validation, inference, export and benchmarks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
We're excited to announce the launch of our latest state-of-the-art (SOTA) object detection model for 2023 - YOLOv8 🚀!
Designed to be fast, accurate, and easy to use, YOLOv8 is an ideal choice for a wide range of object detection, image segmentation and image classification tasks. With YOLOv8, you'll be able to quickly and accurately detect objects in real-time, streamline your workflows, and achieve new levels of accuracy in your projects.
Check out our YOLOv8 Docs for details and get started with:
pip install ultralytics
fwiw i get the same thing for yolov8, following the guide:
stuart@mypi:~ $ source .venv/bin/activate
(.venv) stuart@mypi:~ $ python
Python 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ultralytics import YOLO
>>>
>>> model = YOLO('yolov8n.pt')
Downloading https://github.com/ultralytics/assets/releases/download/v0.0.0/yolov8n.pt to 'yolov8n.pt'...
100%|██████████████████████████████████████| 6.23M/6.23M [00:00<00:00, 12.4MB/s]
>>>
>>>
>>> results = model('tcp://127.0.0.1:8888', stream=True)
>>>
>>>
>>> while True:
... for result in results:
... boxes = result.boxes
... probs = result.probs
...
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/home/stuart/.venv/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 35, in generator_context
response = gen.send(None)
^^^^^^^^^^^^^^
File "/home/stuart/.venv/lib/python3.11/site-packages/ultralytics/engine/predictor.py", line 241, in stream_inference
self.setup_source(source if source is not None else self.args.source)
File "/home/stuart/.venv/lib/python3.11/site-packages/ultralytics/engine/predictor.py", line 216, in setup_source
self.dataset = load_inference_source(source=source,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/stuart/.venv/lib/python3.11/site-packages/ultralytics/data/build.py", line 166, in load_inference_source
dataset = LoadStreams(source, imgsz=imgsz, vid_stride=vid_stride, buffer=buffer)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/stuart/.venv/lib/python3.11/site-packages/ultralytics/data/loaders.py", line 92, in __init__
raise ConnectionError(f'{st}Failed to open {s}')
ConnectionError: 1/1: tcp://127.0.0.1:8888... Failed to open tcp://127.0.0.1:8888
>>>
stuart@mypi:~ $ source .venv/bin/activate
(.venv) stuart@mypi:~ $ libcamera-vid -n -t 0 --width 1280 --height 960 --framerate 1 --inline --listen -o tcp://127.0.0.1:8888
[0:00:53.163341819] [1947] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[0:00:53.177607551] [1950] INFO RPI pisp.cpp:653 libpisp version v1.0.2 fa44a258644a 22-11-2023 (21:59:22)
[0:00:53.196786487] [1950] INFO RPI pisp.cpp:1112 Registered camera /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a to CFE device /dev/media0 and ISP device /dev/media2 using PiSP variant BCM2712_C0
[0:02:04.510510919] [1947] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format Y16
[0:02:04.510557562] [1947] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format RGB6
[0:02:04.510569875] [1947] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format BGR6
[0:02:04.510584114] [1947] WARN V4L2 v4l2_pixelformat.cpp:338 Unsupported V4L2 pixel format PC1M
Mode selection for 1280:960:12:P(1)
SRGGB10_CSI2P,1536x864/120.135 - Score: 1422.67
SRGGB10_CSI2P,2304x1296/56.0255 - Score: 1506.67
SRGGB10_CSI2P,4608x2592/14.3536 - Score: 2406.67
Stream configuration adjusted
[0:02:04.510956221] [1947] INFO Camera camera.cpp:1183 configuring streams: (0) 1280x960-YUV420 (1) 1536x864-BGGR16_PISP_COMP1
[0:02:04.511068005] [1950] INFO RPI pisp.cpp:1396 Sensor: /base/axi/pcie@120000/rp1/i2c@88000/imx708@1a - Selected sensor format: 1536x864-SBGGR10_1X10 - Selected CFE format: 1536x864-PC1B
[NULL @ 0x5556266e4720] Unable to find a suitable output format for 'tcp://127.0.0.1:8888'
ERROR: *** libav: cannot allocate output context ***
(.venv) stuart@mypi:~ $
also the guide worked fine for me on a rpi4 using the same camera
isnt that because tcp just isnt supported?
@default-student hello! It looks like you're encountering an issue with the TCP stream setup on your Raspberry Pi 5. The error message from libcamera-vid
suggests that the output format for the TCP stream is not being recognized or supported.
The message Unable to find a suitable output format for 'tcp://127.0.0.1:8888'
indicates that the streaming command might not be correctly setting up the video stream for YOLOv5 or YOLOv8 to consume.
Please ensure that you have followed all the steps correctly and that the libcamera-vid
command is executed with the right parameters. Also, make sure that no other process is using the TCP port 8888 and that your firewall settings allow TCP connections on this port.
If the problem persists, you might want to try using a different method to provide the video stream to the model, such as using a file or a camera directly connected to the Raspberry Pi.
For further assistance, please refer to the Ultralytics Docs and consider opening an issue on the GitHub repository with the details of the error you're facing. The community and maintainers can help troubleshoot the problem more effectively there. Thank you for your contribution and for using YOLOv5! 🚀
👋 Hello there! We wanted to give you a friendly reminder that this issue has not had any recent activity and may be closed soon, but don't worry - you can always reopen it if needed. If you still have any questions or concerns, please feel free to let us know how we can help.
For additional resources and information, please see the links below:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLO 🚀 and Vision AI ⭐
Search before asking
YOLOv5 Component
Detection
Bug
re https://docs.ultralytics.com/guides/raspberry-pi/#quick-start-with-yolov5
brand new raspberry pi 5. followed the steps in that guide and got this:
libcamera-vid terminal window:
i installed the OS today using Raspberry Pi Imager v1.8.4 and selected bookworm 64-bit released 2023-12-5
libcamera-hello seems to work. displays video feed for a few seconds.
system info:
Environment
Minimal Reproducible Example
follow these steps to run yolov5 on a fresh rpi5 https://docs.ultralytics.com/guides/raspberry-pi/#quick-start-with-yolov5
Additional
No response
Are you willing to submit a PR?