Comments (8)
@mrortach hello,
Thank you for bringing this to our attention. To assist you effectively, could you please provide a minimum reproducible code example? This will help us replicate the issue on our end and investigate further. You can find guidelines on creating a reproducible example here: Minimum Reproducible Example.
Additionally, please ensure that you are using the latest versions of torch
and ultralytics
. Sometimes, performance issues can be resolved by updating these packages. You can upgrade them using the following commands:
pip install --upgrade torch ultralytics
Once you've updated the packages and provided the reproducible example, we can delve deeper into the issue. Your detailed observations and the steps you've already taken are very helpful, and we'll do our best to assist you in resolving this performance discrepancy.
Thank you for your cooperation and patience!
from ultralytics.
Yolov10 does not work with ultralytics.
(+)https://github.com/THU-MIG/yolov10.git
(-)pip install --upgrade torch ultralytics
import cv2
import torch
import numpy as np
import supervision as sv # type: ignore
from ultralytics import YOLOv10
print("Starting script...")
# Load the YOLOv10 model
model = YOLOv10("yolov10x.pt")
# Create annotators
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
# Create a VideoCapture object for the webcam
cap = cv2.VideoCapture(0) # Change the index if you have multiple cameras
if not cap.isOpened():
print("Unable to read camera feed")
exit()
while True:
ret, frame = cap.read()
if not ret:
print("Failed to grab frame")
break
# Perform object detection on the frame from the camera
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
annotated_image = bounding_box_annotator.annotate(scene=frame, detections=detections)
annotated_image = label_annotator.annotate(scene=annotated_image, detections=detections)
# Show the annotated image
cv2.imshow('YOLOv10 Detection', annotated_image)
k = cv2.waitKey(1)
if k % 256 == 27: # Press 'Esc' to exit
print("Escape hit, closing...")
break
cap.release()
cv2.destroyAllWindows()
print("Pipeline stopped.")
from ultralytics.
Hello @mrortach,
Thank you for sharing your script and the detailed information. It looks like you're encountering issues with YOLOv10 integration using the Ultralytics library.
Firstly, I noticed that you are using YOLOv10
from the ultralytics
package, which is not officially supported. The official Ultralytics repository currently supports YOLOv8 and other models, but not YOLOv10. For YOLOv10, you should use the repository you mentioned: THU-MIG/yolov10.
Here's a revised version of your script using the official YOLOv10 repository:
import cv2
import torch
import numpy as np
import supervision as sv # type: ignore
from yolov10 import YOLOv10 # Ensure you have the correct import
print("Starting script...")
# Load the YOLOv10 model
model = YOLOv10("yolov10x.pt")
# Create annotators
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
# Create a VideoCapture object for the webcam
cap = cv2.VideoCapture(0) # Change the index if you have multiple cameras
if not cap.isOpened():
print("Unable to read camera feed")
exit()
while True:
ret, frame = cap.read()
if not ret:
print("Failed to grab frame")
break
# Perform object detection on the frame from the camera
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
annotated_image = bounding_box_annotator.annotate(scene=frame, detections=detections)
annotated_image = label_annotator.annotate(scene=annotated_image, detections=detections)
# Show the annotated image
cv2.imshow('YOLOv10 Detection', annotated_image)
k = cv2.waitKey(1)
if k % 256 == 27: # Press 'Esc' to exit
print("Escape hit, closing...")
break
cap.release()
cv2.destroyAllWindows()
print("Pipeline stopped.")
Please ensure you have the correct dependencies installed for YOLOv10 from the THU-MIG repository. You can follow their installation instructions to set up your environment correctly.
If you encounter any further issues, please provide additional details or error messages so we can assist you better. Also, make sure to use the latest versions of torch
and ultralytics
if you switch back to using YOLOv8 or other supported models.
Feel free to reach out if you have more questions. Happy coding! 😊
from ultralytics.
Actually, running my own code is not a problem; it works. However, it runs very slowly with the real-time camera on versions below 3.12
from ultralytics.
3.11 https://www.youtube.com/watch?v=UE4mYQ-T4Ds
3.12 https://www.youtube.com/watch?v=HXosSZJlrBg
You can look terminal 3.12 so fast, 3.11 so slow.
from ultralytics.
Hello @mrortach,
Thank you for providing the video comparisons. It's clear that there's a significant performance difference between versions 3.11 and 3.12 of YOLOv10.
To help us investigate this issue further, could you please provide a minimum reproducible code example? This will allow us to replicate the issue on our end. You can find guidelines on creating a reproducible example here: Minimum Reproducible Example. This step is crucial for us to understand the root cause of the performance discrepancy.
Additionally, please ensure you are using the latest versions of torch
and ultralytics
. Sometimes, performance issues can be resolved by updating these packages. You can upgrade them using the following commands:
pip install --upgrade torch ultralytics
Once you provide the reproducible example and confirm that you are using the latest versions, we can delve deeper into the issue. Your detailed observations and the steps you've already taken are very helpful, and we'll do our best to assist you in resolving this performance discrepancy.
Thank you for your cooperation and patience! 😊
from ultralytics.
pip install --upgrade torch
Ultralytics does not support it, sir, I am using Yolov10. pip install -q git+https://github.com/THU-MIG/yolov10.git
import cv2
import torch
import numpy as np
import supervision as sv # type: ignore
from ultralytics import YOLOv10
# Modeli yüklerken bu yolu kullanın
model = YOLOv10("yolov10x.pt")
bounding_box_annotator = sv.BoundingBoxAnnotator()
label_annotator = sv.LabelAnnotator()
# Tek kamera için VideoCapture nesnesi oluşturun
cap = cv2.VideoCapture(1)
if not cap.isOpened():
print("Unable to read camera feed from camera")
exit()
while True:
ret, frame = cap.read()
if not ret:
break
# Kamera'dan gelen görüntü için nesne tespiti
results = model(frame)[0]
detections = sv.Detections.from_ultralytics(results)
annotated_image = bounding_box_annotator.annotate(scene=frame, detections=detections)
annotated_image = label_annotator.annotate(scene=annotated_image, detections=detections)
# Görüntüyü ekranda göster
cv2.imshow('Webcam', annotated_image)
k = cv2.waitKey(1)
if k % 256 == 27:
print("Escape hit, closing...")
break
cap.release()
cv2.destroyAllWindows()
from ultralytics.
Hello @mrortach,
Thank you for your detailed comment and for providing the code snippet. It's great to see your proactive approach in troubleshooting the issue.
To help us investigate the performance discrepancy between YOLOv10 versions 3.11 and 3.12, could you please provide a minimum reproducible code example? This will enable us to replicate the issue on our end and identify the root cause. You can find guidelines on creating a reproducible example here: Minimum Reproducible Example. This step is crucial for us to understand the exact problem and work towards a solution.
Additionally, please ensure that you are using the latest versions of torch
and ultralytics
. Sometimes, performance issues can be resolved by updating these packages. You can upgrade them using the following command:
pip install --upgrade torch ultralytics
Once you provide the reproducible example and confirm that you are using the latest versions, we can delve deeper into the issue. Your detailed observations and the steps you've already taken are very helpful, and we'll do our best to assist you in resolving this performance discrepancy.
Thank you for your cooperation and patience! 😊
from ultralytics.
Related Issues (20)
- Training problems for RT-DETR HOT 11
- How to increase inference speed in YoloV8 HOT 7
- Training Tracker in YOLO HOT 13
- RTDETR training error reported HOT 16
- The ‘classes’ method in model.predict() seems to be not applicable to the yolov10 model. HOT 8
- Criteria for defining angles in labels and predictions (90º vs. 135º) HOT 1
- How to access the Batch Normalization of Yolov8? HOT 6
- --cache caches validation set and training set separately HOT 4
- Detect specific object and show XY prediction of that object HOT 6
- Can I load 2 or more models into 1 GPU for inference if I have enough GPU memory? HOT 1
- parse prediction from yolo8.onnx in opencv HOT 10
- Ignoring Corrupt Image/Label Error: Non-Normalized or Out of Bounds Coordinates in DOTA Dataset HOT 2
- Parse the output of tflite model HOT 5
- As the number of training iterations increases, the bounding boxes become larger. HOT 12
- AttributeError: Can't get attribute 'v10DetectLoss' on <module 'ultralytics.utils.loss' > HOT 13
- Yolo parameters HOT 1
- Yolo v10 prediction: error with predicted classes HOT 6
- Matching tag on classify validation HOT 2
- low speed on training HOT 3
- Benchmarking YOLO Versions for Custom Object Detection Task HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultralytics.