face_detection_api / README.md
PachecoT's picture
Upload 5 files
b78b643 verified
metadata
title: Face Detection API
emoji: 👤
colorFrom: yellow
colorTo: blue
sdk: docker
pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

This project provides a face detection API using FastAPI and OpenCV.

Run the Application

To run the application, follow these steps:

Using Docker

  1. Build the Docker image:

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

    docker run -p 7860:7860 face-detection-api
    
  3. Access the API at http://localhost:7860/predict/ to make predictions.

Using Docker Compose

Alternatively, you can use Docker Compose to manage the application:

  1. Build and run the application:

    docker-compose up --build
    
  2. Access the API at http://localhost:7860/predict/ to make predictions.

  3. Stop the application:

    docker-compose down
    

Docker Container Guide

This project uses Docker to create a containerized environment for the Face Detection API. Below are the steps to manage the Docker container:

Building the Docker Image

  • Ensure you are in the project directory where the Dockerfile is located.
  • Run the following command to build the Docker image:
    docker build -t face-detection-api .
    

Running the Docker Container

  • After building the image, you can run the container using:
    docker run -p 7860:7860 face-detection-api
    

Stopping the Docker Container

  • To stop the running container, you can use:
    docker ps  # to find the container ID
    docker stop <container_id>
    

Removing the Docker Container

  • If you want to remove the stopped container, use:
    docker rm <container_id>
    

Removing the Docker Image

  • To remove the Docker image, run:
    docker rmi face-detection-api
    

This guide should help you manage the Docker container for the Face Detection API effectively.