diff --git a/hands/README.md b/hands/README.md index 8a142a4..4a08521 100644 --- a/hands/README.md +++ b/hands/README.md @@ -40,6 +40,7 @@ Settings in `~/.config/frametop.conf` (`FT_` in the environment overrides - `HANDS_SWAP_SIDES=auto` (the default): ft-hands tells from the hands which side camera is which, and corrects ft-camd's names when they're backwards (see "Which camera is which" below). `1` forces them exchanged and `0` forces ft-camd's names; ft-hands still checks, and if the hands disagree it logs a warning and publishes the hands' answer as the truth (`sides.json`), so recordings are labelled right. The example config said `0` until 2026-10-05; `scripts/conf-migrate.sh` (run by `install.sh` and `hands/rec/install.sh`) turns that untouched line into `auto`. - `HANDS_CPUS=5,6,7`: the CPUs the model threads run on (below). - `HANDS_CAMERAS` (`auto`), `HANDS_BRIGHT` (`all`), `HANDS_BRIGHT_ON` (40), `HANDS_BRIGHT_OFF` (25): which cameras ft-hands tracks with, as `--cams`, `--bright`, `--bright-on` and `--bright-off` (see ft-hands). `HANDS_CAMERAS=mono` also keeps ft-camd off the colour cameras. +- `HANDS_MODELS` (unset: `hands/models/ncnn`, the stock MediaPipe models): a folder holding `palm.ncnn.*` and `hand.ncnn.*`, as `--models`. Use it to run fine-tuned models, such as the ones trained on the hand dataset, without passing options to every launcher. Those folders usually lack the `*-int8` files, so `--int8` won't load them. - `HANDS_COLOR_LEFT` (`color_video0`), `HANDS_COLOR_CROP` (`subtract`): how the colour module's calibration maps onto its images, as `--color-left` and `--color-crop`. The pointer helper's `POINTER_HANDS` and `POINTER_PINCH_*`/`POINTER_GRIP_*` settings are in "Pinches and grips in the pointer" below. diff --git a/hands/track/main.cpp b/hands/track/main.cpp index e8f6829..1a8b7c1 100644 --- a/hands/track/main.cpp +++ b/hands/track/main.cpp @@ -38,7 +38,8 @@ // HANDS_CAMERAS, HANDS_BRIGHT, HANDS_BRIGHT_ON, HANDS_BRIGHT_OFF, HANDS_COLOR_LEFT (which // colour camera is passthrough_left: color_video0 or color_video3), HANDS_COLOR_CROP // (subtract or none: tools/check_color.py tells both), HANDS_MISREAD_GUARD (0 or 1: the -// tracker's guards for fine-tuned landmark models, Tracker::set_misread_guard). +// tracker's guards for fine-tuned landmark models, Tracker::set_misread_guard), HANDS_MODELS (as +// --models: a folder with palm.ncnn.* and hand.ncnn.*, e.g. fine-tuned ones). #include "io.h" #include "pinch.h" #include "record.h" @@ -240,6 +241,7 @@ int main(int argc, char **argv) { // latency 9.6 against 14.1 ms, and the compositor's late frames and CPU/GPU time didn't change. std::vector cpus = {5, 6, 7}; if (const auto c = parse_cpus(setting("HANDS_CPUS").c_str()); !c.empty()) cpus = c; + if (const std::string m = setting("HANDS_MODELS"); !m.empty()) models = m; // Which side camera is which (see the top): auto, 0 or 1, and where that came from std::string sides_mode = setting("HANDS_SWAP_SIDES"), sides_from = "config"; if (sides_mode.empty()) sides_mode = "auto", sides_from = "default"; @@ -322,7 +324,7 @@ int main(int argc, char **argv) { "camera's newest dark frame, as _dk; with --with-color, the color cameras' as color_video.\n" "auto picks the cameras by the light (see the top of track/main.cpp).\n" "Settings in ~/.config/frametop.conf: HANDS_SWAP_SIDES=auto|0|1, HANDS_CPUS=5,6,7, HANDS_CAMERAS, HANDS_BRIGHT,\n" - "HANDS_BRIGHT_ON, HANDS_BRIGHT_OFF, HANDS_COLOR_LEFT, HANDS_COLOR_CROP, HANDS_MISREAD_GUARD=0|1\n" + "HANDS_BRIGHT_ON, HANDS_BRIGHT_OFF, HANDS_COLOR_LEFT, HANDS_COLOR_CROP, HANDS_MISREAD_GUARD=0|1, HANDS_MODELS=DIR\n" "(FT_ overrides).\n", argv[0]); return a == "--help" ? 0 : 1; diff --git a/session/frametop.conf.example b/session/frametop.conf.example index 4250a0d..379d713 100644 --- a/session/frametop.conf.example +++ b/session/frametop.conf.example @@ -48,6 +48,7 @@ HANDS_BRIGHT_ON=40 # hand tracking, auto: the colour frames' mean bright HANDS_BRIGHT_OFF=25 # ... and back to the mono cameras under this HANDS_COLOR_LEFT=color_video0 # hand tracking: which colour camera is passthrough_left (hands/tools/check_color.py tells) HANDS_COLOR_CROP=subtract # hand tracking: how the colour calibration's crop applies, subtract | none (check_color.py tells) +#HANDS_MODELS= # hand tracking: a folder of palm.ncnn.* and hand.ncnn.* to use instead of the stock models (hands/models/ncnn) POINTER_HANDS=0 # 1 = pinches click (on the release; hold and move to nudge the pointer first) and grips press and drag, with hand tracking POINTER_PINCH_GAIN=0.5 # hands: the pointer moves this times the pinching hand's angle (precision) POINTER_PINCH_DEADZONE=1.5 # hands: degrees the pinching hand moves before the pointer does (a tap's jitter)