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

Live Inference with Streamlit Application using Ultralytics YOLO11

مقدمة

Streamlit makes it simple to build and deploy interactive web applications. Combining this with Ultralytics YOLO11 allows for real-time object detection and analysis directly in your browser. YOLO11 high accuracy and speed ensure seamless performance for live video streams, making it ideal for applications in security, retail, and beyond.



شاهد: How to Use Streamlit with Ultralytics for Real-Time Computer Vision in Your Browser

تربيه الاحياء المائيه تربية الحيوانات
Fish Detection using Ultralytics YOLO11 Animals Detection using Ultralytics YOLO11
Fish Detection using Ultralytics YOLO11 Animals Detection using Ultralytics YOLO11

مزايا الاستدلال المباشر

  • Seamless Real-Time Object Detection: Streamlit combined with YOLO11 enables real-time object detection directly from your webcam feed. This allows for immediate analysis and insights, making it ideal for applications requiring instant feedback.
  • نشر سهل الاستخدام: تجعل واجهة Streamlit التفاعلية من السهل نشر التطبيق واستخدامه دون معرفة تقنية واسعة. يمكن للمستخدمين بدء الاستدلال المباشر بنقرة بسيطة، مما يعزز إمكانية الوصول وسهولة الاستخدام.
  • Efficient Resource Utilization: YOLO11 optimized algorithm ensure high-speed processing with minimal computational resources. This efficiency allows for smooth and reliable webcam inference even on standard hardware, making advanced computer vision accessible to a wider audience.

رمز تطبيق Streamlit

Ultralytics التركيب

قبل أن تبدأ في إنشاء التطبيق، تأكد من تثبيت الحزمة Ultralytics Python . يمكنك تثبيتها باستخدام الأمر pip install ultralytics

تطبيق ستريمليت

from ultralytics import solutions

solutions.inference()

### Make sure to run the file using command `streamlit run <file-name.py>`
yolo streamlit-predict

This will launch the Streamlit application in your default web browser. You will see the main title, subtitle, and the sidebar with configuration options. Select your desired YOLO11 model, set the confidence and NMS thresholds, and click the "Start" button to begin the real-time object detection.

يمكنك اختيارياً توفير نموذج محدد في Python:

تطبيق Streamlit مع نموذج مخصص

from ultralytics import solutions

# Pass a model as an argument
solutions.inference(model="path/to/model.pt")

### Make sure to run the file using command `streamlit run <file-name.py>`

استنتاج

By following this guide, you have successfully created a real-time object detection application using Streamlit and Ultralytics YOLO11. This application allows you to experience the power of YOLO11 in detecting objects through your webcam, with a user-friendly interface and the ability to stop the video stream at any time.

لمزيد من التحسينات، يمكنك استكشاف إضافة المزيد من الميزات مثل تسجيل دفق الفيديو، أو حفظ الإطارات المشروحة، أو التكامل مع مكتبات الرؤية الحاسوبية الأخرى.

شارك أفكارك مع المجتمع

تفاعل مع المجتمع لمعرفة المزيد واستكشاف المشكلات وحلها ومشاركة مشاريعك:

أين تجد المساعدة والدعم

  • مشكلات GitHub: قم بزيارة مستودعUltralytics GitHub لطرح الأسئلة والإبلاغ عن الأخطاء واقتراح الميزات.
  • Ultralytics خادم ديسكورد: انضم إلى خادم Ultralytics Discord Server للتواصل مع المستخدمين والمطورين الآخرين والحصول على الدعم ومشاركة المعرفة وتبادل الأفكار وتبادل الأفكار.

الوثائق الرسمية

  • Ultralytics YOLO11 Documentation: Refer to the official YOLO11 documentation for comprehensive guides and insights on various computer vision tasks and projects.

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

How can I set up a real-time object detection application using Streamlit and Ultralytics YOLO11?

Setting up a real-time object detection application with Streamlit and Ultralytics YOLO11 is straightforward. First, ensure you have the Ultralytics Python package installed using:

pip install ultralytics

بعد ذلك، يمكنك إنشاء تطبيق Streamlit أساسي لتشغيل الاستدلال المباشر:

تطبيق ستريمليت

from ultralytics import solutions

solutions.inference()

### Make sure to run the file using command `streamlit run <file-name.py>`
yolo streamlit-predict

لمزيد من التفاصيل حول الإعداد العملي، راجع قسم كود تطبيق Streamlit في الوثائق.

What are the main advantages of using Ultralytics YOLO11 with Streamlit for real-time object detection?

Using Ultralytics YOLO11 with Streamlit for real-time object detection offers several advantages:

  • Seamless Real-Time Detection: Achieve high-accuracy, real-time object detection directly from webcam feeds.
  • واجهة سهلة الاستخدام: تتيح واجهة Streamlit البديهية سهولة الاستخدام والنشر دون معرفة تقنية واسعة.
  • Resource Efficiency: YOLO11's optimized algorithms ensure high-speed processing with minimal computational resources.

اكتشف المزيد عن هذه المزايا هنا.

كيف يمكنني نشر تطبيق اكتشاف الكائنات Streamlit في متصفح الويب الخاص بي؟

After coding your Streamlit application integrating Ultralytics YOLO11, you can deploy it by running:

streamlit run <file-name.py>

This command will launch the application in your default web browser, enabling you to select YOLO11 models, set confidence, and NMS thresholds, and start real-time object detection with a simple click. For a detailed guide, refer to the Streamlit Application Code section.

What are some use cases for real-time object detection using Streamlit and Ultralytics YOLO11?

Real-time object detection using Streamlit and Ultralytics YOLO11 can be applied in various sectors:

  • الأمان: المراقبة في الوقت الحقيقي للوصول غير المصرح به.
  • البيع بالتجزئة: عدّ العملاء، وإدارة الأرفف، وغير ذلك الكثير.
  • الحياة البرية والزراعة: مراقبة الحيوانات وظروف المحاصيل.

لمزيد من حالات الاستخدام المتعمقة والأمثلة، استكشف Ultralytics Solutions.

How does Ultralytics YOLO11 compare to other object detection models like YOLOv5 and RCNNs?

Ultralytics YOLO11 provides several enhancements over prior models like YOLOv5 and RCNNs:

  • سرعة ودقة أعلى: أداء محسّن للتطبيقات في الوقت الحقيقي.
  • سهولة الاستخدام: واجهات مبسطة ونشر مبسط.
  • كفاءة الموارد: مُحسَّن لسرعة أفضل مع الحد الأدنى من المتطلبات الحسابية.

For a comprehensive comparison, check Ultralytics YOLO11 Documentation and related blog posts discussing model performance.


📅 Created 3 months ago ✏️ Updated 16 days ago

التعليقات