Ultralytics YOLO Frequently Asked Questions (FAQ)
This FAQ section addresses common questions and issues users might encounter while working with Ultralytics YOLO repositories.
FAQ#
Ultralytics is a computer vision AI company specializing in state-of-the-art object detection and image segmentation models, with a focus on the YOLO (You Only Look Once) family. Its offerings include:
- Open-source implementations of YOLO26 (latest) and YOLO11 (previous generation)
- A wide range of pretrained models for various computer vision tasks
- A comprehensive Python package for integrating YOLO models into projects
- Versatile tools for training, testing, and deploying models
- Ultralytics Platform for annotating data, training models in the cloud, and deploying them
- Extensive documentation and a supportive community
Installing the Ultralytics package is straightforward using pip:
pip install ultralyticsFor the latest development version, install directly from the GitHub repository:
pip install git+https://github.com/ultralytics/ultralytics.gitDetailed installation instructions can be found in the quickstart guide.
Minimum requirements:
- Python 3.8+
- PyTorch 1.8+
- CUDA-compatible GPU (for GPU acceleration)
Recommended setup:
- NVIDIA GPU
- 8GB+ RAM
- 50GB+ free disk space (for dataset storage and model training)
For troubleshooting common issues, visit the YOLO Common Issues page.
To train a custom YOLO model:
-
Prepare your dataset in YOLO format (images and corresponding label txt files).
-
Create a YAML file describing your dataset structure and classes (see dataset YAML example).
-
Use the following Python code to start training:
from ultralytics import YOLO # Load a model model = YOLO("yolo26n.yaml") # build a new model from scratch model = YOLO("yolo26n.pt") # load a pretrained model (recommended for training) # Train the model results = model.train(data="path/to/your/data.yaml", epochs=100, imgsz=640)
For a more in-depth guide, including data preparation and advanced training options, refer to the comprehensive training guide.
-
Ultralytics offers a diverse range of pretrained YOLO26 models for various tasks:
- Object Detection: YOLO26n, YOLO26s, YOLO26m, YOLO26l, YOLO26x
- Instance Segmentation: YOLO26n-seg, YOLO26s-seg, YOLO26m-seg, YOLO26l-seg, YOLO26x-seg
- Semantic Segmentation: YOLO26n-sem, YOLO26s-sem, YOLO26m-sem, YOLO26l-sem, YOLO26x-sem
- Depth Estimation: YOLO26n-depth, YOLO26s-depth, YOLO26m-depth, YOLO26l-depth, YOLO26x-depth
- Classification: YOLO26n-cls, YOLO26s-cls, YOLO26m-cls, YOLO26l-cls, YOLO26x-cls
- Pose Estimation: YOLO26n-pose, YOLO26s-pose, YOLO26m-pose, YOLO26l-pose, YOLO26x-pose
- Oriented Detection (OBB): YOLO26n-obb, YOLO26s-obb, YOLO26m-obb, YOLO26l-obb, YOLO26x-obb
These models vary in size and complexity, offering different trade-offs between speed and accuracy. Explore the full range of pretrained models to find the best fit for your project.
To perform inference with a trained model:
from ultralytics import YOLO # Load a model model = YOLO("path/to/your/model.pt") # Perform inference results = model("path/to/image.jpg") # Process results for r in results: print(r.boxes) # print bbox predictions print(r.masks) # print mask predictions print(r.probs) # print class probabilitiesFor advanced inference options, including batch processing and video inference, check out the detailed prediction guide.
Yes. Ultralytics models support deployment across various platforms:
- Edge devices: Optimize inference on devices like NVIDIA Jetson or Raspberry Pi using TensorRT, ONNX, or OpenVINO.
- Mobile: Deploy on Android or iOS devices by converting models to LiteRT or CoreML.
- Cloud: Leverage frameworks like TensorFlow Serving or TorchServe for scalable cloud deployments.
- Web: Implement in-browser inference using ONNX Runtime Web.
Ultralytics provides export functions to convert models to various formats for deployment. Explore the wide range of deployment options to find the best solution for your use case.
Key distinctions include:
- End-to-End NMS-Free Inference: YOLO26 offers NMS-free inference with
nms=False. Its default one-to-many path uses NMS for accuracy. - DFL Removal: YOLO26 removes the Distribution Focal Loss module, simplifying export and improving compatibility with edge and low-power devices.
- MuSGD Optimizer: A hybrid of SGD and Muon (inspired by Moonshot AI's Kimi K2) for more stable training and faster convergence.
- CPU Performance: YOLO26n runs up to 43% faster than YOLO11n on CPU ONNX inference (Intel Xeon CPU @ 2.00 GHz), making it well suited to devices without GPUs.
- Task-Specific Optimizations: Enhanced segmentation with semantic loss and multi-scale protos, Residual Log-Likelihood Estimation (RLE) for more accurate pose estimation, and improved OBB decoding with angle loss.
- Tasks: Both models support object detection and instance segmentation, while YOLO26 also adds semantic segmentation for dense pixel-level prediction and monocular depth estimation for per-pixel depth. Both models also support classification, pose estimation, and oriented object detection (OBB) in a unified framework.
For an in-depth comparison of features and performance metrics, visit the YOLO26 documentation page.
- End-to-End NMS-Free Inference: YOLO26 offers NMS-free inference with
Contributing to Ultralytics is a great way to improve the project and expand your skills. Here's how you can get involved:
- Fork the Ultralytics repository on GitHub.
- Create a new branch for your feature or bug fix.
- Make your changes and ensure all tests pass.
- Submit a pull request with a clear description of your changes.
- Participate in the code review process.
You can also contribute by reporting bugs, suggesting features, or improving documentation. For detailed guidelines and best practices, refer to the contributing guide.
Ultralytics YOLO offers a rich set of features for advanced computer vision tasks:
- Real-Time Detection: Efficiently detect and classify objects in real-time scenarios.
- Multi-Task Capabilities: Perform object detection, instance segmentation, semantic segmentation, monocular depth estimation, classification, pose estimation, and oriented object detection (OBB) with a unified framework.
- Pretrained Models: Access a variety of pretrained models that balance speed and accuracy for different use cases.
- Custom Training: Easily fine-tune models on custom datasets with the flexible training pipeline.
- Wide Deployment Options: Export models to various formats like TensorRT, ONNX, and CoreML for deployment across different platforms.
- Extensive Documentation: Benefit from comprehensive documentation and a supportive community for your computer vision workflows.
Several techniques can improve your YOLO model's performance:
- Hyperparameter Tuning: Experiment with different hyperparameters using the Hyperparameter Tuning Guide to optimize model performance.
- Data Augmentation: Implement techniques like flip, scale, rotate, and color adjustments to enhance your training dataset and improve model generalization.
- Transfer Learning: Leverage pretrained models and fine-tune them on your specific dataset using the Train guide.
- Export to Efficient Formats: Convert your model to optimized formats like TensorRT or ONNX for faster inference using the Export guide.
- Benchmarking: Utilize the Benchmark Mode to measure and improve inference speed and accuracy systematically.
Ultralytics provides many resources to help you get started with its tools:
- Official documentation: Comprehensive guides, API references, and best practices.
- GitHub repository: Source code, example scripts, and community contributions.
- Ultralytics blog: In-depth articles, use cases, and technical insights.
- Ultralytics Academy: Free courses on computer vision foundations, training your first YOLO model, and running YOLO in production.
- Community forums: Connect with other users, ask questions, and share your experiences.
- YouTube channel: Video tutorials, demos, and webinars on various Ultralytics topics.
These resources provide code examples, real-world use cases, and step-by-step guides for various tasks using Ultralytics models.
If you need further assistance, consult the Ultralytics documentation or reach out to the community through GitHub Issues or the official discussion forum.
Comments154
Ask a question, share your results, or help someone else.
oicoyc
Hello, I am really confused and unable to find a solution. I trained YOLOv8n on a dataset with 4000 images for 200 epochs, but during training, the mAP@50 never exceeded 0.4. However, when I use val.py or train.py to test the best.pt file again, the mAP@50 significantly increases to 0.7. Even if I retrain YOLOv8n, I can only get a poor result of 0.4, but this weight file consistently gives a result above 0.7 during testing. What could be the reason for this?
1
Glenn JocherUltralytics@oicoyc it seems like there might be a discrepancy between training and validation settings. Ensure that the dataset and parameters used during validation match those in training. For further insights, you can explore the FAQ section at Ultralytics Documentation.
oicoyc
ēæ»čÆå¦äøļ¼
However, this
best.ptconsistently shows an mAP@50 above 0.6 on the same dataset, whether usingtrain.pyorval.py. But other weights or retraining the model that generated this weight file never achieve the same result, only reaching 0.4. Have you ever encountered this situation before?
Glenn JocherUltralytics@oicoyc it sounds like there might be a difference in the evaluation settings or data splits between training and validation. Ensure consistency in dataset and parameters. For more insights, check the Ultralytics FAQ.
arifan-instrumentasi-UB
Hello, I am working with custom train yolo v8 model in Colab. I am using image as a source. How can I write a text on result image? I want to write the summary of prediction on the top of result image. Please help.
1
Glenn JocherUltralyticsHello! š
To write a summary of your predictions on the top of your result image in Colab using a custom-trained YOLOv8 model, you can leverage the OpenCV library. Here's a quick example on how you can do that:
import cv2 # Assuming 'results' is your YOLOv8 model inference output # Load your image image = cv2.imread('path_to_your_image/image.jpg') # Define the text you want to add summary_text = "Your summary text here" # Set the position, font, scale, color, etc. position = (50, 50) # Adjust based on your requirement font = cv2.FONT_HERSHEY_SIMPLEX font_scale = 1 color = (255, 0, 0) # Blue color in BGR thickness = 2 # Add the text to your image cv2.putText(image, summary_text, position, font, font_scale, color, thickness) # Save or display the result cv2.imwrite('path_to_save_image/summary_result.jpg', image) # or use cv2.imshow('Result', image) to display in Colab (might require additional setup for Colab)Make sure to adjust the path to your image, the
summary_textcontent, and formatting options likeposition,font,fontScale,color, andthicknessaccording to your preferences.Hope this helps! If you have any more questions, feel free to ask. Happy coding! š
arifan-instrumentasi-UB
Hi, thanks for your help. But I have another question.
the image variable in this line have file path. cv2.putText(image, summary_text, position, font, font_scale, color, thickness)
how to call inference result to the image variable without file path (direct to inference result variable without saving the inference result before) ?
thanks again, arifan
Glenn JocherUltralytics(edited)Hi Arifan,
Glad to help! š To use the result of an inference directly without saving and reloading from a file path in OpenCV, you'll need to work directly with the image array returned by your YOLOv8 inference. After running an inference with your YOLO model, it typically returns an image tensor or array which you can convert to a format suitable for OpenCV operations. Here's a quick example:
from ultralytics import YOLO # Assuming your model is loaded to 'model' and your image to infer is 'your_image' model = YOLO('your_model.pt') results = model('path/to/your_image.jpg') # Perform inference # Get the annotated image as a NumPy array (BGR) for OpenCV inference_img = results[0].plot() # Now you can use cv2.putText directly on the 'inference_img' cv2.putText(inference_img, summary_text, position, font, font_scale, color, thickness) # Show or Save 'inference_img' as needed cv2.imshow('Inference Result with Text', inference_img) cv2.waitKey(0) cv2.destroyAllWindows()In this example,
results[0].plot()returns the annotated image array of the first (or only) image predicted by the model, which you can then manipulate using OpenCV functions likecv2.putTextdirectly without needing to save and reload the image from a path.Hope this clarifies things for you! Let me know if you have any more questions.
arifan-instrumentasi-UB
Hi, so helpful for me. thank you.
now, iam trying the same work using video file as an input. can i using the same code?
Glenn JocherUltralytics(edited)Hi there! š Glad to hear the previous advice was helpful for you.
For processing a video file, the approach will be slightly different from handling a single image since you'll be working with a stream of frames rather than a static picture. You'll want to loop over each frame in the video, apply the detection, and then optionally write the text on each frame before displaying or saving it.
Here's a simplified snippet to get you started:
import cv2 from ultralytics import YOLO # Load your custom-trained model model = YOLO('path/to/your_model.pt') # Initialize video capture from a file cap = cv2.VideoCapture('path/to/your_video.mp4') while cap.isOpened(): ret, frame = cap.read() if not ret: break # Run model inference on the current frame results = model(frame) frame = results[0].plot() # draw the detections on the frame # [Optional] Customize this part to add your summary text to each frame cv2.putText(frame, 'Your summary text here', (50, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 0, 0), 2) # Display the frame cv2.imshow('Frame', frame) if cv2.waitKey(1) & 0xFF == ord('q'): # Press 'q' to quit break cap.release() cv2.destroyAllWindows()Make sure to adjust the paths, model, and summary text as needed. This code assumes you're working within an environment that supports OpenCV displays (like Jupyter or running locally).
For real-time performance or handling larger videos, consider optimizations š such as reducing
imgszfor faster processing or using a more powerful GPU.arifan-instrumentasi-UB
so we only need to put text on frame from cap.read() and no need to put on inference result?
Glenn JocherUltralyticsHi there! š
Yes, you're exactly right! For adding text to your video frames, you'll directly work with the frame obtained from
cap.read()rather than the inference result. Here's how you can do it:# Example code snippet import cv2 cap = cv2.VideoCapture('path/to/your_video.mp4') while True: ret, frame = cap.read() if not ret: break # Place your text on the frame here cv2.putText(frame, "Your Text Here", (10,30), cv2.FONT_HERSHEY_SIMPLEX, 1, (255,255,255), 2) # Show the frame cv2.imshow('Frame', frame) if cv2.waitKey(1) & 0xFF == ord('q'): break cap.release() cv2.destroyAllWindows()This approach lets you dynamically display information directly on the video stream. š¹ If you have more questions or need further assistance, feel free to ask. Happy coding!
oukkahe
Hi Paula!
I have not reported anything for months now.
I do not understand what this is about.
BR,
Heikki
From: Paula Derrenger @.> Sent: Monday, 24 August 2026 13.36 To: ultralytics/ultralytics @.> Cc: oukkahe @.>; Comment @.> Subject: Re: [ultralytics/ultralytics] help/FAQ/ (Discussion #7928)
Please share the exact upload/training error and your dataset structure. Segmentation labels must follow the Ultralytics segmentation dataset format https://docs.ultralytics.com/datasets/segment , with one matching .txt file per image containing normalized polygon coordinates and at least three points per object; please continue posting details here so the Ultralytics team can investigate.
ā Reply to this email directly, view it on GitHub https://github.com/orgs/ultralytics/discussions/7928?email_source=notifications&email_token=AFVEEPWRWQTVMISQRP7QBFT5LQLBFA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBRGMZTQMBZUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#discussioncomment-18133809 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFVEEPWBYBSTVGYGSCVFGRL5LQLBFAVCNFSNUABHKJSXA33TNF2G64TZHM2TGNJTGYYDINBVHNCGS43DOVZXG2LPNY5TMMJWGEYTKONBOYBA . Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS https://github.com/notifications/mobile/ios/AFVEEPSGHO5VYLT4OEILRNL5LQLBFA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBRGMZTQMBZUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSVGM33PORSXEX3JN5ZQ and Android https://github.com/notifications/mobile/android/AFVEEPQNNBDUPPWWHNQECST5LQLBFA5CNFSNUABIM5UWIORPF5TWS5BNNB2WEL2ENFZWG5LTONUW63SDN5WW2ZLOOQXTCOBRGMZTQMBZUZZGKYLTN5XKOY3PNVWWK3TUUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ . Download it today! You are receiving this because you commented. https://github.com/notifications/beacon/AFVEEPVFS7CXU7IMCBMQ3ZD5LQLBFBFCNFSM6AAAAAC6DDWSKOWGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQBCSZTDJTSMVQXG33OU5RW63LNMVXHI.gif Message ID: @.*** @.***> >
UserWhy can't my segmentation be uploaded in the model? It's impossible to conduct training.
Paula DerrengerUltralyticsPlease share the exact upload/training error and your dataset structure. Segmentation labels must follow the Ultralytics segmentation dataset format, with one matching
.txtfile per image containing normalized polygon coordinates and at least three points per object; please continue posting details here so the Ultralytics team can investigate.
Useräøŗä»ä¹ęēåå²åØęØ”åéé¢äøä¼ äøäŗļ¼ę²”åę³č®ē»
oukkahe
Hello Ultralytics! Keep up the good work. I am wondering if there is any support or sample code for using Yolo11 with openVino in c++? I am aware of Python openVino support. Something like that for c++ would be great.
Glenn JocherUltralyticsWe donāt currently maintain an official Ultralytics C++ OpenVINO inference sample in this repo; the recommended workflow is to export your YOLO11 model to OpenVINO IR using our OpenVINO integration docs and then run it with the native OpenVINO C++ runtime (youāll need to implement YOLO11 pre/post-processing in C++, including NMSāif you want a simpler end-to-end export path, consider Ultralytics YOLO26).
yolo export model=yolo11n.pt format=openvino
Narayanan-nans
Hi Team, Thanks for doing great works in the computer vision field. I want to know whether do you have any idea to integrate cupy with ultralytics packages in place of numpy & scipy, If you do have when can we expect the same to be integrated? Thanks in advance
ralekz
Hi! Your neural network claims that your Yolo11 models come with feature map stride parameters of 32, 16, and 8. How can I also get your detection models with feature map stride = 4? Can I download the entire line of detection models with this parameter? Can I change this parameter myself? I need to predict small details with greater accuracy...
Glenn JocherUltralytics@ralekz youāre right that the standard YOLO11 detection models use 8/16/32 strides, and we donāt currently publish a variant with a strideā4 detection head, so thereās nothing to ājust downloadā for that. To get stride 4 youād need to modify the model YAML (add an extra lowāstride feature map / detection head) and then train or fineātune that custom architecture; simply changing a stride value on an existing
.ptwithout retraining is not supported and will generally degrade performance. For an overview of how the YOLO11 backbone and head are defined so you can experiment safely, see the YOLO11 model page and its links to configuration details.1
ralekz
Hi, thank you for your support! I can't figure out how to further train my YOLO 11 model. For example, I have a dataset of 150,000 labeled images of Toyota cars, and it works perfectly. But in the new year, a new model is released, and the old ones have been restyled. How can I add predictive capabilities to my model for these new and updated models without losing the previous training skills? Is it really only possible to use a combined dataset?
ralekz
That moment when I sewed my own severed arms back on with my own feet... Give me back my thanks.
Glenn JocherUltralytics(edited)@alexs-rufer the
self.hyp.boxerror means the internal detection model hasnāt had its training hyperparameters (hyp) initialized into the object the loss expects; that setup is normally done only when you go through the builtāinmodel.train(...)/ Trainer pipeline, which then callsself.model(batch)for you. Directly callingmodel.model(batch)is therefore using internal APIs that assume the Trainer has already populatedself.hypand the loss object, so things break when you bypass it. For a stable solution, Iād recommend basing your Active Teacher loop on the existing detection trainer (copying or subclassing it and overriding the training step) rather than callingmodel.model(batch)in isolation; the reference implementation inultralytics/models/yolo/detect/train.pyshows exactly how the batch dict and loss forward are wired together.@barath38 to get very accurate box/segment predictions for your 3D coordinate use case, focus first on having perfectly drawn masks/boxes and training data that really matches your deployment setup (same camera height, distance, row/column layout, and lighting), rather than just collecting thousands of random box images. A few hundred wellāannotated examples per box type and viewpoint, combined with strong augmentation (rotations, perspective changes, zoom, brightness/contrast) usually gives better results than many nearāduplicate images; you can also crop around the grid so each box is larger in the frame, which helps both segmentation quality and depth stability. For concrete guidance on how much data and what variety to target, see the Data Collection and Annotation guide together with the Preprocessing annotated data guide.
@sarath-knackforge thereās no supported way to āmergeā two YOLOv8 checkpoints into a single model in a clean, automatic way; in practice you either retrain one model on a combined dataset (license-plate data plus your custom data, with a unified label set) or you keep two separate models and run them sequentially in your pipeline. If you go with the single-model approach, just merge the datasets and train one YOLO model as usual; the object-detection docs at the YOLO detection task page show how to structure multi-class datasets for this.
@ralekz no worries on the earlier commentāon the technical side, if you want your YOLO11 model to keep performing well on the existing Toyota models while learning the new and restyled ones, you do need to keep training on some mix of old and new data; training only on the new models will typically cause forgetting of the older variants. You donāt have to keep all 150k old images in the loop, but sampling a representative subset and mixing them with the new-model images, then fineātuning from your current
best.pt, is the standard way to extend the model without losing past knowledge. Longer term, treating this as a recurring maintenance processāperiodically adding new data, rebalancing the mix, and reāvalidatingāis best practice; the guide on maintaining your computer vision models after deployment walks through that workflow in more detail.1ralekz
Thanks for the answer, it turns out there is no shortcut.
sarath-knackforge
Hi team, i have one doubt , i already done research in online but i didn't get proper finalized answer. i want to merge two separate model into single model , i want to merge yolo8 licence plate detection model with my custome fine tune model ( used yolo8s.pt pretrained model to train), so can i able to merge both modle into single mode ?
Thank you.