{"id":19986505,"url":"https://github.com/bentoml/pneumonia-detection-demo","last_synced_at":"2025-05-04T07:31:27.076Z","repository":{"id":176561409,"uuid":"623706807","full_name":"bentoml/Pneumonia-Detection-Demo","owner":"bentoml","description":"Pneumonia Detection - Healthcare Imaging Application built with BentoML and fine-tuned Vision Transformer (ViT) model","archived":false,"fork":false,"pushed_at":"2023-06-26T19:20:08.000Z","size":338,"stargazers_count":8,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-25T06:41:07.075Z","etag":null,"topics":["computer-vision","health-care-application","healthcare","healthcare-imaging","transformer"],"latest_commit_sha":null,"homepage":"https://bentoml.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bentoml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-04-04T23:11:27.000Z","updated_at":"2024-04-05T15:09:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae05d960-0ae4-4a89-88df-3de4a64692d3","html_url":"https://github.com/bentoml/Pneumonia-Detection-Demo","commit_stats":null,"previous_names":["bentoml/pneumonia-detection-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FPneumonia-Detection-Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FPneumonia-Detection-Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FPneumonia-Detection-Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bentoml%2FPneumonia-Detection-Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bentoml","download_url":"https://codeload.github.com/bentoml/Pneumonia-Detection-Demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252304720,"owners_count":21726610,"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":["computer-vision","health-care-application","healthcare","healthcare-imaging","transformer"],"created_at":"2024-11-13T04:29:26.891Z","updated_at":"2025-05-04T07:31:27.071Z","avatar_url":"https://github.com/bentoml.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1 align=\"center\"\u003ePneumonia Detection with BentoML\u003c/h1\u003e\n    \u003cbr\u003e\n    \u003cstrong\u003e Healthcare AI 🫁🔍- Made Easy with BentoML\u003cbr\u003e\u003c/strong\u003e\n    \u003ci\u003ePowered by BentoML 🍱 + HuggingFace 🤗\u003c/i\u003e\n    \u003cbr\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n## 📖 Introduction 📖\nIn this project, we showcase the seamless integration of an image detection model into a service using BentoML. Leveraging the power of the pretrained `nickmuchi/vit-finetuned-chest-xray-pneumonia model` from HuggingFace, users can submit their lung X-ray images for analysis. The model will then determine, with precision, whether the individual has pneumonia or not.\n\n\n📝 **Disclaimer: Please note that this project is not intended to replace professional medical advice. It is designed purely for demonstration and testing purposes. Always consult with a qualified healthcare professional for a proper diagnosis.**\n\n| Normal | Pneumonia                               \t|\n|------- |-----------------------------------------\t|\n| ![Normal](samples/NORMAL2-IM-1427-0001.jpeg)| ![Pneumonia](samples/person1950_bacteria_4881.jpeg) |\n\n## 🏃‍♂️ Running the Service 🏃‍♂️\n### BentoML CLI\nClone the repository and install the dependencies:\n```bash\ngit clone https://github.com/bentoml/Pneumonia-Detection-demo.git \u0026\u0026 cd Pneumonia-Detection-demo\n\npip install -r requirements/pypi.txt\n```\n\nTo serve the model with BentoML:\n```\nbentoml serve\n```\n\nYou can then open your browser at http://127.0.0.1:3000 and interact with the service through Swagger UI.\n\n### Containers\n We provide two pre-built containers optimized for CPU and GPU usage, respectively. \n\nTo run the service, you'll need a container engine such as Docker, Podman, etc. Quickly test the service by running the appropriate container:\n\n```bash\n# cpu\ndocker run -p 3000:3000 ghcr.io/bentoml/pneumonia-detection-demo:cpu\n\n# gpu\ndocker run --gpus all -p 3000:3000 ghcr.io/bentoml/pneumonia-detection-demo:gpu\n```\n\n## 🌐 Interacting with the Service 🌐\nBentoML's default model serving method is through an HTTP server. In this section, we demonstrate various ways to interact with the service:\n### cURL\n```bash\ncurl -X 'POST' \\\n  'http://localhost:3000/v1/classify' \\\n  -H 'accept: application/json' \\\n  -H 'Content-Type: image/mpo' \\\n  --data-binary '@path-to-image'\n```\n\u003e Replace `path-to-image` with the file path of the image you want to send to the service.\n\nThe response look like:\n```json\n{\"class_name\":\"NORMAL\"}\n```\n### Via BentoClient 🐍\nTo send requests in Python, one can use ``bentoml.client.Client`` to send requests to the service. Check out `client.py` for the example code.\n\n### Swagger UI\nYou can use Swagger UI to quickly explore the available endpoints of any BentoML service.\n\n## 🚀 Deploying to Production 🚀\nEffortlessly transition your project into a production-ready application using [BentoCloud](https://www.bentoml.com/bento-cloud/), the production-ready platform for managing and deploying machine learning models.\n\nStart by creating a BentoCloud account. Once you've signed up, log in to your BentoCloud account using the command:\n\n```bash\nbentoml cloud login --api-token \u003cyour-api-token\u003e --endpoint \u003cbento-cloud-endpoint\u003e\n```\n\u003e Note: Replace `\u003cyour-api-token\u003e` and `\u003cbento-cloud-endpoint\u003e` with your specific API token and the BentoCloud endpoint respectively.\n\nNext, build your BentoML service using the `build` command:\n\n```bash\nbentoml build\n```\n\nThen, push your freshly-built Bento service to BentoCloud using the `push` command:\n\n```bash\nbentoml push \u003cname:version\u003e\n```\n\nLastly, deploy this application to BentoCloud with a single `bentoml deployment create` command following the [deployment instructions](https://docs.bentoml.org/en/latest/reference/cli.html#bentoml-deployment-create).\n\nBentoML offers a number of options for deploying and hosting online ML services into production, learn more at [Deploying a Bento](https://docs.bentoml.org/en/latest/concepts/deploy.html).\n\n## 👥 Community 👥\nBentoML has a thriving open source community where thousands of ML/AI practitioners are \ncontributing to the project, helping other users and discussing the future of AI. 👉 [Pop into our Slack community!](https://l.bentoml.com/join-slack)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentoml%2Fpneumonia-detection-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbentoml%2Fpneumonia-detection-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbentoml%2Fpneumonia-detection-demo/lists"}