Yolo فيجن شنتشن
شنتشن
انضم الآن
مسرد المصطلحات

PyTorch

اكتشف PyTorch إطار عمل التعلّم الآلي المرن الذي Python والذي يدعم ابتكارات الذكاء الاصطناعي مثل Ultralytics YOLO. قم ببناء أذكى وأسرع اليوم!

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.

تطبيقات واقعية

أدى تنوع هذا الإطار إلى اعتماده في مختلف الصناعات لحلول الذكاء الاصطناعي عالية التأثير:

  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 والأدوات الشائعة الأخرى في مجموعة أدوات الذكاء الاصطناعي:

  • مقارنة مع TensorFlow: تم تطوير TensorFlow بواسطة Google وقد اعتمد TensorFlow على الرسوم البيانية الحسابية الثابتة، مما جعل عملية تصحيح الأخطاء أكثر صعوبة ولكنه أدى إلى تحسين عملية النشر. على الرغم من أن كلا الإطارين متقاربان في الميزات، غالباً PyTorch في النماذج الأولية السريعة والأبحاث بسبب واجهته البديهية.
  • مقارنةً بـ OpenCV: OpenCV مكتبة تركز على وظائف معالجة الصور التقليدية (مثل تغيير الحجم والتصفية وتحويل الألوان) بدلاً من تدريب الشبكات العصبية. في سير العمل النموذجي، يستخدم المطورون OpenCV لمعالجة البيانات مسبقًا قبل إدخال الصور في PyTorch لتحليلها.

التكامل مع Ultralytics

مجموعة Ultralytics بالكامل، بما في ذلك YOLO26 المتطورة و YOLO11، مبني أصلاً على PyTorch. يضمن هذا الأساس استفادة المستخدمين من سرعة الإطار واستقراره ودعم المجتمع الواسع النطاق. سواء كان ذلك عند إجراء التعلم النقلي على بيانات تدريب مخصصة أو تصدير نماذج لأجهزة الحافة، فإن البنية الأساسية تعتمد على 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

انضم إلى مستقبل الذكاء الاصطناعي. تواصل وتعاون وانمو مع المبتكرين العالميين

انضم الآن