Commencer

Foire aux questions (FAQ) sur Ultralytics YOLO

Cette section FAQ répond aux questions courantes et aux problèmes que les utilisateurs peuvent rencontrer lorsqu’ils travaillent avec les dépôts Ultralytics YOLO.

FAQ#

  • Ultralytics est une entreprise d’IA spécialisée en vision par ordinateur, qui se consacre aux modèles de détection d’objets et de segmentation d’images de pointe, avec un accent particulier sur la famille YOLO (You Only Look Once). Ses offres comprennent :

    • Des implémentations open source de YOLO26 (la dernière version) et de YOLO11 (la génération précédente)
    • Un large éventail de modèles préentraînés pour diverses tâches de vision par ordinateur
    • Un package Python complet pour intégrer des modèles YOLO à tes projets
    • Des outils polyvalents pour entraîner, tester et déployer des modèles
    • Ultralytics Platform pour annoter des données, entraîner des modèles dans le cloud et les déployer
    • Une documentation complète et une communauté solidaire
  • Non. YOLO27 est en phase finale de recherche et développement en vue d’un lancement prévu plus tard cette année, sans date fixée. La documentation présente un aperçu de ses fonctionnalités, des résultats préliminaires et des exemples d’utilisation après sa sortie. Continue d’utiliser YOLO26 pour tes projets actuels.

  • L’installation du package Ultralytics est simple avec pip :

    pip install ultralytics

    Pour installer la dernière version de développement, installe-la directement depuis le dépôt GitHub :

    pip install git+https://github.com/ultralytics/ultralytics.git

    Tu trouveras des instructions d’installation détaillées dans le guide de démarrage rapide.

  • Configuration minimale requise :

    • Python 3.8+
    • PyTorch 1.8+
    • GPU compatible CUDA (pour l’accélération GPU)

    Configuration recommandée :

    • GPU NVIDIA
    • 8 Go de RAM ou plus
    • 50 Go d’espace disque libre ou plus (pour stocker les jeux de données et entraîner les modèles)

    Pour résoudre les problèmes courants, consulte la page Problèmes courants avec YOLO.

  • Pour entraîner un modèle YOLO personnalisé :

    1. Prépare ton jeu de données au format YOLO (images et fichiers txt d’étiquettes correspondants).

    2. Crée un fichier YAML décrivant la structure et les classes de ton jeu de données (voir l’exemple de fichier YAML pour un jeu de données).

    3. Utilise le code Python suivant pour démarrer l’entraînement :

      from ultralytics import YOLO
      
      # Charger un modèle
      model = YOLO("yolo26n.yaml")  # créer un nouveau modèle à partir de zéro
      model = YOLO("yolo26n.pt")  # charger un modèle préentraîné (recommandé pour l’entraînement)
      
      # Entraîner le modèle
      results = model.train(data="path/to/your/data.yaml", epochs=100, imgsz=640)

    Pour un guide plus détaillé, qui couvre la préparation des données et les options d’entraînement avancées, consulte le guide d’entraînement complet.

  • Ultralytics propose une gamme variée de modèles YOLO26 préentraînés pour différentes tâches :

    Ces modèles varient en taille et en complexité et offrent différents compromis entre vitesse et précision. Explore la gamme complète de modèles préentraînés pour trouver celui qui convient le mieux à ton projet.

  • Pour effectuer une inférence avec un modèle entraîné :

    from ultralytics import YOLO
    
    # Charger un modèle
    model = YOLO("path/to/your/model.pt")
    
    # Effectuer l’inférence
    results = model("path/to/image.jpg")
    
    # Traiter les résultats
    for r in results:
        print(r.boxes)  # afficher les prédictions bbox
        print(r.masks)  # afficher les prédictions de masques
        print(r.probs)  # afficher les probabilités de classe

    Pour découvrir les options d’inférence avancées, notamment le traitement par lots et l’inférence vidéo, consulte le guide de prédiction détaillé.

  • Oui. Les modèles Ultralytics peuvent être déployés sur différentes plateformes :

    • Appareils en périphérie : optimise l’inférence sur des appareils comme NVIDIA Jetson ou Raspberry Pi avec TensorRT, ONNX ou OpenVINO.
    • Mobile : déploie des modèles sur des appareils Android ou iOS en les convertissant au format LiteRT ou CoreML.
    • Cloud : utilise des frameworks comme TensorFlow Serving ou TorchServe pour des déploiements cloud évolutifs.
    • Web : implémente l’inférence dans le navigateur avec ONNX Runtime Web.

    Ultralytics fournit des fonctions d’exportation pour convertir les modèles en différents formats afin de les déployer. Explore les nombreuses options de déploiement pour trouver la solution la mieux adaptée à ton cas d’usage.

  • Les principales différences sont les suivantes :

    • Inférence de bout en bout sans NMS : YOLO26 propose une inférence sans NMS avec nms=False. Son chemin par défaut one-to-many utilise NMS pour garantir la précision.
    • Suppression de DFL : YOLO26 supprime le module Distribution Focal Loss, ce qui simplifie l’exportation et améliore la compatibilité avec les appareils périphériques et basse consommation.
    • Optimiseur MuSGD : un hybride de SGD et de Muon (inspiré de Kimi K2 de Moonshot AI) qui stabilise l’entraînement et accélère la convergence.
    • Performances du CPU : YOLO26n s’exécute jusqu’à 43 % plus rapidement que YOLO11n lors de l’inférence ONNX sur CPU (Intel Xeon CPU @ 2.00 GHz), ce qui le rend particulièrement adapté aux appareils sans GPU.
    • Optimisations spécifiques aux tâches : segmentation améliorée grâce à une perte sémantique et à des protos multi-échelles, estimation du maximum de vraisemblance résiduel (RLE) pour une estimation de pose plus précise, et décodage OBB amélioré avec une perte angulaire.
    • Tâches : les deux modèles prennent en charge la détection d’objets et la segmentation d’instances, tandis que YOLO26 ajoute aussi la segmentation sémantique pour les prédictions denses au niveau des pixels et l’estimation de profondeur monoculaire pour la profondeur de chaque pixel. Les deux modèles prennent également en charge la classification, l’estimation de pose et la détection d’objets orientés (OBB) dans un cadre unifié.

    Pour une comparaison détaillée des fonctionnalités et des métriques de performance, consulte la page de documentation YOLO26.

  • Contribuer à Ultralytics est un excellent moyen d’améliorer le projet et de développer tes compétences. Voici comment participer :

    1. Forke le dépôt Ultralytics sur GitHub.
    2. Crée une branche pour ta fonctionnalité ou ta correction de bogue.
    3. Effectue tes modifications et vérifie que tous les tests réussissent.
    4. Soumets une pull request accompagnée d’une description claire de tes modifications.
    5. Participe au processus de revue de code.

    Tu peux également contribuer en signalant des bogues, en suggérant des fonctionnalités ou en améliorant la documentation. Pour consulter les consignes détaillées et les bonnes pratiques, reporte-toi au guide de contribution.

  • Ultralytics YOLO propose un riche éventail de fonctionnalités pour les tâches avancées de vision par ordinateur :

    • Détection en temps réel : détecte et classe efficacement les objets dans des scénarios en temps réel.
    • Capacités multitâches : effectue la détection d’objets, la segmentation d’instances, la segmentation sémantique, l’estimation de profondeur monoculaire, la classification, l’estimation de pose et la détection d’objets orientés (OBB) dans un cadre unifié.
    • Modèles préentraînés : accède à un éventail de modèles préentraînés qui offrent un équilibre entre vitesse et précision pour différents cas d’usage.
    • Entraînement personnalisé : affine facilement les modèles sur des jeux de données personnalisés grâce au pipeline d’entraînement flexible.
    • Nombreuses options de déploiement : exporte les modèles dans différents formats, tels que TensorRT, ONNX et CoreML, pour les déployer sur diverses plateformes.
    • Documentation complète : profite d’une documentation exhaustive et d’une communauté solidaire pour tes flux de travail en vision par ordinateur.
  • Plusieurs techniques peuvent améliorer les performances de ton modèle YOLO :

    1. Réglage des hyperparamètres : teste différents hyperparamètres à l’aide du guide de réglage des hyperparamètres pour optimiser les performances du modèle.
    2. Augmentation des données : utilise des techniques telles que le retournement, le changement d’échelle, la rotation et les ajustements de couleur pour enrichir ton jeu de données d’entraînement et améliorer la généralisation du modèle.
    3. Apprentissage par transfert : exploite des modèles préentraînés et affine-les sur ton jeu de données spécifique à l’aide du guide d’entraînement.
    4. Exporter vers des formats efficaces : convertis ton modèle en formats optimisés tels que TensorRT ou ONNX pour accélérer l’inférence, en suivant le guide d’exportation.
    5. Évaluation comparative : utilise le mode Benchmark pour mesurer et améliorer systématiquement la vitesse et la précision de l’inférence.
  • Ultralytics propose de nombreuses ressources pour t’aider à démarrer avec ses outils :

    • Documentation officielle : guides complets, références d’API et bonnes pratiques.
    • Dépôt GitHub : code source, scripts d’exemple et contributions de la communauté.
    • Blog Ultralytics : articles approfondis, cas d’usage et analyses techniques.
    • Ultralytics Academy : cours gratuits sur les fondamentaux de la vision par ordinateur, l’entraînement de ton premier modèle YOLO et l’utilisation de YOLO en production.
    • Forums de la communauté : échange avec d’autres utilisateurs, pose des questions et partage tes expériences.
    • Chaîne YouTube : tutoriels vidéo, démonstrations et webinaires sur divers sujets liés à Ultralytics.

    Ces ressources proposent des exemples de code, des cas d’usage réels et des guides détaillés pour diverses tâches faisant appel aux modèles Ultralytics.

    Si tu as besoin d’aide supplémentaire, consulte la documentation Ultralytics ou contacte la communauté sur GitHub Issues ou le forum de discussion officiel.

Commentaires154

Pose une question, partage tes résultats ou aide quelqu’un d’autre.

  1. oicoycGitHub

    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
    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.

    2. oicoycGitHub

      翻译如下:

      However, this best.pt consistently shows an mAP@50 above 0.6 on the same dataset, whether using train.py or val.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?

    3. 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.

  2. arifan-instrumentasi-UBGitHub

    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
    1. Glenn JocherUltralytics

      Hello! 😊

      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_text content, and formatting options like position, font, fontScale, color, and thickness according to your preferences.

      Hope this helps! If you have any more questions, feel free to ask. Happy coding! 🚀

    2. arifan-instrumentasi-UBGitHub

      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

    3. Glenn JocherUltralytics(modifié)

      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 like cv2.putText directly 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.

    4. Glenn JocherUltralytics(modifié)

      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 imgsz for faster processing or using a more powerful GPU.

    5. Glenn JocherUltralytics

      Hi 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!

  3. oukkaheGitHub

    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: @.*** @.***> >

  4. User

    Why can't my segmentation be uploaded in the model? It's impossible to conduct training.

    1. Paula DerrengerUltralytics

      Please share the exact upload/training error and your dataset structure. Segmentation labels must follow the Ultralytics segmentation dataset format, 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.

  5. oukkaheGitHub

    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.

    1. Glenn JocherUltralytics

      We 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
  6. Narayanan-nansGitHub

    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

  7. ralekzGitHub

    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...

    1. 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 .pt without 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
  8. ralekzGitHub

    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?

    1. ralekzGitHub

      That moment when I sewed my own severed arms back on with my own feet... Give me back my thanks.

    2. Glenn JocherUltralytics(modifié)

      @alexs-rufer the self.hyp.box error 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‑in model.train(...) / Trainer pipeline, which then calls self.model(batch) for you. Directly calling model.model(batch) is therefore using internal APIs that assume the Trainer has already populated self.hyp and 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 calling model.model(batch) in isolation; the reference implementation in ultralytics/models/yolo/detect/train.py shows 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.

      1
  9. sarath-knackforgeGitHub

    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.