Use OpenSeeFace to control Live2D model
[facial-landmarks-for-cubism.git] / README.md
index 29e63f2..77a7383 100644 (file)
--- a/README.md
+++ b/README.md
@@ -15,13 +15,20 @@ This block diagram shows the intended usage of this library:
 Video showing me using the example program:
 <https://youtu.be/SZPEKwEqbdI>
 
+## Spin-off: Mouse Tracking for Cubism
+
+An alternative version using mouse cursor tracking and audio based lip
+syncing instead of face tracking is available at
+<https://github.com/adrianiainlam/mouse-tracker-for-cubism>.
+
+The main advantage is a much lower CPU load.
 
 ## Supporting environments
 
 This library was developed and tested only on Ubuntu 18.04 using GCC 7.5.0.
 However I don't think I've used anything that prevents it from being
 cross-platform compatible -- it should still work as long as you have a
-recent C/C++ compiler. (The library should only require C++11. The Cubism
+recent C/C++ compiler. The library should only require C++11. The Cubism
 SDK requires C++14. I have made use of one C++17 library (`<filesystem>`)
 in the example program, but it should be straightforward to change this
 if you don't have C++17 support.
@@ -31,9 +38,10 @@ environment without a `/bin/sh` shell you may have to run the commands
 manually. Hereafter, all build instructions will assume a Linux environment
 where a shell is available.
 
-If your CPU does not support AVX instructions you may want to edit the
-relevant build scripts to remove the `-D USE_AVX_INSTRUCTIONS=1` variable
-(or change it the SSE3 etc). However there could be a penalty in performance.
+If your CPU does not support AVX instructions you may want to edit "build.sh"
+and "example/demo.patch" to remove the `-D USE_AVX_INSTRUCTIONS=1` variable
+(or change AVX to SSE4 or SSE2). However there could be a penalty in
+performance.
 
 ## Build instructions
 
@@ -43,15 +51,21 @@ relevant build scripts to remove the `-D USE_AVX_INSTRUCTIONS=1` variable
    and the OpenCV library (I'm using version 4.3.0). To compile the example
    program you will also require the OpenGL library (and its dev headers)
    among other libraries required for the example program. The libraries I
-   had to install (this list may not be exhaustive) are:
+   had to install on Ubuntu 18.04 (this list may not be exhaustive) are:
 
        libgl1-mesa-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libglu1-mesa-dev
 
+   A Debian Bullseye user has [reported](https://github.com/adrianiainlam/facial-landmarks-for-cubism/issues/2)
+   the following extra requirements:
+
+       libopencv-dev libopenblas-dev liblapack-dev
+
 2. Clone this repository including its submodule (dlib)
 
        git clone --recurse-submodules https://github.com/adrianiainlam/facial-landmarks-for-cubism.git
 
-3. To build the library only:
+3. To build the library only: (Skip this step if you want to build the example
+   program. It will be done automatically.)
 
        cd <path of the git repo>
        ./build.sh
@@ -71,17 +85,17 @@ To build the example program:
 5. Copy the extracted dlib dataset from step 4 to the "example" folder
    of this repo.
 
-6. Download "Cubism 4 SDK for Native R1" from the Live2D website:
+6. Download "Cubism 4 SDK for Native R2" from the Live2D website:
    <https://www.live2d.com/en/download/cubism-sdk/download-native/>.
 
-   Extract the archive -- put the "CubismSdkForNative-4-r.1" folder under
+   Extract the archive -- put the "CubismSdkForNative-4-r.2" folder under
    the "example" folder of this repo.
 
    Note: The Cubism SDK is the property of Live2D and is not part of this
    project. You must agree to Live2D's license agreements to use it.
 
 7. Go into the
-   "example/CubismSdkForNative-4-r.1/Samples/OpenGL/thirdParty/scripts"
+   "example/CubismSdkForNative-4-r.2/Samples/OpenGL/thirdParty/scripts"
    directory and run
 
        ./setup_glew_glfw
@@ -113,6 +127,9 @@ for the Facial Landmarks for Cubism library.
  * `--translate-y`, `-y`: Vertical translation of the model within the window
  * `--model`, `-m`: Name of the model to be used. This must be located inside
    the "Resources" folder.
+ * `--old-param-id`, `-o`: If set to 1, translate new (Cubism 3+) parameter
+   IDs to old (Cubism 2.1) IDs. This is necessary, for example, for
+   [the Chitose model available from Live2D](https://www.live2d.com/en/download/sample-data/).
  * `--config`, `-c`: Path to the configuration file for the Facial Landmarks
    for Cubism library. See below for more details.
 
@@ -123,10 +140,24 @@ Due to the differences in hardware and differences in each person's face,
 I have decided to make pretty much every parameter tweakable. The file
 "config.txt" lists and documents all parameters and their default values.
 You can change the values there and pass it to the example program using
-to `-c` argument. If using the library directly, the path to this file
+the `-c` argument. If using the library directly, the path to this file
 should be passed to the constructor (or pass an empty string to use
 default values).
 
+## Troubleshooting
+
+1. Example program crashes with SIGILL (Illegal instruction).
+
+   Your CPU probably doesn't support AVX instructions which is used by dlib.
+   You can confirm this by running
+
+       grep avx /proc/cpuinfo
+
+   If this is the case, try to find out if your CPU supports SSE4 or SSE2,
+   then edit "build.sh" and "example/demo.patch" to change
+   `USE_AVX_INSTRUCTIONS=1` to `USE_SSE4_INSTRUCTIONS=1` or
+   `USE_SSE2_INSTRUCTIONS=1`.
+
 ## License
 
 The library itself is provided under the MIT license. By "the library itself"