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

تقديم النموذج (Model Serving)

Learn how model serving bridges the gap between training and production. Explore how to deploy [YOLO26](https://docs.ultralytics.com/models/yolo26/) for real-time inference using the [Ultralytics Platform](https://platform.ultralytics.com).

Model serving is the process of hosting a trained machine learning model and making its functionality available to software applications via a network interface. It acts as the bridge between a static model file saved on a disk and a live system that processes real-world data. Once a model has completed the machine learning (ML) training phase, it must be integrated into a production environment where it can receive inputs—such as images, text, or tabular data—and return predictions. This is typically achieved by wrapping the model in an Application Programming Interface (API), allowing it to communicate with web servers, mobile apps, or IoT devices.

The Role of Model Serving in AI

The primary goal of model serving is to operationalize predictive modeling capabilities effectively. While training focuses on accuracy and loss minimization, serving focuses on performance metrics like latency (how fast a prediction is returned) and throughput (how many requests can be handled per second). Robust serving infrastructure ensures that computer vision (CV) systems remain reliable under heavy loads. It often involves technologies like containerization using tools such as Docker, which packages the model with its dependencies to ensure consistent behavior across different computing environments.

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

تعمل خدمة النماذج على تشغيل ميزات الذكاء الاصطناعي في كل مكان في مختلف الصناعات من خلال تمكين اتخاذ القرارات الفورية بناءً على البيانات.

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

التنفيذ العملي

To serve a model effectively, it is often beneficial to export models to a standardized format like ONNX, which promotes interoperability between different training frameworks and serving engines. The following example demonstrates how to load a model and run inference, simulating the logic that would exist inside a serving endpoint using Python.

from ultralytics import YOLO

# Load the YOLO26 model (this typically happens once when the server starts)
model = YOLO("yolo26n.pt")

# Simulate an incoming API request with an image source URL
image_source = "https://ultralytics.com/images/bus.jpg"

# Run inference to generate predictions for the user
results = model.predict(source=image_source)

# Process results (e.g., simulating a JSON response to a client)
print(f"Detected {len(results[0].boxes)} objects in the image.")

اختيار الاستراتيجية الصحيحة

The choice of serving strategy depends heavily on the specific use case. Online Serving provides immediate responses via protocols like REST or gRPC, which is essential for user-facing web applications. Conversely, Batch Serving processes large volumes of data offline, suitable for tasks like nightly report generation. For applications requiring privacy or low latency without internet dependence, Edge AI moves the serving process directly to the device, utilizing optimized formats like TensorRT to maximize performance on constrained hardware. Many organizations leverage the Ultralytics Platform to simplify the deployment of these models to various endpoints, including cloud APIs and edge devices.

التمييز عن المصطلحات ذات الصلة

While closely related, "Model Serving" is distinct from Model Deployment and Inference.

  • Model Deployment: This refers to the broader lifecycle stage of releasing a model into a production environment. Serving is the specific mechanism or software (like NVIDIA Triton Inference Server or TorchServe) used to execute the deployed model.
  • Inference: This is the mathematical act of calculating a prediction from an input. Model serving provides the infrastructure (networking, scalability, and security) that allows inference to happen reliably for end-users.
  • Microservices: Serving is often architected as a set of microservices, where the model runs as an independent service that other parts of an application can query, often exchanging data in lightweight formats like JSON.

انضم إلى مجتمع Ultralytics

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

انضم الآن