Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YOLOv5 container on AWS Marketplace #6502

Open
2 tasks done
g0lemXIV opened this issue Feb 2, 2022 · 24 comments
Open
2 tasks done

YOLOv5 container on AWS Marketplace #6502

g0lemXIV opened this issue Feb 2, 2022 · 24 comments
Assignees
Labels
enhancement New feature or request TODO High priority items

Comments

@g0lemXIV
Copy link

g0lemXIV commented Feb 2, 2022

Search before asking

  • I have searched the YOLOv5 issues and found no similar feature requests.

Description

I want to write an article about SageMaker model training especially Object Detection models. The choice fell on yolov5 because you've done fantastic work! Is it possible to make this a feature for the repository?

I can make a complete pipeline for training the yolov5 model and deploying it as an endpoint/batch transform as containers available on AWS Marketplace.

Use case

Training:
A user wants to train the yolov5 model on AWS Sagemaker but doesn't have experience. Users can "fork" ready-to-use containers from the marketplace and use them for training.

Deploying:
A user can use the yolov5 container to deploy a custom or pretrained model with a few clicks.

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@g0lemXIV g0lemXIV added the enhancement New feature or request label Feb 2, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2022

👋 Hello @g0lemXIV, thank you for your interest in YOLOv5 🚀! Please visit our ⭐️ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.

If this is a 🐛 Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.

For business inquiries or professional support requests please visit https://ultralytics.com or email support@ultralytics.com.

Requirements

Python>=3.7.0 with all requirements.txt installed including PyTorch>=1.7. To get started:

git clone https://github.com/ultralytics/yolov5  # clone
cd yolov5
pip install -r requirements.txt  # install

Environments

YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

CI CPU testing

If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.

@glenn-jocher
Copy link
Member

glenn-jocher commented Feb 2, 2022

@g0lemXIV this sounds like an awesome idea! I haven't used sagemaker myself, I've been to busy drinking coffee and making the world's best vision AI over here on GitHub haha.

We do have Docker images ready to go here. These are created with Docker Autobuild and are always up to date with master:
https://hub.docker.com/r/ultralytics/yolov5

We also have a quick AWS tutorial meant for using YOLOv5 on EC2:
https://docs.ultralytics.com/yolov5/environments/aws_quickstart_tutorial/

But no sagemaker or marketplace images! What do we need to do to get started? Could you help explain the steps and what's required from us? Thanks!

EDIT: I've reached out to our Amazon contact to see if they can help us get registered on Marketplace so we can provide an official container.

@glenn-jocher glenn-jocher added the TODO High priority items label Feb 2, 2022
@g0lemXIV
Copy link
Author

g0lemXIV commented Feb 3, 2022

@glenn-jocher basically, SageMaker is a complete data science platform with data labelling, training, deploying and hyperparameters optimization. You also have standard notebooks to prototype. So it is possible to get a fully working model within the marketplace, train it or deploy it in a few minutes.

Because you've done fantastic work with torch hub for deployment, we need only one script similar to this aws-code

The training differs because we need a specific setting through the .sh / .py script, but I've done similar work in the past.

We can make deployment scripts and add them to the aws marketplace it may work similarly to mxnet-yolov3

Where in settings, users can:

  • Use a custom model
  • Choose architecture and any parameters
  • Choose between return tagged images or JSON file

Then I think we can take care of the training container. What do you think?

@glenn-jocher glenn-jocher changed the title Yolov5 container on AWS Marketplace YOLOv5 container on AWS Marketplace Feb 4, 2022
@glenn-jocher
Copy link
Member

@g0lemXIV I've reached out to AWS but am having trouble getting their team to return emails. I don't want to drag our feet on this since it seems like a great idea. Can you take the lead on this and let me know what next steps are and what I can do to help?

@ghost
Copy link

ghost commented Mar 17, 2022

@g0lemXIV Hi, have you managed to deploy yolov5 to sagemaker ?

@g0lemXIV
Copy link
Author

@sinatimelapse it is relatively easy with yolov5 torch hub and this script inference.py for pytroch

@glenn-jocher sorry that I didn't respond. I had a busy month...
I think I will do the commitment in the next two weeks for inference script and then for training.

@glenn-jocher
Copy link
Member

@g0lemXIV great thanks!

@ghost
Copy link

ghost commented Mar 18, 2022

@g0lemXIV Could you elaborate more please ? I've never used sagemaker !

@g0lemXIV
Copy link
Author

g0lemXIV commented Mar 18, 2022

@sinatimelapse please read a few examples about sagemaker, sagemaker SDK and then look at the inference.py again. It will be pretty easy tho to do this. Otherwise, you can wait for scripts for yolov5, I can notify you when I pr.

(edit) You have there a full example in a jupyter notebook with the code. code for pytorch inference
You need to implement image loading, loading model from torch hub, make inference and finally return JSON with bbox or image

@ghost
Copy link

ghost commented Mar 18, 2022

Thank you for your answer, I'm new on AWS, I would be very happy if you notify me when you commit the scripts for yolov5.

@ghost
Copy link

ghost commented Apr 4, 2022

@g0lemXIV Hello, have you uploaded the yolov5's scripts, I didn't manage to deploy yolov5 to sagemaker, thank you in advance.

@glenn-jocher
Copy link
Member

@g0lemXIV @sinatimelapse I've reached out again to AWS but they have been unresponsive unfortunately.

@g0lemXIV
Copy link
Author

g0lemXIV commented Apr 6, 2022

@sinatimelapse do not stalk people on each social media platform!

Because you deleted the tweet since I responded. I write it again here
When I have time I will work on those scripts. Open Source doesn't mean "do by other hands!". I've explained to you how to deploy yolov5 on the sagemaker. If you still have problems with those I can do this for you faster for cash

Do not stalk me on mail, LinkedIn, Twitter, etc...

@ghost
Copy link

ghost commented Apr 6, 2022

@g0lemXIV as far as I can see I have not stalked you I juste wanted a response from you since you have not responded here, I thought that you have not read my question, I've done the same thing with someone else and they have answered to my question kindly, if you don't want to help or you don't know the answer, juste say it, and I'm not asking you to work at my place, I'm juste curious to know how you managed to deploy it on sagemaker, the forums are created for helping each other, not for disrespecting each other.

@g0lemXIV
Copy link
Author

g0lemXIV commented Apr 6, 2022

@sinatimelapse As far as I know, I helped you with the comment above pointing to all necessary scripts that help deploy the model on aws. If you don't understand that, you should reserve your time to study sagemaker not to irritate people on all possible channels. That's all from me.

@ghost
Copy link

ghost commented Apr 6, 2022

sorry, I have never meant to irritate you, please accept my sincere excuses, have a good day !

@glenn-jocher
Copy link
Member

@g0lemXIV @sinatimelapse alright guys I'm on this. I travelled from Madrid, Spain to the AWS summit in San Francisco this week, and I'm meeting in person with their Marketplace and Sagemaker teams to get YOLOv5 officially represented and launched on both.

This must be the most personalized service ever for an open-source AI 😂.

IMG_1680

@ghost
Copy link

ghost commented Apr 22, 2022

Wonderful news, I can't wait to see this

@g0lemXIV
Copy link
Author

g0lemXIV commented May 9, 2022

@glenn-jocher I found that aws prepare a sample for local deployment with the yolov5 package here: https://github.com/aws-samples/amazon-sagemaker-local-mode/tree/main/pytorch_yolov5_local_model_inference
Creating the model package and inference endpoint/batch transform needs to be changed from local mode to sagemaker instance to generate the model package and inference endpoint/batch transform.

@pablosnascimento
Copy link

Any updates about it?! :D

@glenn-jocher
Copy link
Member

@pablosnascimento thank you for your interest in YOLOv5. We are constantly looking for ways to improve the project and make it more accessible to everyone. As for the AWS Marketplace and SageMaker integration, we have made progress in this area and are actively working on it. We will be sure to update the community once it becomes available. Thank you for your patience and support!

@aounleonardo
Copy link

Hi @glenn-jocher thanks for you effort so far! Any update on this though?

@aounleonardo
Copy link

aounleonardo commented Jan 31, 2024

(edit) You have there a full example in a jupyter notebook with the code. code for pytorch inference You need to implement image loading, loading model from torch hub, make inference and finally return JSON with bbox or image

Wouldn't this throw an error if yolov5 is not installed in the image uri? @g0lemXIV

@glenn-jocher
Copy link
Member

Hi there! If YOLOv5 is not already installed in the image used by SageMaker, you will indeed encounter errors when trying to run inference. To avoid this, ensure that your Docker container has YOLOv5 installed either by building it into your Dockerfile or by installing it as part of the setup process before running your Jupyter notebook. This way, all necessary dependencies are in place when you execute your code. 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request TODO High priority items
Projects
None yet
Development

No branches or pull requests

4 participants