{"id":22957438,"url":"https://github.com/zachlagden/face-detection-api","last_synced_at":"2025-04-02T01:42:46.266Z","repository":{"id":210795656,"uuid":"727472246","full_name":"zachlagden/Face-Detection-API","owner":"zachlagden","description":"A lightweight Flask API for face detection and facial landmark extraction with interactive web UI. Process images, extract facial features, and visualize results through a simple REST interface.","archived":false,"fork":false,"pushed_at":"2025-03-15T12:06:59.000Z","size":70664,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-28T18:57:21.853Z","etag":null,"topics":["api-documentation","computer-vision","dlib","face-dectection","facial-landmarks","flask-api","image-processing","opencv","python","rest-api","sqlite","tailwindcss","vue-js"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zachlagden.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}},"created_at":"2023-12-04T23:42:46.000Z","updated_at":"2025-03-15T12:07:02.000Z","dependencies_parsed_at":"2023-12-14T23:05:11.213Z","dependency_job_id":null,"html_url":"https://github.com/zachlagden/Face-Detection-API","commit_stats":null,"previous_names":["thewhsmith/face-detection-api","zachlagden/face-detection-api"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachlagden%2FFace-Detection-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachlagden%2FFace-Detection-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachlagden%2FFace-Detection-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zachlagden%2FFace-Detection-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zachlagden","download_url":"https://codeload.github.com/zachlagden/Face-Detection-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246741185,"owners_count":20826063,"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":["api-documentation","computer-vision","dlib","face-dectection","facial-landmarks","flask-api","image-processing","opencv","python","rest-api","sqlite","tailwindcss","vue-js"],"created_at":"2024-12-14T17:16:49.483Z","updated_at":"2025-04-02T01:42:46.249Z","avatar_url":"https://github.com/zachlagden.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face Detection API\n\nThe Face Detection API is a simple tool for detecting faces in images, overlaying facial landmarks, and providing additional data about the detected features.\n\n## Features\n\n- Face detection in uploaded images\n- Facial landmark extraction\n- Visual overlays for facial features\n- API endpoints for image processing and result retrieval\n- Job-based processing with results storage\n\n## Installation and Setup\n\n### Prerequisites\n\n- Python 3.8 or higher\n- Visual Studio Build Tools with C++ components (for dlib)\n- CMake (for dlib)\n\n\u003e **Note for Windows users**: See [WINDOWS_INSTALL.md](WINDOWS_INSTALL.md) for detailed Windows-specific installation instructions.\n\n### Installation Steps\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/zachlagden/Face-Detection-API\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd face-detection-api\n   ```\n\n3. Create a virtual environment and activate it:\n\n   ```bash\n   python -m venv venv\n   \n   # On Windows\n   venv\\Scripts\\activate\n   \n   # On macOS/Linux\n   source venv/bin/activate\n   ```\n\n4. Install the required Python packages:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n5. Download the shape predictor file:\n\n   Download the shape predictor file from [Dlib's official website](http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2), extract it, and place it in the `data/` folder.\n\n6. Create a `.env` file:\n\n   Copy the example environment file and modify as needed:\n\n   ```bash\n   cp .env.example .env\n   ```\n\n## Basic Usage\n\n1. Run the Flask application:\n\n   ```bash\n   python main.py\n   ```\n\n   The API will be accessible at [http://127.0.0.1:5000/](http://127.0.0.1:5000/).\n\n2. Use the API to detect faces in an image:\n\n   - **Endpoint:** `POST /overlay`\n   - **Request Type:** Multipart/form-data\n   - **Request Parameter:**\n     - `image`: Upload an image file.\n\n   **Example using cURL:**\n\n   ```bash\n   curl -X POST -H \"Content-Type: multipart/form-data\" -F \"image=@/path/to/your/image.jpg\" http://127.0.0.1:5000/overlay\n   ```\n\n   The response will include a unique job ID, a URL to the processed image, processing time, and data about the detected faces.\n\n3. Retrieve information about a specific job:\n\n   - **Endpoint:** `GET /jobs/\u003cjob_id\u003e`\n   - **Replace `\u003cjob_id\u003e` with the actual job ID obtained from the overlay response.\n\n   **Example using cURL:**\n\n   ```bash\n   curl http://127.0.0.1:5000/jobs/unique_job_id\n   ```\n\n   This will provide details about the specified job.\n\n4. Retrieve the processed image associated with a job:\n\n   - **Endpoint:** `GET /jobs/\u003cjob_id\u003e/result_image.png`\n   - **Replace `\u003cjob_id\u003e` with the actual job ID obtained from the overlay response.\n\n   **Example using cURL:**\n\n   ```bash\n   curl -OJ http://127.0.0.1:5000/jobs/unique_job_id/result_image.png\n   ```\n\n   This will download the processed image.\n\n## Project Structure\n\n- `app/`: Main application package\n  - `helpers/`: Helper modules and functions\n    - `database.py`: Database operations (SQLite)\n    - `image_processor.py`: Face detection and image processing\n  - `templates/`: HTML templates\n    - `index.html`: API documentation page\n- `data/`: Shape predictor data file and SQLite database\n  - `images/`: Storage for processed images\n- `tests/`: Test suite\n  - `test_image_processor.py`: Tests for image processing\n  - `test_routes.py`: Tests for API endpoints\n- `main.py`: Application entry point\n- `config.py`: Configuration settings\n- `.env.example`: Example environment variables\n\n## Running Tests\n\nThis project includes a test suite using pytest. To run the tests:\n\n```bash\npytest\n```\n\n## Rate Limiting\n\nThe API implements rate limiting to prevent abuse:\n- 1 request per second (default)\n- 10 requests per minute (default)\n- 1000 requests per day (default)\n\nThese limits can be configured in the application.\n\n## Data Storage\n\n- SQLite database for storing job information\n- Local file system for storing processed images\n- Automatic cleanup of expired jobs and images","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachlagden%2Fface-detection-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzachlagden%2Fface-detection-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzachlagden%2Fface-detection-api/lists"}