Başla

Ultralytics YOLOv5

Genel Bakış#

YOLOv5u, Ultralytics YOLOv5'in nesne tespiti için güncellenmiş sürümüdür. Ultralytics tarafından geliştirilen YOLOv5 modelinin mimarisi üzerine kurulan YOLOv5u, YOLOv8 modellerinde ilk kez kullanılan anchor içermeyen, nesne varlığı tahmini içermeyen ayrık başlığı entegre eder. Bu değişiklik, doğruluk-hız dengesini iyileştirerek YOLOv5u'yu hem araştırma hem de uygulamalı kullanım için verimli bir seçenek hâline getirir.

YOLOv5 nesne algılama modeli mimarisi ve performansı

Orijinal YOLOv5 deposuyla eğitilen modeller Ultralytics kitaplığıyla uyumlu değildir

Ultralytics, YOLOv5 modelinin anchor içermeyen bir varyantını sunar. ultralytics/yolov5 deposuyla eğitilen modeller ultralytics/ultralytics kütüphanesiyle yüklenemez. YOLOv5'i burada kullanmak için yeni bir modeli Ultralytics YOLOv5u kontrol noktasından eğit (ör. yolov5su.pt).

Ultralytics Platform'da Dene

YOLOv5 modellerini doğrudan Ultralytics Platform üzerinde keşfet ve çalıştır.

Input
Upload an image or select an example to test yolov5nu. Predict Docs
Live Demo

Drop an image here

or click to browse

Supports JPEG, PNG, WebP, AVIF, HEIC, JP2, TIFF, BMP & more (max 10MB)

Confidence
0.25
IoU
0.50
Image Size
640
Prediction results will appear here.

Temel Özellikler#

  • Anchor İçermeyen Ayrık Ultralytics Başlığı: Geleneksel nesne tespiti modelleri, nesne konumlarını tahmin etmek için önceden tanımlanmış anchor kutularına dayanır. YOLOv5u bunun yerine daha esnek bir tespit mekanizması sağlayan ve farklı senaryolardaki performansı iyileştiren, anchor içermeyen ayrık bir Ultralytics başlığı kullanır.

  • Optimize Edilmiş Doğruluk-Hız Dengesi: YOLOv5u, hızı ve doğruluğu dengeleyerek rekabetçi doğrulukla gerçek zamanlı tespitler sunar. Bu özellik, otonom araçlar, robotik ve gerçek zamanlı video analizi gibi hızlı yanıt gerektiren uygulamalar için değerlidir.

  • Çeşitli Önceden Eğitilmiş Modeller: YOLOv5u, 640 giriş çözünürlüğünde beş boyutta (n, s, m, l, x) COCO üzerinde önceden eğitilmiş modellerin yanı sıra 1280 giriş çözünürlüğü için P6 varyantları sunar; böylece donanımına uygun hız-doğruluk dengesini seçip kendi verilerinle ince ayar yapabilirsin.

Desteklenen Görevler ve Modlar#

YOLOv5u modelleri, farklı önceden eğitilmiş ağırlıklarla birlikte, nesne tespitini ve geliştirmeden dağıtıma kadar gereken tüm modları destekler.

Model TürüÖnceden Eğitilmiş AğırlıklarGörevEğitimDoğrulamaÇıkarımDışa aktar
YOLOv5uyolov5nu, yolov5su, yolov5mu, yolov5lu, yolov5xu, yolov5n6u, yolov5s6u, yolov5m6u, yolov5l6u, yolov5x6uNesne Algılama✅✅✅✅

Bu tablo, YOLOv5u model varyantlarını ve Eğitim, Doğrulama, Çıkarım ve Dışa Aktarma modları için destek durumlarını özetler.

Performans Metrikleri#

Performans

80 önceden eğitilmiş sınıf içeren ve COCO üzerinde eğitilmiş bu modellerin kullanım örnekleri için Algılama Belgeleri sayfasına bak.

ModelYAMLboyut
(piksel)
mAPval50-95Hız
CPU ONNX
(ms)
Hız
A100 TensorRT
(ms)
parametre
(M)
FLOPs
(B)
yolov5nu.ptyolov5n.yaml64034.373.61.062.67.7
yolov5su.ptyolov5s.yaml64043.0120.71.279.124.0
yolov5mu.ptyolov5m.yaml64049.0233.91.8625.164.2
yolov5lu.ptyolov5l.yaml64052.2408.42.5053.2135.0
yolov5xu.ptyolov5x.yaml64053.2763.23.8197.2246.4
yolov5n6u.ptyolov5n6.yaml128042.1211.01.834.331.3
yolov5s6u.ptyolov5s6.yaml128048.6422.62.3415.397.6
yolov5m6u.ptyolov5m6.yaml128053.6810.94.3641.2261.3
yolov5l6u.ptyolov5l6.yaml128055.71470.95.4786.1549.4
yolov5x6u.ptyolov5x6.yaml128056.82436.58.98155.51002.8

Kullanım Örnekleri#

Bu örnek, YOLOv5 için basit eğitim ve çıkarım örnekleri sunar.

Örnek

PyTorch önceden eğitilmiş *.pt modelleri ve yapılandırma *.yaml dosyaları, Python'da bir model örneği oluşturmak için YOLO() sınıfına aktarılabilir:

from ultralytics import YOLO

# COCO ile önceden eğitilmiş bir YOLOv5nu modelini yükle
model = YOLO("yolov5nu.pt")

# Model bilgilerini görüntüle (isteğe bağlı)
model.info()

# Modeli COCO8 örnek veri kümesinde 100 dönem boyunca eğit
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)

# 'bus.jpg' görüntüsünde YOLOv5nu modeliyle çıkarım yap
results = model("path/to/bus.jpg")

Atıflar ve Teşekkürler#

Ultralytics YOLOv5 Yayını

Modellerin hızla gelişen yapısı nedeniyle Ultralytics, YOLOv5 için resmî bir araştırma makalesi yayımlamadı. Statik belgeler üretmek yerine teknolojiyi geliştirmeye ve kullanımı kolaylaştırmaya odaklanıyoruz. YOLO mimarisi, özellikleri ve kullanımı hakkında en güncel bilgiler için GitHub depomuza ve belgelerimize başvur.

Araştırmanda YOLOv5 veya YOLOv5u kullanıyorsan lütfen Ultralytics YOLOv5 deposunu aşağıdaki gibi kaynak göster:

Atıf
@software{yolov5,
  title = {Ultralytics YOLOv5},
  author = {Glenn Jocher},
  year = {2020},
  version = {7.0},
  license = {AGPL-3.0},
  url = {https://github.com/ultralytics/yolov5},
  doi = {10.5281/zenodo.3908559},
  orcid = {0000-0001-5950-6979}
}

YOLOv5 modellerinin AGPL-3.0 ve Kurumsal lisansları kapsamında sunulduğunu lütfen unutma.

Sık Sorulan Sorular#

  • Ultralytics YOLOv5u, YOLOv5'in güncellenmiş bir sürümüdür; gerçek zamanlı nesne algılama görevlerinde doğruluk-hız dengesini iyileştiren, çapalar ve nesne olasılığı kullanmayan ayrık başlığı içerir. Geleneksel YOLOv5'ten farklı olarak YOLOv5u, çapalar kullanmayan bir algılama mekanizması benimseyerek farklı senaryolarda daha esnek ve uyarlanabilir olmasını sağlar.

  • YOLOv5u'daki çapasız Ultralytics başlığı, önceden tanımlanmış çapa kutularına olan bağımlılığı ortadan kaldırarak nesne algılama performansını iyileştirir. Böylece farklı boyut ve şekillerdeki nesneleri daha verimli biçimde algılayabilen, daha esnek ve uyarlanabilir bir mekanizma ortaya çıkar. Bu iyileştirme, doğruluk ve hız arasında dengeli bir ödünleşime doğrudan katkıda bulunarak YOLOv5u'yu gerçek zamanlı uygulamalar için uygun hâle getirir. Mimarisi hakkında daha fazla bilgiyi Temel Özellikler bölümünde bulabilirsin.

  • YOLOv5u modellerinin performans ölçümleri, kullanılan platforma ve donanıma göre değişir. Örneğin YOLOv5nu modeli, COCO veri kümesinde 34,3 mAP değerine ulaşırken CPU'da (ONNX) 73,6 ms, A100 TensorRT'de ise 1,06 ms hız elde eder. CPU ONNX ve A100 TensorRT hızları dahil her YOLOv5u modelinin ayrıntılı ölçümleri Performans Ölçümleri bölümünde yer alır.

  • Önceden eğitilmiş bir modeli yükleyip veri kümenle eğitim komutunu çalıştırarak YOLOv5u modelini eğitebilirsin. İşte kısa bir örnek:

    Örnek
    from ultralytics import YOLO
    
    # COCO ile önceden eğitilmiş bir YOLOv5nu modelini yükle
    model = YOLO("yolov5nu.pt")
    
    # Model bilgilerini görüntüle (isteğe bağlı)
    model.info()
    
    # Modeli COCO8 örnek veri kümesinde 100 dönem boyunca eğit
    results = model.train(data="coco8.yaml", epochs=100, imgsz=640)

    Daha ayrıntılı yönergeler için Kullanım Örnekleri bölümünü ziyaret et.

Yorumlar30

Bir soru sor, sonuçlarını paylaş veya başka birine yardım et.

  1. PriyaRanjanReddyGitHub

    Hi can we use yolov5nu.pt for training on my own dataset and then use the trained model for commercial use where I can build an application over it

    1. Glenn JocherUltralytics

      @PriyaRanjanReddy yes, you can use YOLOv5nu.pt for training on your dataset. For commercial use, you'll need an Ultralytics Enterprise License, which allows proprietary deployment without AGPL-3.0's open-source requirements. Visit https://ultralytics.com/license for licensing details.

    2. Glenn JocherUltralytics(düzenlendi)

      @PriyaRanjanReddy Ultralytics models, including YOLOv5u, YOLOv8, YOLO11 and YOLO26, are released under AGPL-3.0. You can use them commercially if your application complies with AGPL-3.0 (including open-sourcing it); otherwise you need an Ultralytics Enterprise License. Pricing varies based on your project's needs, so please visit our licensing page to discuss details.

  2. donia444GitHub

    hey ,i am trying to train yolov5nu on a custom dataset that is specifically for drone detection ,every time i train using this model ,i notice that my model overfits and gives a very very high unreal accuracy , but when i train on a different model like yolov5n that problem seem to not be found ,any idea why is that happening

    1. Glenn JocherUltralytics

      @donia444 it seems that your YOLOv5nu model might be overfitting due to its more complex architecture compared to YOLOv5n, which is simpler and might generalize better on your dataset. Consider using techniques like data augmentation, dropout, or early stopping to mitigate overfitting. You can find additional strategies in the Ultralytics documentation to help address this issue.

  3. MadhavKrishna1GitHub

    1.Does the kaggle dataset have a label file also? 2.How can i fine tune the model ,is there any built in library through which i could fine tune it.

    On Sun, 22 Sept 2024 at 13:12, Glenn Jocher @.***> wrote:

    @MadhavKrishna1 https://github.com/MadhavKrishna1 yOLOv5 models are indeed trained on the full COCO dataset, which includes 80 classes. For additional datasets similar to COCO, you might explore open-source repositories or platforms like Kaggle. Fine-tuning with your specific images should enhance performance on your target data.

    — Reply to this email directly, view it on GitHub https://github.com/orgs/ultralytics/discussions/10054#discussioncomment-10716632, or unsubscribe https://github.com/notifications/unsubscribe-auth/BCVBHHUR2WRPYUK46RYYFGTZXZYHRAVCNFSM6AAAAABGG3IMDCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTANZRGY3DGMQ . You are receiving this because you were mentioned.Message ID: @.*** com>

    1. Glenn JocherUltralytics

      @MadhavKrishna1 1. Yes, Kaggle datasets often include label files, but it's best to check the specific dataset details on Kaggle. 2. You can fine-tune the model using the Ultralytics YOLO Python API, which provides built-in support for training and fine-tuning.

  4. MadhavKrishna1GitHub

    I would like to know about the training process of the YOLOv5 model. Specifically, is it trained on the entire COCO dataset? I am planning to fine-tune a downloaded YOLOv5 model using additional images that are similar to those in the COCO dataset. These images have 80 classes and similar sizes to those in COCO Could you provide guidance on finding this additional dataset?

    Thank you!

    1. Glenn JocherUltralytics

      @MadhavKrishna1 yOLOv5 models are indeed trained on the full COCO dataset, which includes 80 classes. For additional datasets similar to COCO, you might explore open-source repositories or platforms like Kaggle. Fine-tuning with your specific images should enhance performance on your target data.

  5. chef-SAbhinayGitHub

    Can still use yolov5su.pt with YOLO from ultralytics pip package which is mentioned in the above docs?

    1. chef-SAbhinayGitHub

      WARNING ⚠️ yolov5su.pt appears to require 'ultralytics.yolo', which is not in Ultralytics requirements.

    2. Glenn JocherUltralytics(düzenlendi)

      @Abhinay-Sadineni yes, yolov5su.pt is an Ultralytics YOLOv5u checkpoint and loads directly with the YOLO class from the ultralytics package, so ensure you have the latest version installed. Checkpoints trained with the original ultralytics/yolov5 repo are the ones that cannot be loaded this way. For more details, visit the YOLOv5 documentation.

    3. chef-SAbhinayGitHub

      is this yolov5su.pt(yolov5 model) compatible with latest ultralytics package ?

      my experiment setup doesn't allow the autoinstall 'ultralytics.yolo' (i mean external traffic is blocked)

      @glenn-jocher

      will the latest package also issue autoinstall warning?

    4. chef-SAbhinayGitHub

      I believe torch.hub.load will also try to install model (which my experiment setup doesn't allow)

    5. Glenn JocherUltralytics

      To use yolov5su.pt with the latest Ultralytics package, ensure you have the latest version installed. If your setup blocks external traffic, you can manually download the model and dependencies. The autoinstall warning may still appear if dependencies are missing. For a seamless experience, consider using the model with the Ultralytics YOLO class after ensuring all dependencies are locally available.

    6. kanagarajan0709GitHub

      I built a custom dataset from Ultralytics Hub platform using Yolov5su model type and downloaded the trained model. When I tried to load getting this error : "An error occurred: 'Detect' object has no attribute 'grid'. "

      This is how I load the model : yolov5path - points to latest yolov5 git repo. model path - refers to YOLOv5su model trained using Ultralytics Hub.

      yolo_model = torch.hub.load(yolov5path, 'custom', force_reload=True, path=model_path, source='local')

      YOLOv5 v7.0-338-gff063284 Python-3.12.4 torch-2.3.1+cpu CPU

      YOLOv5s summary (fused): 193 layers, 9,114,632 parameters, 0 gradients, 23.8 GFLOPs Adding AutoShape... An error occurred: 'Detect' object has no attribute 'grid'.

    7. Glenn JocherUltralytics(düzenlendi)

      @kanagarajan0709 yolov5su.pt is an Ultralytics YOLOv5u checkpoint and loads with the YOLO class from the latest ultralytics package. The "Detect object has no attribute 'grid'" error appears when a checkpoint from the original ultralytics/yolov5 repo is loaded with ultralytics, or when yolov5su.pt is loaded with the old yolov5 repo code. Load yolov5su.pt with from ultralytics import YOLO, and use the yolov5 repo only for checkpoints trained there. See the YOLOv5 documentation.

    8. kanagarajan0709GitHub(düzenlendi)

      To resolve this, please ensure you are using the correct version of the YOLOv5 repository that supports the yolov5su.pt model. If the issue persists, consider using the torch.hub.load method with the appropriate YOLOv5 version.

      Yes , that's what I would be interested to know about. Could you please let me know which Yolov5 git hub repo that supports loading of yolov5su model.

      I am currently on latest git version of this - https://github.com/ultralytics/yolov5. Last commit e8a30cf820b273afbbf1c73a3f1088471a84fade (HEAD -> master, origin/master, origin/HEAD) Author: Glenn Jocher glenn.jocher@ultralytics.com

      Also I did use torch.hub.load method to load the model as below , yolo_model = torch.hub.load(yolov5path, 'custom', force_reload=True, path=model_path, source='local')

    9. Glenn JocherUltralytics(düzenlendi)

      To load yolov5su.pt, use the YOLO class from the latest ultralytics package (YOLO("yolov5su.pt")). It is an Ultralytics YOLOv5u checkpoint and is not meant for the ultralytics/yolov5 repo, which loads checkpoints trained there.

  6. Halafz7GitHub

    Good Content! I want to ask something. Is it possible to use yolov5u for Classification purposes?

    1. Paula DerrengerUltralytics(düzenlendi)

      @Halafz7 thank you for your kind words! 😊

      YOLOv5u is designed for object detection. For classification, use a classification model such as YOLO26, which supports it directly.

      Python Example
      from ultralytics import YOLO
      
      # Load a pretrained YOLO26 classification model
      model = YOLO("yolo26n-cls.pt")
      
      # Run inference on an image
      results = model("path/to/image.jpg")
      
      # Display the results
      results[0].show()
      CLI Example
      # Run inference with a YOLO26 classification model
      yolo predict model=yolo26n-cls.pt source=path/to/image.jpg

      For more details, see the Classify docs.

      If you have any more questions or need further assistance, feel free to ask! 🚀

  7. MikolajBaranskiGitHub

    My questions (as of 12th April 2024) is whether there is any documentation regarding the Yolov5u model. The description on this page states that the Yolov5u incorporates the objectness-free split head into the Yolov5 architecture. Is there any further documentation on this model? The Yolov5 GitHub doesn't seem to present this model anywhere. While the page of v7.0 update only describes the introduction of segmentation. Is there any resource going into more detail into this specific release of the model?

    I see there is also documentation regarding the architecture of the Yolov5 v6.1/6.0 model (link below for reference). Is the Yolov5u an adaptations of that architecture? If so which part is changed?

    Github: https://github.com/ultralytics/yolov5 Architecture: https://docs.ultralytics.com/yolov5/tutorials/architecture_description/

    1. Paula DerrengerUltralytics

      Hey there! 😊 It looks like you're exploring the details of our YOLOv5u model. Indeed, YOLOv5u builds upon the YOLOv5 architecture, especially by incorporating an anchor-free, objectness-free split head, a feature inspired by advancements in YOLOv8. This enhancement is aimed at refining the model's ability to detect objects with a better accuracy-speed tradeoff.

      Although it seems there might not be detailed standalone documentation on the YOLOv5u model in the Ultralytics GitHub repo, the key updates and features you’re interested in are described in our Ultralytics YOLOv5 Overview. This page highlights the integration of the anchor-free split head into the model and its impact on performance and adaptability in various scenarios.

      Regarding your question on the architecture adaptation, yes, YOLOv5u adapts the YOLOv5 v6.1/6.0 architecture. The primary change lies in the detection head of the model, which has moved towards an anchor-free, objectness-free approach. This move enhances flexibility and detection efficiency, especially in complex scenarios where predefined anchor boxes might limit the detection capabilities.

      If you're looking for more technical specifics or examples, I'd recommend diving into the architecture description you mentioned. While it focuses on an earlier version, the core architectural principles remain relevant, with the YOLOv5u modifications centered around the detection head for improved performance.

      For direct experimentation or further exploration of the YOLOv5u's unique features, playing with the pre-trained models and reviewing their performance metrics might also offer valuable insights.

      I hope this clarifies your queries! If you have more questions or need further assistance, feel free to ask. Happy detecting! 🚀

    2. MikolajBaranskiGitHub

      Thank you that is a very helpful answer! Just to make a final clarification. I am using the YOLOv5u in my Masters Thesis and I would like to appropriately record the model I have used. For the YOLOv5xu.pt (the pretrained model), should I refer to it as the extra large version of the YOLOv5u v1.0, or is it the YOLOv5 v7.0, or is there some other versioning that would correctly identify this specific release of the model?

    3. Paula DerrengerUltralytics

      Hey, thanks for reaching out with your question! 😊

      For your Masters Thesis, when documenting the model, it's best to refer to it as YOLOv5u, specifying the version as YOLOv5 v7.0 if that's the version you're utilizing, along with the specific variant you're using, for instance, yolov5xu.pt for the extra-large model. It's key to mention both the overall version (v7.0, as an example) and the specific model variant (xu) to provide clear context and specificity about the architecture and features employed in your work.

      Here's how you could cite it:

      "I utilized the YOLOv5u extra-large variant (yolov5xu.pt) from the YOLOv5 v7.0 release for object detection tasks in my project."

      This approach ensures that your documentation is clear, precise, and tracks back to the correct version of the model relevant to your study.

      Hope this helps, and all the best with your thesis! 🚀 If there's anything more you need, feel free to ask.