This repository contains code and instructions for deploying YOLOv8 on AWS Lambda. The accompanying blog post, "HowTo: Deploying YOLOv8 on AWS Lambda," can be found here.
Before you begin, make sure you have the following requirements installed:
- AWS SAM
- Docker (optionally): if you want to build your Lambda deployment package within a Docker container, otherwise make sure you have the same python version as indicated in the template.yaml file.
Follow these steps to get started with deploying YOLOv8 on AWS Lambda:
- Clone this repository to your local machine.
git clone https://github.com/trainyolo/YOLOv8-aws-lambda
-
Place your YOLOv8 ONNX model in the lambda-codebase/models directory within the cloned repository.
-
In the lambda-codebase/app.py file, change the name of the YOLOv8 model to match the filename of the model you placed in the models directory.
-
Deploy the project using AWS SAM:
sam build --use-container
sam deploy --guided
Follow the prompts to deploy your YOLOv8 model on AWS Lambda.
To test the API endpoint, follow these steps:
In the test/test_api.py file, change the URL to match the endpoint of your deployed AWS Lambda function.
Run the test script:
python test/test_api.py
This project is licensed under the MIT License.
If you have any questions or feedback, you can reach out to davy@trainyolo.com