Closed jakubkotecki6 closed 1 month ago
👋 Hello @jakubkotecki6, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.
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.
Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.
Pip install the ultralytics
package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.
pip install ultralytics
YOLOv8 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 Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.
Hello @jakubkotecki6,
Thank you for reaching out and providing a detailed description of the issue you're facing. It seems like you're encountering a problem when trying to detect objects using your thermal camera with specific frame dimensions and frame rate settings.
To better assist you, could you please verify the following:
From your description, it appears that the model is defaulting to sample images (bus.jpg
and zidane.jpg
) from the Ultralytics assets directory. This might happen if the input frame is not being read correctly or if there's an issue with the video capture setup.
Here are a few suggestions to troubleshoot and potentially resolve the issue:
Check Video Capture Initialization: Ensure that the video capture device is correctly initialized and that frames are being read properly.
if not cap.isOpened():
print("Could not open video device")
exit()
Verify Frame Read: Add a check to ensure that frames are being read correctly before passing them to the model.
while True:
ret, frame = cap.read()
if not ret:
print("Failed to read frame")
break
# Perform object detection on the frame
results = model.predict(frame, save=True, show=True, conf=0.15)
cv2.imshow("frame", frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()
Set Correct Frame Dimensions: Ensure that the frame dimensions and frame rate are set correctly and supported by your camera.
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 256)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 192)
cap.set(cv2.CAP_PROP_FPS, 50)
Debugging: Print out the frame dimensions and type to ensure they are as expected.
print(f"Frame dimensions: {frame.shape}")
print(f"Frame type: {type(frame)}")
If the issue persists after these checks, please provide any additional error messages or logs that might help us diagnose the problem further.
Feel free to reach out with any more details or questions. We're here to help!
👋 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
YOLOv8 Component
Predict
Bug
I have this problem when i try to detect objects on my thermal camera. To make it run proparely I need to change frame height, width and rate, but when i input this frame into model.predict(), it displays 1 frame then goes to miniconda3\Lib\site-packages\ultralytics\assets\ and picks up bus.jpg and zidane.jpg, then breaks down. Also when i run it on my regular webcam it does the same thing. Is there any solution to run detection on set frame height/width/rate?
https://github.com/ultralytics/ultralytics/assets/113249947/1e1a7885-7bfc-4fcb-95d5-42653cdb0b39
Environment
No response
Minimal Reproducible Example
from ultralytics import YOLO import cv2
model = YOLO("yolov10n.pt")
cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 256) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 192) cap.set(cv2.CAP_PROP_FPS, 50)
if not (cap.isOpened()): print("Could not open video device")
while True: ret, frame = cap.read()
Additional
No response
Are you willing to submit a PR?