{"id":24989809,"url":"https://github.com/clementsan/object_detection_lambda","last_synced_at":"2026-04-10T22:46:48.710Z","repository":{"id":270412630,"uuid":"907499020","full_name":"clementsan/object_detection_lambda","owner":"clementsan","description":"Object detection using AWS Lambda","archived":false,"fork":false,"pushed_at":"2025-01-13T20:34:03.000Z","size":242,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T12:15:23.076Z","etag":null,"topics":["ai","aws","aws-lambda","computer-vision","deep-learning","gradio","huggingface","huggingface-spaces","object-detection"],"latest_commit_sha":null,"homepage":"","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/clementsan.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":"2024-12-23T18:09:00.000Z","updated_at":"2025-01-13T20:34:07.000Z","dependencies_parsed_at":"2024-12-31T01:17:37.459Z","dependency_job_id":"6bfeadca-767d-423d-8b62-136e1a34f02e","html_url":"https://github.com/clementsan/object_detection_lambda","commit_stats":null,"previous_names":["clementsan/object_detection_lambda"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/clementsan/object_detection_lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clementsan","download_url":"https://codeload.github.com/clementsan/object_detection_lambda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_lambda/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267527835,"owners_count":24102019,"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","status":"online","status_checked_at":"2025-07-28T02:00:09.689Z","response_time":68,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","aws","aws-lambda","computer-vision","deep-learning","gradio","huggingface","huggingface-spaces","object-detection"],"created_at":"2025-02-04T13:03:34.584Z","updated_at":"2026-04-10T22:46:43.678Z","avatar_url":"https://github.com/clementsan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\ntitle: Object Detection Lambda\nemoji: 🌖\ncolorFrom: purple\ncolorTo: green\nsdk: gradio\nsdk_version: 5.5.0\napp_file: app.py\npinned: false\nshort_description: Object detection Lambda\n---\n\n# Object detection via AWS Lambda\n\n[![](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/cvachet/object-detection-lambda)](https://hub.docker.com/repository/docker/cvachet/object-detection-lambda)\n[![code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/pylint-dev/pylint)\n\n![example workflow](https://github.com/clementsan/object_detection_lambda/actions/workflows/ci_python.yml/badge.svg)\n![example workflow](https://github.com/clementsan/object_detection_lambda/actions/workflows/publish_docker_image.yml/badge.svg)\n![example workflow](https://github.com/clementsan/object_detection_lambda/actions/workflows/sync_HFSpace.yml/badge.svg)\n\n**Aim: AI-driven object detection task**\n\nArchitecture:\n - Front-end: user interface via Gradio library\n - Back-end: use of AWS Lambda function to run deployed ML model\n\nYou can try out our deployed [Hugging Face Space](https://huggingface.co/spaces/cvachet/object_detection_lambda\n)!\n\n----\n**Table of contents:**\n - [Local development](#1-local-development)\n - [AWS deployment](#2-deployment-to-aws)\n - [Hugging Face deployment](#3-deployment-to-hugging-face)\n - [Docker Hub deployment](#4-deployment-to-docker-hub)\n----\n\n## 1. Local development\n\n### 1.1. Build and run the Docker container\n\n\u003cdetails\u003e\n\nStep 1 - Building the docker image\n\nbash\n\u003e docker build -t object-detection-lambda .\n\nStep 2 - Running the docker container locally\n\nbash\n\n\u003e docker run --name object-detection-lambda-cont -p 8080:8080 object-detection-lambda\n\n\u003c/details\u003e\n\n### 1.2. Execution via user interface\nUse of Gradio library for web interface\n\n**Note:** The environment variable ```AWS_API``` should point to the local container\n\u003e export AWS_API=http://localhost:8080\n\nCommand line for execution:\n\u003e python3 app.py\n\nThe Gradio web application should now be accessible at http://localhost:7860\n\n\n### 1.3. Execution via command line:\n\nExample of a prediction request\n\nbash\n\u003e encoded_image=$(base64 -i ./tests/data/boats.jpg)\n\n\u003e curl -X POST \"http://localhost:8080/2015-03-31/functions/function/invocations\" \\\n\u003e -H \"Content-Type: application/json\" \\\n\u003e -d '{\"body\": \"'\"$encoded_image\"'\", \"isBase64Encoded\": true, \"model\":\"yolos-small\"}'\n\npython\n\u003e python3 inference_api.py \\\n\u003e --api http://localhost:8080/2015-03-31/functions/function/invocations \\\n\u003e --file ./tests/data/boats.jpg \\\n\u003e --model yolos-small\n\n\n## 2. Deployment to AWS\n\n### 2.1. Pushing the docker container to AWS ECR\n\n\u003cdetails\u003e\n\nSteps:\n - Create new ECR Repository via aws console\n\nExample: ```object-detection-lambda```\n\n\n - Optional for aws cli configuration (to run above commands):\n\u003e aws configure\n \n - Authenticate Docker client to the Amazon ECR registry\n\u003e aws ecr get-login-password --region \u003caws_region\u003e | docker login --username AWS --password-stdin \u003caws_account_id\u003e.dkr.ecr.\u003caws_region\u003e.amazonaws.com\n\n - Tag local docker image with the Amazon ECR registry and repository\n\u003e docker tag object-detection-lambda:latest \u003caws_account_id\u003e.dkr.ecr.\u003caws_region\u003e.amazonaws.com/object-detection-lambda:latest\n\n - Push docker image to ECR\n\u003e docker push \u003caws_account_id\u003e.dkr.ecr.\u003caws_region\u003e.amazonaws.com/object-detection-lambda:latest\n\n[Link to AWS ECR Documention](https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-push-ecr-image.html)\n\n\u003c/details\u003e\n\n### 2.2. Creating and testing a Lambda function\n\n\u003cdetails\u003e\n\n**Steps**: \n - Create function from container image\n\nExample name: ```object-detection```\n\n - Notes: the API endpoint will use the ```lambda_function.py``` file and ```lambda_hander``` function\n - Test the lambda via the AWS console\n\n\nAdvanced notes:\n - Steps to update the Lambda function with latest container via aws cli:\n\u003e aws lambda update-function-code --function-name object-detection --image-uri \u003caws_account_id\u003e.dkr.ecr.\u003caws_region\u003e.amazonaws.com/object-detection-lambda:latest\n\n\u003c/details\u003e\n\n### 2.3. Creating a REST API via API Gateway\n\n\u003cdetails\u003e\n\n**Steps**: \n - Create a new ```Rest API``` (e.g. ```object-detection-api```)\n - Add a new resource to the API (e.g. ```/detect```)\n - Add a ```POST``` method to the resource\n - Integrate the Lambda function to the API\n   - Notes: currently using proxy integration option unchecked\n - Deploy API with a specific stage (e.g. ```dev``` stage)\n\n\u003c/details\u003e\n\nExample AWS API Endpoint:\n```https://\u003capi_id\u003e.execute-api.\u003caws_region\u003e.amazonaws.com/dev/detect```\n\n\n### 2.4. Execution for deployed model\n\nExample of a prediction request\n\nbash\n\u003e encoded_image=$(base64 -i ./tests/data/boats.jpg)\n\n\u003e curl -X POST \"https://\u003capi_id\u003e.execute-api.\u003caws_region\u003e.amazonaws.com/dev/detect\" \\\n\u003e -H \"Content-Type: application/json\" \\\n\u003e -d '{\"body\": \"'\"$encoded_image\"'\", \"isBase64Encoded\": true, \"model\":\"yolos-small\"}'\n\npython\n\u003e python3 inference_api.py \\\n\u003e --api https://\u003capi_id\u003e.execute-api.\u003caws_region\u003e.amazonaws.com/dev/detect \\\n\u003e --file ./tests/data/boats.jpg \\\n\u003e --model yolos-small\n\n\n## 3. Deployment to Hugging Face\n\nThis web application is available on Hugging Face\n\nHugging Face space URL:\nhttps://huggingface.co/spaces/cvachet/object_detection_lambda\n\nNote: This space uses the ML model deployed on AWS Lambda\n\n\n## 4. Deployment to Docker Hub\n\nThis web application is available on Docker Hub as a docker image\n\nURL:\nhttps://hub.docker.com/r/cvachet/object-detection-lambda\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementsan%2Fobject_detection_lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclementsan%2Fobject_detection_lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementsan%2Fobject_detection_lambda/lists"}