{"id":21358929,"url":"https://github.com/arnabd64/yolov8-bentoml","last_synced_at":"2025-03-16T06:18:07.308Z","repository":{"id":282662301,"uuid":"891365831","full_name":"arnabd64/YOLOv8-BentoML","owner":"arnabd64","description":"Simple BentoML application for YOLOv8","archived":false,"fork":false,"pushed_at":"2024-11-21T10:10:19.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T06:18:04.337Z","etag":null,"topics":["bentoml","mlops-workflow","object-detection","ultralytics","yolov8"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arnabd64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T07:52:17.000Z","updated_at":"2024-11-21T10:14:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"05d8ce89-447f-4388-b6d8-57012f01a5f1","html_url":"https://github.com/arnabd64/YOLOv8-BentoML","commit_stats":null,"previous_names":["arnabd64/yolov8-bentoml"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnabd64%2FYOLOv8-BentoML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnabd64%2FYOLOv8-BentoML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnabd64%2FYOLOv8-BentoML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arnabd64%2FYOLOv8-BentoML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arnabd64","download_url":"https://codeload.github.com/arnabd64/YOLOv8-BentoML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243831072,"owners_count":20354880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bentoml","mlops-workflow","object-detection","ultralytics","yolov8"],"created_at":"2024-11-22T05:23:07.673Z","updated_at":"2025-03-16T06:18:07.254Z","avatar_url":"https://github.com/arnabd64.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YOLOv8 Object Detection using BentoML\n\nA simple RESTful application to deploy an __YOLOv8 Object Detection__ model using __BentoML__ framework. I have tried the best of my knowedge to build this application that is highly configurable and help the community to build more Machine Learning Applications using BentoML.\n\nHere are the reasons why I think BentoML is an excellent framework.\n\n1. __Easy to Code__ which leads to a significant speed up in developing inference APIs for out models.\n2. __Integration with Popular Frameworks__ like Pytorch, Tensorflow, Huggingface, ONNX and more.\n3. __Inbuilt Adaptive batching__ helps to speed up the API requests in a high traffic scenario.\n4. __Inbuilt Logging, Tracing and Metrics__ for better observability.\n5. __Integration with Gradio__ that helps me built easy to use UI for faster prototyping and testing.\n\n## Ultralytics - YOLOv8\n\n__YOLOv8__ was the state-of-the-art Object Detection model released back in early 2023. It is primarily known for balancing between prediction accuracy and latency, these models can perform efficiently even on a dual core CPU with 2GB of system RAM. There are 5 models in the YOLOv8 family from Nano Model(`yolov8n`) to eXtra Large Model(`yolov8x`).\n\n| Model  | Model Name   | Params (millions) | mAP (50-75) |\n| ------ | ------------ | ----------------- | ----------- |\n| Nano   | `yolov8n.pt` | 3.2  | 37.3 |\n| Small  | `yolov8s.pt` | 11.2 | 44.9 |\n| Medium | `yolov8m.pt` | 25.9 | 50.2 |\n| Large  | `yolov8l.pt` | 43.7 | 52.9 |\n| XL     | `yolov8x.pt` | 68.2 | 53.9 |\n\nRun the following code to download and use YOLOv8 models in your code:\n```python\nfrom ultralytics import YOLO\nmodel = YOLO(`yolov8s.pt`)\n```\n\n## BentoML\n\n__BentoML__ is a python framework to speed the deployment process for ML models. The framework speeds up the creation of RESTful APIs, Inference optimizations and Containerization of the application.\n\nIn this project we will be exploring the `Service` API of BentoML in depth along with integrating a Gradio Application. A `Service` can be thought of as a collection of endpoints serving a single model.\n\nI have written the inference code for YOLOv8 on the python script `service.py`, a `Service` is defined by a python class decorated with the `bentoml.serivce` decorator. All the settings are passed as arguments to this decorator which is stored in an YAML file named `bento-settings.yaml` The documentation for all the settings can be found on the [BentoML docs](https://docs.bentoml.org/en/latest/guides/configurations.html) page as well as a sample YAML file on [GitHub](https://github.com/bentoml/BentoML/blob/1.3/src/bentoml/_internal/configuration/v2/default_configuration.yaml).\n\n## Bentofile\n\nThe `bentofile.yaml` is a contains a the [build options](https://docs.bentoml.org/en/latest/guides/build-options.html) needed to containerize the project. You can think of a `bentofile` similar to a `Dockerfile`. The purpose of both these scripts to build a __Docker Image__ for our project but unlike a Dockerfile, a bentofile contains only configurations and settings instead of commands, in a Dockerfile, in order to build the image. This in-turn simplifies the building process.\n\nTo build a docker image using `bentofile`, run the following commands on the terminal:\n\n```bash\n# build a 'Bento'\n$ bentoml build\n\n# build a Docker image\n# you will find the command to containerize the project after a sucessful run of the above command\n$ bentoml containerize yolo_service:\u003cunique_tag\u003e\n\n# Run the container\n$ docker run -itd --rm --name=yolo -p 5000:5000 yolo_service:\u003cunique_tag\u003e\n\n# Check the logs\n$ docker compose logs yolo\n```\n\n## Run a Local Server\n\nOn your terminal, run:\n```bash\n# {py file containing bento service}:{Service Name}\n$ bentoml serve service:YoloService\n```\n\n\n## Links\n\n* [BentoML](https://docs.bentoml.com/en/latest)\n* [Ultralytics](https://docs.ultralytics.com/)\n* [Ultralytics - YOLOv8](https://docs.ultralytics.com/models/yolov8/#key-features)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnabd64%2Fyolov8-bentoml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farnabd64%2Fyolov8-bentoml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farnabd64%2Fyolov8-bentoml/lists"}