Go to file
2025-08-14 11:46:50 +03:00
.vscode feat: first commit 2025-08-14 11:46:50 +03:00
src feat: first commit 2025-08-14 11:46:50 +03:00
.gitignore feat: first commit 2025-08-14 11:46:50 +03:00
bun.lock feat: first commit 2025-08-14 11:46:50 +03:00
Dockerfile feat: first commit 2025-08-14 11:46:50 +03:00
eslint.config.js feat: first commit 2025-08-14 11:46:50 +03:00
package.json feat: first commit 2025-08-14 11:46:50 +03:00
README.md feat: first commit 2025-08-14 11:46:50 +03:00
tsconfig.json feat: first commit 2025-08-14 11:46:50 +03:00

Deface API

This project provides a simple API endpoint to anonymize faces in images using the deface library. The API is built with ElysiaJS and runs on Bun.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

You need to have Bun installed on your machine.

Installation

  1. Clone the repository:

    git clone https://github.com/your-username/deface-api.git
    cd deface-api
    
  2. Install the dependencies:

    bun install
    
  3. Run the development server:

    bun run dev
    

    The server will be running on http://localhost:3000.

Usage

To use the API, send a POST request to the /deface endpoint with the image you want to anonymize. The image should be sent as a multipart form data with the key image.

Here's an example using curl:

curl -X POST -F "image=@/path/to/your/image.jpg" http://localhost:3000/deface -o defaced-image.jpg

API Reference

POST /deface

Anonymizes faces in the provided image.

Request:

  • Method: POST
  • Endpoint: /deface
  • Body: multipart/form-data
    • image: The image file to be processed.

Response:

  • Success (200 OK):
    • Content-Type: image/jpeg
    • Body: The anonymized image.
  • Error (400 Bad Request):
    • Body: "Image file is required"

Docker

You can also run the application using Docker.

  1. Build the Docker image:

    docker build -t deface-api .
    
  2. Run the Docker container:

    docker run -p 3000:3000 deface-api
    

The API will be available at http://localhost:3000.