facepoke on ubuntu 24 04

Install FacePoke on Ubuntu 24.04: Real-time Face Morphing Made Easy

I’ll walk you through the installation and setup process of FacePoke on Ubuntu 24.04. FacePoke is a real-time head transformation app based on the LivePortrait project, providing an interactive experience with advanced face transformation features. Running it locally ensures the best performance, especially if you have access to an NVIDIA GPU with CUDA 12.4.

Before You Begin

FacePoke has been tested with Python 3.10 and CUDA 12.4, making a Linux environment with these prerequisites ideal. The instructions below are intended for setting up FacePoke on Ubuntu 24.04.

Step 1: Clone the FacePoke Repository

The first step is to clone the FacePoke repository from GitHub.

git clone https://github.com/jbilcke-hf/FacePoke.git
cd FacePoke

Step 2: Set Up Python Virtual Environment

To manage dependencies and keep your environment clean, create and activate a Python virtual environment. FacePoke has been tested with Python 3.10, so you’ll need this version of Python installed on your system.

2.1 Install Python 3.10

If you haven’t installed Python 3.10 yet, do so by running the following commands:

sudo apt update
sudo apt install python3.10 python3.10-venv python3.10-dev

2.2 Create and Activate Virtual Environment

Once Python 3.10 is installed, create a virtual environment and activate it:

python3.10 -m venv venv
source venv/bin/activate

2.3 Upgrade pip, setuptools, and wheel

Make sure you have the latest versions of pip, setuptools, and wheel:

pip install --upgrade pip setuptools wheel

2.4 Install Python Dependencies

Now that your environment is set up, install the required Python dependencies from the requirements.txt file:

pip install -r requirements.txt

Step 3: Set Up the Frontend (JavaScript)

The frontend of FacePoke is managed using Bun, a fast JavaScript runtime. You’ll need to install it and use it to handle the frontend dependencies.

3.1 Install Bun

To install Bun, first download and set it up:

sudo apt install unzip
curl -fsSL https://bun.sh/install | bash

After installation, add Bun to your system’s PATH:

export PATH="$HOME/.bun/bin:$PATH"

Verify the installation by checking the version of Bun:

bun --version

3.2 Install Frontend Dependencies

Next, navigate to the client folder and install the required frontend dependencies using Bun:

cd client
bun install

3.3 Build the Frontend

Once the dependencies are installed, build the frontend:

bun build ./src/index.tsx --outdir ../public/

Step 4: Run the Backend

Return to the root directory of FacePoke and start the backend server:

cd ..
python app.py

Step 5: Access the Application

Once the backend server is running, you can access FacePoke by opening your web browser and navigating to:

http://localhost:8080

Conclusion

You’ve now successfully installed and configured FacePoke on Ubuntu 24.04. This setup allows you to run the app locally and benefit from its full capabilities, ensuring low latency and optimal performance. If you have any challenges, feel free to consult the official FacePoke GitHub repository or explore ways to improve the app’s performance by increasing the frame rate or optimizing the head transformation processes.

By following these steps, you can experiment with real-time head transformations and enjoy the features offered by this innovative app!

Leave a Reply

Your email address will not be published. Required fields are marked *