コンテンツへスキップ

Speed Estimation using Ultralytics YOLO11 🚀

速度推定とは?

Speed estimation is the process of calculating the rate of movement of an object within a given context, often employed in computer vision applications. Using Ultralytics YOLO11 you can now calculate the speed of object using object tracking alongside distance and time data, crucial for tasks like traffic and surveillance. The accuracy of speed estimation directly influences the efficiency and reliability of various applications, making it a key component in the advancement of intelligent systems and real-time decision-making processes.



見るんだ: Speed Estimation using Ultralytics YOLO11

ブログをチェック

For deeper insights into speed estimation, check out our blog post: Ultralytics YOLO11 for Speed Estimation in Computer Vision Projects

速度予測の利点は?

  • 効率的な交通管理:正確な速度推定は、交通の流れを管理し、安全性を高め、道路の混雑を緩和します。
  • 正確な自律走行ナビゲーション:自動運転車のような自律システムでは、信頼性の高い速度推定が安全で正確な車両ナビゲーションを実現します。
  • 監視セキュリティの強化:監視分析における速度推定は、異常な行動や潜在的な脅威の特定に役立ち、セキュリティ対策の有効性を向上させます。

実世界での応用

交通交通
Speed Estimation on Road using Ultralytics YOLO11Speed Estimation on Bridge using Ultralytics YOLO11
Speed Estimation on Road using Ultralytics YOLO11Speed Estimation on Bridge using Ultralytics YOLO11

Speed Estimation using YOLO11 Example

import cv2

from ultralytics import solutions

cap = cv2.VideoCapture("Path/to/video/file.mp4")

assert cap.isOpened(), "Error reading video file"
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))

video_writer = cv2.VideoWriter("speed_management.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))

speed_region = [(20, 400), (1080, 404), (1080, 360), (20, 360)]

speed = solutions.SpeedEstimator(model="yolo11n.pt", region=speed_region, show=True)

while cap.isOpened():
    success, im0 = cap.read()

    if success:
        out = speed.estimate_speed(im0)
        video_writer.write(im0)
        if cv2.waitKey(1) & 0xFF == ord("q"):
            break
        continue

    print("Video frame is empty or video processing has been successfully completed.")
    break

cap.release()
cv2.destroyAllWindows()
スピードは見積もり

速度は推定値であり、完全に正確であるとは限りません。また、推定速度はGPU の速度によって異なる場合があります。

論争 SpeedEstimator

名称タイプデフォルト説明
modelstrNonePath to Ultralytics YOLO Model File
regionlist[(20, 400), (1260, 400)]カウント領域を定義する点のリスト。
line_widthint2バウンディングボックスの線の太さ。
showboolFalseビデオストリームを表示するかどうかを制御するフラグ。

論争 model.track

議論タイプデフォルト説明
sourcestrNoneSpecifies the source directory for images or videos. Supports file paths and URLs.
persistboolFalseEnables persistent tracking of objects between frames, maintaining IDs across video sequences.
trackerstrbotsort.yamlSpecifies the tracking algorithm to use, e.g., bytetrack.yaml または botsort.yaml.
conffloat0.3Sets the confidence threshold for detections; lower values allow more objects to be tracked but may include false positives.
ioufloat0.5Sets the Intersection over Union (IoU) threshold for filtering overlapping detections.
classeslistNoneFilters results by class index. For example, classes=[0, 2, 3] only tracks the specified classes.
verboseboolTrueControls the display of tracking results, providing a visual output of tracked objects.

よくあるご質問

How do I estimate object speed using Ultralytics YOLO11?

Estimating object speed with Ultralytics YOLO11 involves combining object detection and tracking techniques. First, you need to detect objects in each frame using the YOLO11 model. Then, track these objects across frames to calculate their movement over time. Finally, use the distance traveled by the object between frames and the frame rate to estimate its speed.

import cv2

from ultralytics import solutions

cap = cv2.VideoCapture("path/to/video/file.mp4")
w, h, fps = (int(cap.get(x)) for x in (cv2.CAP_PROP_FRAME_WIDTH, cv2.CAP_PROP_FRAME_HEIGHT, cv2.CAP_PROP_FPS))
video_writer = cv2.VideoWriter("speed_estimation.avi", cv2.VideoWriter_fourcc(*"mp4v"), fps, (w, h))

# Initialize SpeedEstimator
speed_obj = solutions.SpeedEstimator(
    region=[(0, 360), (1280, 360)],
    model="yolo11n.pt",
    show=True,
)

while cap.isOpened():
    success, im0 = cap.read()
    if not success:
        break
    im0 = speed_obj.estimate_speed(im0)
    video_writer.write(im0)

cap.release()
video_writer.release()
cv2.destroyAllWindows()

詳しくは、公式ブログ記事をご覧ください。

What are the benefits of using Ultralytics YOLO11 for speed estimation in traffic management?

Using Ultralytics YOLO11 for speed estimation offers significant advantages in traffic management:

  • 安全性の向上:車速を正確に推定して速度超過を検知し、交通安全を向上させます。
  • Real-Time Monitoring: Benefit from YOLO11's real-time object detection capability to monitor traffic flow and congestion effectively.
  • 拡張性:エッジデバイスからサーバーまで、様々なハードウェアセットアップにモデルを展開することで、大規模な実装に対する柔軟でスケーラブルなソリューションを実現します。

その他の用途については、速度推定の利点を参照。

Can YOLO11 be integrated with other AI frameworks like TensorFlow or PyTorch?

Yes, YOLO11 can be integrated with other AI frameworks like TensorFlow and PyTorch. Ultralytics provides support for exporting YOLO11 models to various formats like ONNX, TensorRT, and CoreML, ensuring smooth interoperability with other ML frameworks.

To export a YOLO11 model to ONNX format:

yolo export --weights yolo11n.pt --include onnx

モデルのエクスポートについては、エクスポートに関するガイドをご覧ください。

How accurate is the speed estimation using Ultralytics YOLO11?

The accuracy of speed estimation using Ultralytics YOLO11 depends on several factors, including the quality of the object tracking, the resolution and frame rate of the video, and environmental variables. While the speed estimator provides reliable estimates, it may not be 100% accurate due to variances in frame processing speed and object occlusion.

:常に誤差を考慮し、可能であれば地上真実データで推定値を検証すること。

さらなる精度向上のヒントについては 論争 SpeedEstimator セクション.

Why choose Ultralytics YOLO11 over other object detection models like TensorFlow Object Detection API?

Ultralytics YOLO11 offers several advantages over other object detection models, such as the TensorFlow Object Detection API:

  • Real-Time Performance: YOLO11 is optimized for real-time detection, providing high speed and accuracy.
  • Ease of Use: Designed with a user-friendly interface, YOLO11 simplifies model training and deployment.
  • 汎用性:物体検出、セグメンテーション、姿勢推定など複数のタスクをサポート。
  • Community and Support: YOLO11 is backed by an active community and extensive documentation, ensuring developers have the resources they need.

For more information on the benefits of YOLO11, explore our detailed model page.

📅 Created 9 months ago ✏️ Updated 14 days ago

コメント