From 8c195e1b7c20ce6972f440b09cc2f13b94fc2342 Mon Sep 17 00:00:00 2001 From: KanagawaYamada Date: Sat, 29 Aug 2026 19:37:50 +0700 Subject: [PATCH] Add modern Linux setup script, requirements.txt, and update README --- README.md | 11 +++++++++++ Run_Linux.sh | 30 ++++++++++++++++++++++++++++++ requirements.txt | 4 ++++ 3 files changed, 45 insertions(+) create mode 100755 Run_Linux.sh create mode 100644 requirements.txt diff --git a/README.md b/README.md index 4d17be5..fd6a9c9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ ![OSF.png](https://raw.githubusercontent.com/emilianavt/OpenSeeFace/master/Images/OSF.png) +> **2024/2025 Modernization Fork (OpenSeeFaceFIX)** +> This is a modernized fork of OpenSeeFace updated to support the latest 2024+ Python ecosystems and GPU drivers. +> +> **Updates include:** +> - **Numpy 2.0+ Support:** Fixed internal array broadcasting crashes (`.flatten()`) when performing 3D matrix math. +> - **OpenCV 5.0+ Support:** Fixed `cv2.solvePnP` crashes by forcing correct initial guess fallback paths. +> - **ONNX Runtime 1.29+ / CUDA 13+ Support:** Re-routed the tracker to use the unoptimized `_gpu.onnx` models natively. This completely bypasses the catastrophic `unsupported conv activation mode "LeakyRelu" / "Clip"` crashes caused by the `FusedConv` operations in the original `_opt.onnx` models when running on modern Nvidia CUDA Execution Providers. +> - **Modern Setup Script:** Added `Run_Linux.sh` to automatically build an isolated `venv` and dynamically patch CUDA library paths (`LD_LIBRARY_PATH`) so `onnxruntime-gpu` correctly attaches to pip-installed `cu12/cu13` Nvidia libraries without system-level driver hell. +> - **Modern Poetry/Pip Support:** Lifted the strict `Python < 3.11` locks. + + # Overview **Note**: This is a tracking library, **not** a stand-alone avatar puppeteering program. I'm also working on [VSeeFace](https://www.vseeface.icu/), which allows animating [VRM](https://vrm.dev/en/how_to_make_vrm/) and [VSFAvatar](https://www.youtube.com/watch?v=jhQ8DF87I5I) 3D models by using OpenSeeFace tracking. [VTube Studio](https://denchisoft.com/) uses OpenSeeFace for webcam based tracking to animate Live2D models. A renderer for the Godot engine can be found [here](https://github.com/virtual-puppet-project/vpuppr). diff --git a/Run_Linux.sh b/Run_Linux.sh new file mode 100755 index 0000000..3a5c19c --- /dev/null +++ b/Run_Linux.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# Modern Linux Setup and Launch Script for OpenSeeFace +# Automatically provisions a modern Python environment with CUDA 13 support + +# Navigate to the script's directory so it can be run from anywhere +cd "$(dirname "$0")" || exit + +echo "Initializing OpenSeeFace Linux Environment..." + +# Create and activate virtual environment if it doesn't exist +if [ ! -d "env" ]; then + echo "Creating Python virtual environment..." + python3 -m venv env + source env/bin/activate + + echo "Installing modern dependencies (CUDA 13, ONNXRuntime 1.29.0+, Numpy 2+, OpenCV 5+)..." + pip install --upgrade pip + pip install onnxruntime-gpu opencv-python pillow numpy nvidia-cublas nvidia-cuda-runtime nvidia-cudnn-cu13 nvidia-cufft nvidia-curand nvidia-cusolver nvidia-cusparse + echo "Setup complete!" +else + source env/bin/activate +fi + +# Fix ONNX Runtime missing CUDA 13 libraries by adding pip modules to LD_LIBRARY_PATH dynamically +SITE_PACKAGES=$(python -c 'import site; print(site.getsitepackages()[0])') +export LD_LIBRARY_PATH="$SITE_PACKAGES/nvidia/cu13/lib:$SITE_PACKAGES/nvidia/cublas/lib:$SITE_PACKAGES/nvidia/cudnn/lib:$SITE_PACKAGES/nvidia/cufft/lib:$SITE_PACKAGES/nvidia/cuda_runtime/lib:$SITE_PACKAGES/nvidia/cuda_nvrtc/lib:$SITE_PACKAGES/nvidia/curand/lib:$SITE_PACKAGES/nvidia/cusolver/lib:$SITE_PACKAGES/nvidia/cusparse/lib:$LD_LIBRARY_PATH" + +echo "Starting OpenSeeFace Tracker on GPU..." +# Execute facetracker +python facetracker.py -c 0 -W 1280 -H 720 --discard-after 0 --scan-every 0 --no-3d-adapt 1 --max-feature-updates 900 diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..a1cad67 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +onnxruntime-gpu>=1.9.0 +opencv-python>=4.5.4 +Pillow>=8.4.0 +numpy>=1.21.3