Update YOLO11 Actions and Docs (#16596)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
51e93d6111
commit
97f38409fb
124 changed files with 1948 additions and 1948 deletions
|
|
@ -1,14 +1,14 @@
|
|||
---
|
||||
comments: true
|
||||
description: Learn step-by-step how to deploy Ultralytics' YOLOv8 on Amazon SageMaker Endpoints, from setup to testing, for powerful real-time inference with AWS services.
|
||||
keywords: YOLOv8, Amazon SageMaker, AWS, Ultralytics, machine learning, computer vision, model deployment, AWS CloudFormation, AWS CDK, real-time inference
|
||||
description: Learn step-by-step how to deploy Ultralytics' YOLO11 on Amazon SageMaker Endpoints, from setup to testing, for powerful real-time inference with AWS services.
|
||||
keywords: YOLO11, Amazon SageMaker, AWS, Ultralytics, machine learning, computer vision, model deployment, AWS CloudFormation, AWS CDK, real-time inference
|
||||
---
|
||||
|
||||
# A Guide to Deploying YOLOv8 on Amazon SageMaker Endpoints
|
||||
# A Guide to Deploying YOLO11 on Amazon SageMaker Endpoints
|
||||
|
||||
Deploying advanced [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) models like [Ultralytics' YOLOv8](https://github.com/ultralytics/ultralytics) on Amazon SageMaker Endpoints opens up a wide range of possibilities for various [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) applications. The key to effectively using these models lies in understanding their setup, configuration, and deployment processes. YOLOv8 becomes even more powerful when integrated seamlessly with Amazon SageMaker, a robust and scalable machine learning service by AWS.
|
||||
Deploying advanced [computer vision](https://www.ultralytics.com/glossary/computer-vision-cv) models like [Ultralytics' YOLO11](https://github.com/ultralytics/ultralytics) on Amazon SageMaker Endpoints opens up a wide range of possibilities for various [machine learning](https://www.ultralytics.com/glossary/machine-learning-ml) applications. The key to effectively using these models lies in understanding their setup, configuration, and deployment processes. YOLO11 becomes even more powerful when integrated seamlessly with Amazon SageMaker, a robust and scalable machine learning service by AWS.
|
||||
|
||||
This guide will take you through the process of deploying YOLOv8 [PyTorch](https://www.ultralytics.com/glossary/pytorch) models on Amazon SageMaker Endpoints step by step. You'll learn the essentials of preparing your AWS environment, configuring the model appropriately, and using tools like AWS CloudFormation and the AWS Cloud Development Kit (CDK) for deployment.
|
||||
This guide will take you through the process of deploying YOLO11 [PyTorch](https://www.ultralytics.com/glossary/pytorch) models on Amazon SageMaker Endpoints step by step. You'll learn the essentials of preparing your AWS environment, configuring the model appropriately, and using tools like AWS CloudFormation and the AWS Cloud Development Kit (CDK) for deployment.
|
||||
|
||||
## Amazon SageMaker
|
||||
|
||||
|
|
@ -18,9 +18,9 @@ This guide will take you through the process of deploying YOLOv8 [PyTorch](https
|
|||
|
||||
[Amazon SageMaker](https://aws.amazon.com/sagemaker/) is a machine learning service from Amazon Web Services (AWS) that simplifies the process of building, training, and deploying machine learning models. It provides a broad range of tools for handling various aspects of machine learning workflows. This includes automated features for tuning models, options for training models at scale, and straightforward methods for deploying models into production. SageMaker supports popular machine learning frameworks, offering the flexibility needed for diverse projects. Its features also cover data labeling, workflow management, and performance analysis.
|
||||
|
||||
## Deploying YOLOv8 on Amazon SageMaker Endpoints
|
||||
## Deploying YOLO11 on Amazon SageMaker Endpoints
|
||||
|
||||
Deploying YOLOv8 on Amazon SageMaker lets you use its managed environment for real-time inference and take advantage of features like autoscaling. Take a look at the AWS architecture below.
|
||||
Deploying YOLO11 on Amazon SageMaker lets you use its managed environment for real-time inference and take advantage of features like autoscaling. Take a look at the AWS architecture below.
|
||||
|
||||
<p align="center">
|
||||
<img width="640" src="https://github.com/ultralytics/docs/releases/download/0/aws-architecture.avif" alt="AWS Architecture">
|
||||
|
|
@ -40,9 +40,9 @@ First, ensure you have the following prerequisites in place:
|
|||
|
||||
- Adequate Service Quota: Confirm that you have sufficient quotas for two separate resources in Amazon SageMaker: one for `ml.m5.4xlarge` for endpoint usage and another for `ml.m5.4xlarge` for notebook instance usage. Each of these requires a minimum of one quota value. If your current quotas are below this requirement, it's important to request an increase for each. You can request a quota increase by following the detailed instructions in the [AWS Service Quotas documentation](https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html#quota-console-increase).
|
||||
|
||||
### Step 2: Clone the YOLOv8 SageMaker Repository
|
||||
### Step 2: Clone the YOLO11 SageMaker Repository
|
||||
|
||||
The next step is to clone the specific AWS repository that contains the resources for deploying YOLOv8 on SageMaker. This repository, hosted on GitHub, includes the necessary CDK scripts and configuration files.
|
||||
The next step is to clone the specific AWS repository that contains the resources for deploying YOLO11 on SageMaker. This repository, hosted on GitHub, includes the necessary CDK scripts and configuration files.
|
||||
|
||||
- Clone the GitHub Repository: Execute the following command in your terminal to clone the host-yolov8-on-sagemaker-endpoint repository:
|
||||
|
||||
|
|
@ -104,11 +104,11 @@ cdk bootstrap
|
|||
cdk deploy
|
||||
```
|
||||
|
||||
### Step 5: Deploy the YOLOv8 Model
|
||||
### Step 5: Deploy the YOLO Model
|
||||
|
||||
Before diving into the deployment instructions, be sure to check out the range of [YOLOv8 models offered by Ultralytics](../models/index.md). This will help you choose the most appropriate model for your project requirements.
|
||||
Before diving into the deployment instructions, be sure to check out the range of [YOLO11 models offered by Ultralytics](../models/index.md). This will help you choose the most appropriate model for your project requirements.
|
||||
|
||||
After creating the AWS CloudFormation Stack, the next step is to deploy YOLOv8.
|
||||
After creating the AWS CloudFormation Stack, the next step is to deploy YOLO11.
|
||||
|
||||
- Open the Notebook Instance: Go to the AWS Console and navigate to the Amazon SageMaker service. Select "Notebook Instances" from the dashboard, then locate the notebook instance that was created by your CDK deployment script. Open the notebook instance to access the Jupyter environment.
|
||||
|
||||
|
|
@ -136,18 +136,18 @@ def output_fn(prediction_output):
|
|||
return json.dumps(infer)
|
||||
```
|
||||
|
||||
- Deploy the Endpoint Using 1_DeployEndpoint.ipynb: In the Jupyter environment, open the 1_DeployEndpoint.ipynb notebook located in the sm-notebook directory. Follow the instructions in the notebook and run the cells to download the YOLOv8 model, package it with the updated inference code, and upload it to an Amazon S3 bucket. The notebook will guide you through creating and deploying a SageMaker endpoint for the YOLOv8 model.
|
||||
- Deploy the Endpoint Using 1_DeployEndpoint.ipynb: In the Jupyter environment, open the 1_DeployEndpoint.ipynb notebook located in the sm-notebook directory. Follow the instructions in the notebook and run the cells to download the YOLO11 model, package it with the updated inference code, and upload it to an Amazon S3 bucket. The notebook will guide you through creating and deploying a SageMaker endpoint for the YOLO11 model.
|
||||
|
||||
### Step 6: Testing Your Deployment
|
||||
|
||||
Now that your YOLOv8 model is deployed, it's important to test its performance and functionality.
|
||||
Now that your YOLO11 model is deployed, it's important to test its performance and functionality.
|
||||
|
||||
- Open the Test Notebook: In the same Jupyter environment, locate and open the 2_TestEndpoint.ipynb notebook, also in the sm-notebook directory.
|
||||
|
||||
- Run the Test Notebook: Follow the instructions within the notebook to test the deployed SageMaker endpoint. This includes sending an image to the endpoint and running inferences. Then, you'll plot the output to visualize the model's performance and [accuracy](https://www.ultralytics.com/glossary/accuracy), as shown below.
|
||||
|
||||
<p align="center">
|
||||
<img width="640" src="https://github.com/ultralytics/docs/releases/download/0/testing-results-yolov8.avif" alt="Testing Results YOLOv8">
|
||||
<img width="640" src="https://github.com/ultralytics/docs/releases/download/0/testing-results-yolov8.avif" alt="Testing Results YOLO11">
|
||||
</p>
|
||||
|
||||
- Clean-Up Resources: The test notebook will also guide you through the process of cleaning up the endpoint and the hosted model. This is an important step to manage costs and resources effectively, especially if you do not plan to use the deployed model immediately.
|
||||
|
|
@ -160,24 +160,24 @@ After testing, continuous monitoring and management of your deployed model are e
|
|||
|
||||
- Manage the Endpoint: Use the SageMaker console for ongoing management of the endpoint. This includes scaling, updating, or redeploying the model as required.
|
||||
|
||||
By completing these steps, you will have successfully deployed and tested a YOLOv8 model on Amazon SageMaker Endpoints. This process not only equips you with practical experience in using AWS services for machine learning deployment but also lays the foundation for deploying other advanced models in the future.
|
||||
By completing these steps, you will have successfully deployed and tested a YOLO11 model on Amazon SageMaker Endpoints. This process not only equips you with practical experience in using AWS services for machine learning deployment but also lays the foundation for deploying other advanced models in the future.
|
||||
|
||||
## Summary
|
||||
|
||||
This guide took you step by step through deploying YOLOv8 on Amazon SageMaker Endpoints using AWS CloudFormation and the AWS Cloud Development Kit (CDK). The process includes cloning the necessary GitHub repository, setting up the CDK environment, deploying the model using AWS services, and testing its performance on SageMaker.
|
||||
This guide took you step by step through deploying YOLO11 on Amazon SageMaker Endpoints using AWS CloudFormation and the AWS Cloud Development Kit (CDK). The process includes cloning the necessary GitHub repository, setting up the CDK environment, deploying the model using AWS services, and testing its performance on SageMaker.
|
||||
|
||||
For more technical details, refer to [this article](https://aws.amazon.com/blogs/machine-learning/hosting-yolov8-pytorch-model-on-amazon-sagemaker-endpoints/) on the AWS Machine Learning Blog. You can also check out the official [Amazon SageMaker Documentation](https://docs.aws.amazon.com/sagemaker/latest/dg/realtime-endpoints.html) for more insights into various features and functionalities.
|
||||
|
||||
Are you interested in learning more about different YOLOv8 integrations? Visit the [Ultralytics integrations guide page](../integrations/index.md) to discover additional tools and capabilities that can enhance your machine-learning projects.
|
||||
Are you interested in learning more about different YOLO11 integrations? Visit the [Ultralytics integrations guide page](../integrations/index.md) to discover additional tools and capabilities that can enhance your machine-learning projects.
|
||||
|
||||
## FAQ
|
||||
|
||||
### How do I deploy the Ultralytics YOLOv8 model on Amazon SageMaker Endpoints?
|
||||
### How do I deploy the Ultralytics YOLO11 model on Amazon SageMaker Endpoints?
|
||||
|
||||
To deploy the Ultralytics YOLOv8 model on Amazon SageMaker Endpoints, follow these steps:
|
||||
To deploy the Ultralytics YOLO11 model on Amazon SageMaker Endpoints, follow these steps:
|
||||
|
||||
1. **Set Up Your AWS Environment**: Ensure you have an AWS Account, IAM roles with necessary permissions, and the AWS CLI configured. Install AWS CDK if not already done (refer to the [AWS CDK instructions](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html#getting_started_install)).
|
||||
2. **Clone the YOLOv8 SageMaker Repository**:
|
||||
2. **Clone the YOLO11 SageMaker Repository**:
|
||||
```bash
|
||||
git clone https://github.com/aws-samples/host-yolov8-on-sagemaker-endpoint.git
|
||||
cd host-yolov8-on-sagemaker-endpoint/yolov8-pytorch-cdk
|
||||
|
|
@ -196,11 +196,11 @@ To deploy the Ultralytics YOLOv8 model on Amazon SageMaker Endpoints, follow the
|
|||
cdk deploy
|
||||
```
|
||||
|
||||
For further details, review the [documentation section](#step-5-deploy-the-yolov8-model).
|
||||
For further details, review the [documentation section](#step-5-deploy-the-yolo-model).
|
||||
|
||||
### What are the prerequisites for deploying YOLOv8 on Amazon SageMaker?
|
||||
### What are the prerequisites for deploying YOLO11 on Amazon SageMaker?
|
||||
|
||||
To deploy YOLOv8 on Amazon SageMaker, ensure you have the following prerequisites:
|
||||
To deploy YOLO11 on Amazon SageMaker, ensure you have the following prerequisites:
|
||||
|
||||
1. **AWS Account**: Active AWS account ([sign up here](https://aws.amazon.com/)).
|
||||
2. **IAM Roles**: Configured IAM roles with permissions for SageMaker, CloudFormation, and Amazon S3.
|
||||
|
|
@ -210,9 +210,9 @@ To deploy YOLOv8 on Amazon SageMaker, ensure you have the following prerequisite
|
|||
|
||||
For detailed setup, refer to [this section](#step-1-setup-your-aws-environment).
|
||||
|
||||
### Why should I use Ultralytics YOLOv8 on Amazon SageMaker?
|
||||
### Why should I use Ultralytics YOLO11 on Amazon SageMaker?
|
||||
|
||||
Using Ultralytics YOLOv8 on Amazon SageMaker offers several advantages:
|
||||
Using Ultralytics YOLO11 on Amazon SageMaker offers several advantages:
|
||||
|
||||
1. **Scalability and Management**: SageMaker provides a managed environment with features like autoscaling, which helps in real-time inference needs.
|
||||
2. **Integration with AWS Services**: Seamlessly integrate with other AWS services, such as S3 for data storage, CloudFormation for infrastructure as code, and CloudWatch for monitoring.
|
||||
|
|
@ -221,9 +221,9 @@ Using Ultralytics YOLOv8 on Amazon SageMaker offers several advantages:
|
|||
|
||||
Explore more about the advantages of using SageMaker in the [introduction section](#amazon-sagemaker).
|
||||
|
||||
### Can I customize the inference logic for YOLOv8 on Amazon SageMaker?
|
||||
### Can I customize the inference logic for YOLO11 on Amazon SageMaker?
|
||||
|
||||
Yes, you can customize the inference logic for YOLOv8 on Amazon SageMaker:
|
||||
Yes, you can customize the inference logic for YOLO11 on Amazon SageMaker:
|
||||
|
||||
1. **Modify `inference.py`**: Locate and customize the `output_fn` function in the `inference.py` file to tailor output formats.
|
||||
|
||||
|
|
@ -243,11 +243,11 @@ Yes, you can customize the inference logic for YOLOv8 on Amazon SageMaker:
|
|||
|
||||
2. **Deploy Updated Model**: Ensure you redeploy the model using Jupyter notebooks provided (`1_DeployEndpoint.ipynb`) to include these changes.
|
||||
|
||||
Refer to the [detailed steps](#step-5-deploy-the-yolov8-model) for deploying the modified model.
|
||||
Refer to the [detailed steps](#step-5-deploy-the-yolo-model) for deploying the modified model.
|
||||
|
||||
### How can I test the deployed YOLOv8 model on Amazon SageMaker?
|
||||
### How can I test the deployed YOLO11 model on Amazon SageMaker?
|
||||
|
||||
To test the deployed YOLOv8 model on Amazon SageMaker:
|
||||
To test the deployed YOLO11 model on Amazon SageMaker:
|
||||
|
||||
1. **Open the Test Notebook**: Locate the `2_TestEndpoint.ipynb` notebook in the SageMaker Jupyter environment.
|
||||
2. **Run the Notebook**: Follow the notebook's instructions to send an image to the endpoint, perform inference, and display results.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue