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

إتقان YOLOv5 🚀 النشر على منصة السحابة Google (GCP) آلة التعلم العميق الافتراضية (VM) ⭐

Embarking on the journey of artificial intelligence and machine learning can be exhilarating, especially when you leverage the power and flexibility of a cloud platform. Google Cloud Platform (GCP) offers robust tools tailored for machine learning enthusiasts and professionals alike. One such tool is the Deep Learning VM that is preconfigured for data science and ML tasks. In this tutorial, we will navigate through the process of setting up YOLOv5 on a GCP Deep Learning VM. Whether you're taking your first steps in ML or you're a seasoned practitioner, this guide is designed to provide you with a clear pathway to implementing object detection models powered by YOLOv5.

🆓 بالإضافة إلى ذلك، إذا كنت مستخدمًا جديدًا لبرنامج GCP، فأنت محظوظ بعرض رصيد مجاني بقيمة 300 دولار لبدء مشاريعك.

بالإضافة إلى GCP ، استكشف خيارات التشغيل السريع الأخرى التي يمكن الوصول إليها ل YOLOv5، مثل لدينا كولاب نوت بوك فتح في كولاب للحصول على تجربة مستندة إلى المستعرض ، أو قابلية التوسع أمازون AWS. علاوة على ذلك ، يمكن لهواة الحاويات الاستفادة من صورة Docker الرسمية الخاصة بنا في مركز عامل ميناء عامل ميناء يسحب لبيئة مغلفة.

Step 1: Create and Configure Your Deep Learning VM

لنبدأ بإنشاء جهاز افتراضي تم ضبطه للتعلم العميق:

  1. توجه إلى سوق GCP وحدد الجهاز الظاهري للتعلم العميق.
  2. اختر مثيل n1-standard-8 ؛ يوفر توازنا بين 8 وحدات معالجة مركزية افتراضية وذاكرة 30 جيجابايت ، وهي مناسبة بشكل مثالي لاحتياجاتنا.
  3. Next, select a GPU. This depends on your workload; even a basic one like the T4 will markedly accelerate your model training.
  4. ضع علامة في المربع "تثبيت برنامج التشغيل NVIDIA GPU تلقائيًا عند بدء التشغيل لأول مرة؟" لإعداد خالٍ من المتاعب.
  5. قم بتخصيص قرص ثابت SSD بسعة 300 جيجابايت لضمان عدم حدوث اختناق في عمليات الإدخال / الإخراج.
  6. اضغط على "نشر" ودع GCP يقوم بسحره في توفير الجهاز الظاهري المخصص للتعلم العميق.

يأتي هذا الجهاز الظاهري محملا بكنز دفين من الأدوات والأطر المثبتة مسبقا ، بما في ذلك Anaconda Python التوزيع ، الذي يجمع بشكل ملائم جميع التبعيات اللازمة ل YOLOv5.

رسم توضيحي لسوق GCP لإعداد جهاز ظاهري للتعلم العميق

الخطوة 2: تجهيز الجهاز الظاهري ل YOLOv5

بعد إعداد البيئة ، دعنا نحصل على YOLOv5 قيد التشغيل:

# Clone the YOLOv5 repository
git clone https://github.com/ultralytics/yolov5

# Change the directory to the cloned repository
cd yolov5

# Install the necessary Python packages from requirements.txt
pip install -r requirements.txt

This setup process ensures you're working with a Python environment version 3.8.0 or newer and PyTorch 1.8 or above. Our scripts smoothly download models and datasets rending from the latest YOLOv5 release, making it hassle-free to start model training.

الخطوة 3: تدريب ونشر YOLOv5 نماذج 🌐

مع اكتمال الإعداد ، تكون جاهزا للخوض في التدريب والاستدلال باستخدام YOLOv5 على جهاز GCP الظاهري:

# Train a model on your data
python train.py

# Validate the trained model for Precision, Recall, and mAP
python val.py --weights yolov5s.pt

# Run inference using the trained model on your images or videos
python detect.py --weights yolov5s.pt --source path/to/images

# Export the trained model to other formats for deployment
python export.py --weights yolov5s.pt --include onnx coreml tflite

With just a few commands, YOLOv5 allows you to train custom object detection models tailored to your specific needs or utilize pre-trained weights for quick results on a variety of tasks.

صورة أمر المحطة الطرفية توضح تدريب النموذج على جهاز ظاهري للتعلم العميق من GCP

تخصيص مساحة مبادلة (اختياري)

بالنسبة إلى أولئك الذين يتعاملون مع مجموعات البيانات الضخمة، فكر في تضخيم مثيل GCP باستخدام ذاكرة تبديل إضافية بسعة 64 غيغابايت:

sudo fallocate -l 64G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h  # confirm the memory increment

أفكار ختامية

Congratulations! You are now empowered to harness the capabilities of YOLOv5 with the computational prowess of Google Cloud Platform. This combination provides scalability, efficiency, and versatility for your object detection tasks. Whether for personal projects, academic research, or industrial applications, you have taken a pivotal step into the world of AI and machine learning on the cloud.

تذكر توثيق رحلتك ومشاركة الأفكار مع Ultralytics ، والاستفادة من الساحات التعاونية مثل مناقشات GitHub لتحقيق المزيد من النمو. الآن ، انطلق وابتكر مع YOLOv5 و GCP! 🌟

هل تريد الاستمرار في تحسين مهاراتك ومعرفتك في ML؟ تعمق في وثائقنا وبرامجنا التعليمية للحصول على مزيد من الموارد. دع مغامرتك الذكاء الاصطناعي تستمر!

📅 Created 11 months ago ✏️ Updated 23 days ago

التعليقات