انتقل إلى المحتوى

كشف الكائن

أمثلة على اكتشاف الكائنات

Object detection is a task that involves identifying the location and class of objects in an image or video stream.

ناتج كاشف الكائن عبارة عن مجموعة من المربعات المحيطة التي تحيط بالكائنات في الصورة ، جنبا إلى جنب مع تسميات الفئة ودرجات الثقة لكل مربع. يعد اكتشاف الكائن اختيارا جيدا عندما تحتاج إلى تحديد الأشياء ذات الأهمية في مشهد ما ، ولكن لا تحتاج إلى معرفة مكان الكائن بالضبط أو شكله الدقيق.



شاهد: Object Detection with Pre-trained Ultralytics YOLO Model.

بقشيش

YOLO11 Detect models are the default YOLO11 models, i.e. yolo11n.pt ويتم تدريبهم مسبقا على كوكو.

نماذج

YOLO11 pretrained Detect models are shown here. Detect, Segment and Pose models are pretrained on the COCO dataset, while Classify models are pretrained on the ImageNet dataset.

يتم تنزيل الموديلات تلقائيا من الأحدث Ultralytics حرر عند الاستخدام الأول.

نموذجحجم
(بكسل)
خريطةفال
50-95
السرعة
CPU ONNX
(مللي ثانية)
Speed
T4 TensorRT10
(ms)
المعلمات
(م)
FLOPs
(B)
YOLO11n64039.556.1 ± 0.81.5 ± 0.02.66.5
YOLO11s64047.090.0 ± 1.22.5 ± 0.09.421.5
YOLO11m64051.5183.2 ± 2.04.7 ± 0.120.168.0
YOLO11l64053.4238.6 ± 1.46.2 ± 0.125.386.9
YOLO11x64054.7462.8 ± 6.711.3 ± 0.256.9194.9
  • mAPval القيم هي لمقياس أحادي الطراز على كوكو فال2017 مجموعة البيانات.
    إعادة إنتاج بواسطة yolo val detect data=coco.yaml device=0
  • سرعة تم حساب المتوسط على صور COCO val باستخدام أمازون EC2 P4d مثيل.
    إعادة إنتاج بواسطة yolo val detect data=coco.yaml batch=1 device=0|cpu

قطار

Train YOLO11n on the COCO8 dataset for 100 epochs at image size 640. For a full list of available arguments see the Configuration page.

مثل

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n.yaml")  # build a new model from YAML
model = YOLO("yolo11n.pt")  # load a pretrained model (recommended for training)
model = YOLO("yolo11n.yaml").load("yolo11n.pt")  # build from YAML and transfer weights

# Train the model
results = model.train(data="coco8.yaml", epochs=100, imgsz=640)
# Build a new model from YAML and start training from scratch
yolo detect train data=coco8.yaml model=yolo11n.yaml epochs=100 imgsz=640

# Start training from a pretrained *.pt model
yolo detect train data=coco8.yaml model=yolo11n.pt epochs=100 imgsz=640

# Build a new model from YAML, transfer pretrained weights to it and start training
yolo detect train data=coco8.yaml model=yolo11n.yaml pretrained=yolo11n.pt epochs=100 imgsz=640

تنسيق مجموعة البيانات

YOLO يمكن العثور على تنسيق مجموعة بيانات الكشف بالتفصيل في دليل مجموعة البيانات. لتحويل مجموعة البيانات الحالية من تنسيقات أخرى (مثل COCO وغيرها) إلى YOLO ، يرجى استخدام JSON2YOLO الأداة بواسطة Ultralytics.

فال

Validate trained YOLO11n model accuracy on the COCO8 dataset. No arguments are needed as the model تحتفظ بتدريبها data والحجج كسمات نموذجية.

مثل

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n.pt")  # load an official model
model = YOLO("path/to/best.pt")  # load a custom model

# Validate the model
metrics = model.val()  # no arguments needed, dataset and settings remembered
metrics.box.map  # map50-95
metrics.box.map50  # map50
metrics.box.map75  # map75
metrics.box.maps  # a list contains map50-95 of each category
yolo detect val model=yolo11n.pt  # val official model
yolo detect val model=path/to/best.pt  # val custom model

تنبأ

Use a trained YOLO11n model to run predictions on images.

مثل

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n.pt")  # load an official model
model = YOLO("path/to/best.pt")  # load a custom model

# Predict with the model
results = model("https://ultralytics.com/images/bus.jpg")  # predict on an image
yolo detect predict model=yolo11n.pt source='https://ultralytics.com/images/bus.jpg'  # predict with official model
yolo detect predict model=path/to/best.pt source='https://ultralytics.com/images/bus.jpg'  # predict with custom model

شاهد التفاصيل predict تفاصيل الوضع في تنبأ صفحة.

تصدير

Export a YOLO11n model to a different format like ONNX, CoreML, etc.

مثل

from ultralytics import YOLO

# Load a model
model = YOLO("yolo11n.pt")  # load an official model
model = YOLO("path/to/best.pt")  # load a custom trained model

# Export the model
model.export(format="onnx")
yolo export model=yolo11n.pt format=onnx  # export official model
yolo export model=path/to/best.pt format=onnx  # export custom trained model

Available YOLO11 export formats are in the table below. You can export to any format using the format الحجة ، أي format='onnx' أو format='engine'. يمكنك التنبؤ أو التحقق من صحة النماذج المصدرة مباشرة، أي yolo predict model=yolo11n.onnx. يتم عرض أمثلة الاستخدام للطراز الخاص بك بعد اكتمال التصدير.

تنسيقformat جدالنموذجالبيانات الوصفيةالحجج
PyTorch-yolo11n.pt-
TorchScripttorchscriptyolo11n.torchscriptimgsz, optimize, batch
ONNXonnxyolo11n.onnximgsz, half, dynamic, simplify, opset, batch
OpenVINOopenvinoyolo11n_openvino_model/imgsz, half, int8, batch
TensorRTengineyolo11n.engineimgsz, half, dynamic, simplify, workspace, int8, batch
CoreMLcoremlyolo11n.mlpackageimgsz, half, int8, nms, batch
TF SavedModelsaved_modelyolo11n_saved_model/imgsz, keras, int8, batch
TF GraphDefpbyolo11n.pbimgsz, batch
TF لايتtfliteyolo11n.tfliteimgsz, half, int8, batch
TF حافة TPUedgetpuyolo11n_edgetpu.tfliteimgsz
TF.شبيبهtfjsyolo11n_web_model/imgsz, half, int8, batch
PaddlePaddlepaddleyolo11n_paddle_model/imgsz, batch
NCNNncnnyolo11n_ncnn_model/imgsz, half, batch

شاهد التفاصيل export التفاصيل في تصدير صفحة.

الأسئلة المتداولة

How do I train a YOLO11 model on my custom dataset?

Training a YOLO11 model on a custom dataset involves a few steps:

  1. قم بإعداد مجموعة البيانات: تأكد من أن مجموعة البيانات الخاصة بك بتنسيق YOLO . للحصول على إرشادات، راجع دليل مجموعة البيانات.
  2. تحميل النموذج: استخدم مكتبة Ultralytics YOLO لتحميل نموذج مدرب مسبقًا أو إنشاء نموذج جديد من ملف YAML.
  3. تدريب النموذج: تنفيذ train في Python أو طريقة yolo detect train في CLI.

مثل

from ultralytics import YOLO

# Load a pretrained model
model = YOLO("yolo11n.pt")

# Train the model on your custom dataset
model.train(data="my_custom_dataset.yaml", epochs=100, imgsz=640)
yolo detect train data=my_custom_dataset.yaml model=yolo11n.pt epochs=100 imgsz=640

للاطلاع على خيارات التكوين التفصيلية، قم بزيارة صفحة التكوين.

What pretrained models are available in YOLO11?

Ultralytics YOLO11 offers various pretrained models for object detection, segmentation, and pose estimation. These models are pretrained on the COCO dataset or ImageNet for classification tasks. Here are some of the available models:

للاطلاع على قائمة مفصلة ومقاييس الأداء، راجع قسم النماذج.

How can I validate the accuracy of my trained YOLO model?

To validate the accuracy of your trained YOLO11 model, you can use the .val() في Python أو طريقة yolo detect val في CLI. سيوفر هذا الأمر مقاييس مثل mAP50-95 و mAP50-95 وغيرها.

مثل

from ultralytics import YOLO

# Load the model
model = YOLO("path/to/best.pt")

# Validate the model
metrics = model.val()
print(metrics.box.map)  # mAP50-95
yolo detect val model=path/to/best.pt

لمزيد من تفاصيل التحقق، قم بزيارة صفحة فال.

What formats can I export a YOLO11 model to?

Ultralytics YOLO11 allows exporting models to various formats such as ONNX, TensorRT, CoreML, and more to ensure compatibility across different platforms and devices.

مثل

from ultralytics import YOLO

# Load the model
model = YOLO("yolo11n.pt")

# Export the model to ONNX format
model.export(format="onnx")
yolo export model=yolo11n.pt format=onnx

راجع القائمة الكاملة للتنسيقات المدعومة والتعليمات في صفحة التصدير.

Why should I use Ultralytics YOLO11 for object detection?

Ultralytics YOLO11 is designed to offer state-of-the-art performance for object detection, segmentation, and pose estimation. Here are some key advantages:

  1. نماذج مدربة مسبقًا: استخدم النماذج المدربة مسبقًا على مجموعات بيانات شائعة مثل COCO و ImageNet لتطوير أسرع.
  2. دقة عالية: يحقق نتائج مبهرة في MAP، مما يضمن اكتشاف الأجسام بشكل موثوق.
  3. السرعة: مُحسَّن للاستدلال في الوقت الفعلي، مما يجعله مثاليًا للتطبيقات التي تتطلب معالجة سريعة.
  4. المرونة: تصدير النماذج إلى تنسيقات مختلفة مثل ONNX و TensorRT للنشر عبر منصات متعددة.

Explore our Blog for use cases and success stories showcasing YOLO11 in action.

📅 Created 11 months ago ✏️ Updated 20 days ago

التعليقات