Sign inSign up

drvpn/runpod_serverless_faceman_worker

By drvpn

•Updated over 2 years ago

RunPod Serverless GFPGAN FaceMan Worker

Image
Machine learning & AI
0

213

drvpn/runpod_serverless_faceman_worker repository overview

⁠RunPod Serverless GFPGAN FaceMan Worker

⁠Explore RunPod⁠

This project allows users to install FaceMan, a GFPGAN AI face enhancement model that enhances faces in video, on RunPod serverless platform.

⁠Environment Variables

To run this application on RunPod serverless, you need to set the following environment variables:

  • BUCKET_ENDPOINT_URL: The endpoint URL of your S3-compatible storage.
  • BUCKET_ACCESS_KEY_ID: The access key ID for your S3-compatible storage.
  • BUCKET_SECRET_ACCESS_KEY: The secret access key for your S3-compatible storage.

These variables are required to store and host the enhanced MP4 video files.

⁠Running on RunPod Serverless

  1. Deploy on RunPod

    • Go to RunPod's dashboard and create a new serverless function.
    • Use drvpn/runpod_serverless_faceman_worker for image.
    • Set the environment variables: BUCKET_ENDPOINT_URL, BUCKET_ACCESS_KEY_ID, BUCKET_SECRET_ACCESS_KEY.
  2. Invoke the Function

You can invoke the function with a JSON payload specifying the input video URL. Here is an example:

{
  "input": {
    "input_video_url": "https://www.example.com/myInputVideo.mp4"
  }
}

Use RunPod's interface or an HTTPS client (i.e. Postman) to send this payload to the deployed function.

⁠Input

  • video_url: The video you want to enhance (required)

⁠Example return value

{
  "delayTime": 789,
  "executionTime": 16608,
  "id": "your-unique-id-will-be-here",
  "output": {
    "output_video_url": "https://mybucket.nyc3.digitaloceanspaces.com/Enhanced_GFPGAN/enhanced_2024_06_14_13.14.11.mp4"
  },
  "status": "COMPLETED"
}

⁠Handler Explanation

The handler.py script orchestrates the following tasks:

  • Maps a network volume to store checkpoints (if available).
  • Downloads and caches model checkpoints if not already present.
  • Enhances faces on each video frame and uses them to generate the enhanced video file
  • Uploads the generated video file to S3-compatible storage and returns the public URL.

⁠Source code

Source code available at: Github⁠

⁠License

This project is licensed under the MIT License.

Tag summary

Content type

Image

Digest

sha256:258450ddf…

Size

4.2 GB

Last updated

over 2 years ago

docker pull drvpn/runpod_serverless_faceman_worker