Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pose-as-a-service

CloudPose is a high-performance, containerized pose estimation service built with FastAPI, TensorFlow Lite, and OpenCV. It exposes RESTful endpoints for JSON‐based and image‐based inference, supports load testing via Locust, and can be deployed locally, in Docker, or on Kubernetes.

Prerequisites

  • Python 3.10 or newer
  • pip package manager
  • Docker (optional, for container builds)
  • kubectl & a Kubernetes cluster (optional)
  • Locust (for load testing)

Installation

Install dependencies

python -m venv venv            # optional but recommended
source venv/bin/activate       # Linux/macOS
# .\venv\Scripts\activate    # Windows PowerShell
pip install --upgrade pip
pip install -r requirements.txt

Running Locally

  1. Start the API server

    uvicorn app.main:app --host 0.0.0.0 --port 60000
  2. Verify endpoints

    curl -X 'POST' \
    'http://207.211.146.117:30000/pose/json' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"id": <base64-image-string>, "images": <base64-image-string>}'
    curl -X 'POST' \
    'http://207.211.146.117:30000/pose/image' \
    -H 'accept: application/json' \
    -H 'Content-Type: application/json' \
    -d '{"id": <base64-image-string>, "image": <base64-image-string>}'

Running Load Tests

  1. Run Locust (headless)

    locust -f experiments/locustfile.py \
      --host http://localhost:60000 \
      --users 100 --spawn-rate 10 --run-time 1m

Docker Usage

  1. Build the Docker image

    docker build -t cloudpose:latest .
  2. Run the container

    docker run -d -p 60000:60000 --name cloudpose cloudpose:latest
  3. Test the service

    curl http://localhost:60000/pose/json

Kubernetes Deployment

  1. Apply manifests

    kubectl apply -f k8s/namespace.yaml
    kubectl apply -f k8s/deployment.yaml
    kubectl apply -f k8s/service.yaml
  2. Check rollout status

    kubectl -n cloudpose get pods,svc
  3. Access via NodePort

    • The service exposes port 60000 as a NodePort; query any node IP:

      curl http://<NODE_IP>:<NODE_PORT>/pose/json

About

CloudPose is a high-performance, containerized pose estimation service built with FastAPI, TensorFlow Lite, and OpenCV. It exposes RESTful endpoints for JSON‐based and image‐based inference, supports load testing via Locust, and can be deployed locally, in Docker, or on Kubernetes.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages