Skip to main content
This guide explains how to build and run the Facebetter C++ desktop demo on Linux. The demo is built with GLFW + Dear ImGui + OpenGL 3: the left panel shows a live beauty-processed preview, while the right panel provides sliders to control each effect in real time.

Requirements

Install Dependencies (Ubuntu / Debian)

Install Dependencies (Fedora / RHEL)

Step 1: Clone the Repository

Step 2: Place the SDK Files

Place the Linux SDK files under demo/cpp/sdk/:
The SDK download link is available on the Download page or in your dashboard.

Step 3: Build

After the build, CMake automatically copies resource/resource.fbd and demo.png (if present) to build/resource/.

Step 4: Prepare a Preview Image (optional)

Place any face photo named demo.png in demo/cpp/:
The engine will process the image at ~30 fps and display the result in the left panel.

Step 5: Run

Once running, the window shows:
  • Left panel – live beauty-processed preview
  • Right panel – Beauty Control Panel:
    • Basic Beauty: Smoothing / Whitening / Rosiness / Sharpening
    • Face Reshape: Face Thin / V Face / Narrow Face / Short Face / Cheekbone / Jawbone / Chin / Nose Slim / Eye Size / Eye Distance
    • Makeup: Lipstick / Blush
    • Sticker: dropdown (Off / rabbit)
Click Reset All to restore all parameters to zero.

Troubleshooting

Q: libfacebetter.so: cannot open shared object file
A: Run with LD_LIBRARY_PATH=../sdk/lib ./facebetter_demo, copy the library to the executable directory, or add the path to /etc/ld.so.conf and run ldconfig.
Q: CMake cannot find OpenGL
A: Install libgl1-mesa-dev (Ubuntu) or mesa-libGL-devel (Fedora), then re-run CMake.
Q: Window shows “Put demo.png …”
A: Place a face photo named demo.png in demo/cpp/ and restart the demo.
Q: GLFW: X11: Display variable not set
A: Make sure you are running in a graphical session, or set the DISPLAY environment variable.