{"id":24989807,"url":"https://github.com/clementsan/object_detection_detr_api","last_synced_at":"2025-03-29T12:15:25.663Z","repository":{"id":263505546,"uuid":"889270249","full_name":"clementsan/object_detection_detr_api","owner":"clementsan","description":"AI-driven object detection via FastAPI ","archived":false,"fork":false,"pushed_at":"2025-01-17T00:06:30.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T13:03:31.267Z","etag":null,"topics":["ai","api","deep-learning","fastapi","object-detection","object-detection-api"],"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-11-16T00:19:34.000Z","updated_at":"2025-01-17T00:06:31.000Z","dependencies_parsed_at":"2024-11-18T23:28:41.968Z","dependency_job_id":"9efcfa54-190b-409f-81fc-5ed761ca672b","html_url":"https://github.com/clementsan/object_detection_detr_api","commit_stats":null,"previous_names":["clementsan/object_detection_detr_api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_detr_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_detr_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_detr_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clementsan%2Fobject_detection_detr_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clementsan","download_url":"https://codeload.github.com/clementsan/object_detection_detr_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246180923,"owners_count":20736460,"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":["ai","api","deep-learning","fastapi","object-detection","object-detection-api"],"created_at":"2025-02-04T13:03:33.829Z","updated_at":"2025-03-29T12:15:25.640Z","avatar_url":"https://github.com/clementsan.png","language":"Python","readme":"# Object detection via FastAPI\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-detr-api)](https://hub.docker.com/repository/docker/cvachet/object-detection-detr-api)\n\n![example workflow](https://github.com/clementsan/object_detection_detr_api/actions/workflows/ci_python.yml/badge.svg)\n![example workflow](https://github.com/clementsan/object_detection_detr_api/actions/workflows/publish_docker_image.yaml/badge.svg)\n\n**Aim:** AI-driven object detection via FastAPI (on COCO image dataset)\n\n**Machine learning models:**\n - facebook/detr-resnet-50\n - facebook/detr-resnet-101\n\n------\n### Table of contents:\n - [Direct execution](#1-direct-execution)\n   - [Run FastAPI interface](#11-run-fastapi-interface)\n   - [Run API query via curl command](#12-run-api-query-via-curl-command)\n   - [Run API query via python script](#13-run-api-query-via-python-script)\n   - [Tests via pytest library](#14-tests-via-pytest-library)\n - [Execution via docker container](#2-execution-via-docker-container)\n   - [Build image and run docker container](#21-build-image-and-run-docker-container)\n   - [Run query via API](#22-run-query-via-api)\n - [Deployment on Docker hub](#3-deployment-on-docker-hub)\n - [MLOps pipeline via GitHub actions](#4-mlops-pipeline-via-github-actions)\n\n----\n\n## 1. Direct execution\n\n### 1.1. Run FastAPI interface\n\nCommand line in development mode:\n\u003e fastapi dev app/main.py\n\nManual command line in production:\n\u003e fastapi run app/main.py\n\n\u003cb\u003eNotes:\u003c/b\u003e\n - Serving at: http://127.0.0.1:8000 \n - API docs: http://127.0.0.1:8000/docs\n\n\n\n### 1.2. Run API query via curl command\n\nCommand lines:\n - Endpoint \"/\":\n\u003e curl -X 'GET' -H 'accept: application/json' 'http://127.0.0.1:8000/'\n\n- Endpoint \"/info\":\n\u003e curl -X 'GET' -H 'accept: application/json' 'http://127.0.0.1:8000/info'\n  \n\n - Endpoint \"/api/v1/detect\":\n\u003e  curl -X POST -F \"image=@./tests/data/savanna.jpg\" http://127.0.0.1:8000/api/v1/detect\n\n - Endpoint \"/api/v1/detect\" with optional model type (e.g. detr-resnet-50 or detr-resnet-101):\n\u003e  curl -X POST -F \"image=@./tests/data/savanna.jpg\" http://127.0.0.1:8000/api/v1/detect?model=detr-resnet-50\n\n\n### 1.3. Run API query via python script\n\nCommand line:\n\u003e python app/inference_api.py -u \"http://127.0.0.1:8000/api/v1/detect\" -f tests/data/savanna.jpg\n\n### 1.4. Tests via pytest library\n\nCommand lines:\n\u003e pytest tests/ -v\n\n\u003e pytest tests/ -s -o log_cli=true -o log_level=DEBUG\n\n\n## 2. Execution via docker container\n\n### 2.1. Build image and run docker container\n\nCommand lines:\n\u003e sudo docker build -t object-detection-detr-api .\n\n\u003e sudo docker run --name object-detection-detr-api-cont -p 8000:8000 object-detection-detr-api\n\n### 2.2. Run query via API\n\nCommand lines:\n - Endpoint \"/\":\n\u003e curl -X 'GET' 'http://0.0.0.0:8000/' -H 'accept: application/json'\n\n - Endpoint \"/info\":\n\u003e curl -X 'GET' -H 'accept: application/json' 'http://0.0.0.0:8000/info'\n\n - Endpoint \"/api/v1/detect\":\n\u003e  curl -X 'POST' -F \"image=@./tests/data/savanna.jpg\" http://0.0.0.0:8000/api/v1/detect \n\n - Endpoint \"/api/v1/detect\" with optional model type (e.g. detr-resnet-50 or detr-resnet-101):\n\u003e  curl -X POST -F \"image=@./tests/data/savanna.jpg\" http://0.0.0.0:8000/api/v1/detect?model=detr-resnet-50\n\n\n## 3. Deployment on Docker hub\n\nThis FastAPI application is available as a Docker container on Docker hub\n\nURL: https://hub.docker.com/r/cvachet/object-detection-detr-api\n\n\n## 4. MLOps pipeline via GitHub actions\n\nGithub actions were created to enable Continuous Integration (CI) and Continuous Deployment (CD) for this FastAPI app. \n\nYAML files:\n - Python testing suite: [ci_python.yml](.github/workflows/ci_python.yml)\n - Pushing to docker: [publish_docker_image.yaml](.github/workflows/publish_docker_image.yaml)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementsan%2Fobject_detection_detr_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclementsan%2Fobject_detection_detr_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclementsan%2Fobject_detection_detr_api/lists"}