Yolo 深圳
深セン
今すぐ参加
用語集

PyTorch

PyTorch、Ultralytics YOLOようなAIイノベーションを支える、柔軟なPython機械学習フレームワークです。今すぐ、より賢く、より速く構築しましょう!

PyTorch is an open-source machine learning library primarily developed by Meta AI that has become a cornerstone for researchers and developers in the field of deep learning. Known for its flexibility and ease of use, it allows users to build and train complex neural networks using a dynamic computational graph. This feature, often referred to as "eager execution," enables code to be evaluated immediately, making debugging and prototyping significantly more intuitive compared to frameworks that rely on static graph definitions. It integrates seamlessly with the Python programming language, feeling like a natural extension of standard scientific computing tools.

Core Mechanics and Significance

At the heart of this framework are tensors, which are multi-dimensional arrays similar to those found in the NumPy documentation. However, unlike standard arrays, PyTorch tensors are designed to leverage GPU acceleration provided by NVIDIA CUDA. This hardware acceleration is critical for the massive parallel processing required to train modern artificial intelligence (AI) models efficiently.

The library supports a vast ecosystem of tools for computer vision (CV) and natural language processing. By providing a rich set of pre-built layers, optimizers, and loss functions, it simplifies the process of creating algorithms for tasks like image classification and sequence modeling.

実際のアプリケーション

このフレームワークの汎用性により、多様な業界で影響力の大きいAIソリューションとして採用が進んでいます:

  1. Autonomous Vehicles: Industry leaders leverage PyTorch to build deep learning models that process video feeds from car cameras. These models perform real-time object detection to identify lanes, signs, and pedestrians, enabling safer navigation.
  2. Medical Diagnostics: Researchers use the framework to develop advanced healthcare applications. For instance, it powers systems that analyze MRI scans or X-rays to assist doctors in detecting tumors via precise image segmentation.

関連ツールとの比較

その役割をよりよく理解するためには、PyTorch AIスタック内の他の一般的なPyTorch 区別することが有用です:

  • TensorFlow: Google開発したTensorFlow 、TensorFlow 静的な計算グラフに依存していた。これによりデバッグは困難になったが、デプロイは最適化された。両フレームワークの機能は収束しつつあるが、直感的なインターフェースゆえ、迅速なプロトタイピングや研究ではPyTorch 好まれることが多い。
  • OpenCV: OpenCV ニューラルネットワークの学習ではなく、 伝統的な画像処理機能(リサイズ、フィルタリング、色変換など)にOpenCV 典型的なワークフローでは、開発者は画像を分析用のPyTorch に投入する前に、 データ前処理に OpenCV を使用します。

Ultralytics統合

Ultralytics ファミリー全体、最先端の YOLO26や広く利用されている YOLO11は、PyTorchを基盤としてネイティブに構築されています。この基盤により、ユーザーはフレームワークの高速性、安定性、そして広範なコミュニティサポートの恩恵を受けられます。カスタムトレーニングデータでの転移学習を実行する場合でも、エッジデバイス向けにモデルをエクスポートする場合でも、基盤となるアーキテクチャPyTorch 勾配に依存しています。

近日公開予定Ultralytics 、この体験をさらに簡素化し、データセットの取得、トレーニング、デプロイメントを一元的に管理できるインターフェースを提供します。これにより、膨大な定型コードを記述する必要がなくなります。

以下の例は、GPU 確認しYOLO を用いた推論を実行する方法を示し、 フレームワークが内部でハードウェアアクセラレーションをどのように処理するかを実演します:

import torch
from ultralytics import YOLO

# Check if CUDA (GPU) is available for PyTorch acceleration
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"PyTorch is using device: {device}")

# Load a YOLO26n model (built on PyTorch)
model = YOLO("yolo26n.pt")

# Perform object detection on an image
# PyTorch handles tensor operations and moves data to the GPU automatically
results = model("https://ultralytics.com/images/bus.jpg", device=device)

Ultralytics コミュニティに参加する

AIの未来を共に切り開きましょう。グローバルなイノベーターと繋がり、協力し、成長を。

今すぐ参加