Run this model with HF Jobs
Run denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model with ultralytics:
from huggingface_hub import hf_hub_download from ultralytics import YOLO # pick the weights file from this repo's "Files and versions" tab weights = hf_hub_download("denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model", "<weights>.pt") model = YOLO(weights) source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
Madeline - Finger Tip Recognition Model
A YOLO26n object detector that finds the tip of a raised index finger in a camera frame, exported as TorchScript for PyTorch Mobile on Android. It was trained on two datasets together:
the Madeline - Finger Tip Recognition Dataset, frames recorded with the Madeline Android app (one person, two rooms);
its HaGRID Extension, 15,460 pictures of 10,600 other people cut from HaGRIDv2 and labelled with the same rule.
One class:
0: Finger, a box around the tip of the raised or pointing index finger.File:
madeline_finger_recognition_model.pt, TorchScript, 10.2 MB.This is the third version of the model (2026-11-28). It ships in Madeline 1.5. It was trained on the same pictures as the second version, for longer, and with the pictures of a finger pointing at the camera used twice in each epoch.
Earlier versions are in this repository's history. The second version, shipped in Madeline 1.2 to 1.4, is at revision e00860f. The first version, trained on the recorded frames alone and shipped in Madeline 1.1, is at revision 95e1395. Input and output are the same in all three, so the file can be swapped in place.
Input and output
| Shape | Meaning | |
|---|---|---|
| Input | 1 × 3 × 640 × 384, float32 |
RGB image, height 640, width 384, values 0 to 1 |
| Output | 1 × 5 × 5040, float32 |
For each of 5040 candidate boxes: x center, y center, width, height, Finger score |
Preparing a frame. The model expects a portrait 9:16 picture, such as a 1080 × 1920 camera frame. Resize it to 360 × 640, then add 12 gray pixels (value 114) on the left and on the right to reach 384 × 640.
Reading the output. Box values are in pixels of the 640 × 384 input and
the score is between 0 and 1. Take the candidate with the highest score. If
that score is at least 0.25 the frame shows a fingertip and that candidate is
its box; otherwise no finger was detected. To get back to the 1080 × 1920
frame: x = (x - 12) × 3, y = y × 3, and width and height × 3.
The file contains the raw detection head, without box filtering (NMS). Taking the single best candidate is enough for one finger per frame.
Use on Android
// build.gradle.kts: implementation("org.pytorch:pytorch_android:2.1.0")
val model = Module.load(modelPath)
// pixels: FloatArray of 3 * 640 * 384 values, 0 to 1, all red values first, then green, then blue
val input = Tensor.fromBlob(pixels, longArrayOf(1, 3, 640, 384))
val output = model.forward(IValue.from(input)).toTensor().dataAsFloatArray
// output[c * 5040 + i] is value c of candidate i
// c: 0 = x center, 1 = y center, 2 = width, 3 = height, 4 = Finger score
Use in Python
import torch
model = torch.jit.load("madeline_finger_recognition_model.pt")
output = model(torch.zeros(1, 3, 640, 384)) # 1 x 5 x 5040
best = output[0, 4].argmax()
x_center, y_center, width, height, score = output[0, :, best]
Training
| Base model | Ultralytics YOLO26n (yolo26n.pt, pretrained) |
| Library | Ultralytics 8.4.220 |
| Training images | 588 recorded frames, each used 4 times per epoch, and 10,828 extension pictures, of which the 1,690 with a finger pointing at the camera are used twice per epoch: 14,870 images an epoch |
| Validation images | 168 recorded frames and 3,145 extension pictures |
| Test images | 80 recorded frames and 1,487 extension pictures |
| Image size | 640 |
| Batch size | 32 |
| Epochs | 64 of at most 100: training stopped after 20 epochs without a better validation result. The weights are those of epoch 44 |
| Hardware | Google Colab GPU, about 100 minutes |
The extension is split by person, so its validation and test pictures show people who are not in the training pictures.
Results
Validation set (3,313 images of both datasets) at epoch 44:
| Precision | Recall | mAP50 | mAP50-95 |
|---|---|---|---|
| 0.968 | 0.959 | 0.972 | 0.665 |
Test sets, measured on the exported TorchScript file with the frame preparation and the 0.25 threshold described above. A fingertip counts as found when the centre of the model's box lies inside the labelled box.
| Recorded frames (80) | Extension, 1,013 unseen people (1,487) | |
|---|---|---|
| Pictures with a finger: found | 79 of 79 | 1,265 of 1,286 (98.4%) |
| Box in the wrong place | 0 | 16 |
| Nothing detected | 0 | 5 |
| Pictures without a finger: false alarm | 0 of 1 | 0 of 201 |
| Overlap of the box with the label (IoU), median | 0.87 | 0.85 |
The extension pictures by kind:
| Found | |
|---|---|
| Raised index finger | 1,045 of 1,046 (99.9%) |
| Index finger pointing at the camera | 220 of 240 (91.7%) |
Against the earlier versions, on the same extension test pictures: the second version found 1,251 of the 1,286 (97.3%), with 13 boxes in the wrong place and 22 pictures in which it detected nothing. The validation numbers of the two are nearly the same; what the longer training changed is that fewer fingers go undetected. The first version found 519 of the 1,286 (40.4%), with 6 false alarms in the 201 pictures without a finger.
Compatibility
- TorchScript archive, file format version 4, exported on CPU in float32, with the same operators and the same output layout as the first two versions.
- It loads and runs in Madeline 1.5 on a Google Pixel 8a with
org.pytorch:pytorch_android:2.1.0, at about 110 to 150 ms per frame.
Limitations
- The model looks for one fingertip per frame: a single raised index finger, or an index finger pointed at the camera.
- A finger pointed at the camera is found less often than a raised one (91.7% against 99.9% in the test pictures).
- The labels of both datasets are machine-made (MediaPipe hand landmarks) and only samples were checked by eye. In pictures where the finger points at the camera the fingertip is seen end-on and the labels are less exact.
- The extension pictures are enlarged cuts from photos taken mostly indoors with front-facing cameras. Outdoor scenes, gloves and unusual lighting are rare in the training data.
- The recorded test frames come from the same recordings as the recorded training frames, so that column says little about new scenes; the extension column is the better guide for other people.
License and attribution
AGPL-3.0. The model is trained from Ultralytics YOLO26 weights with the Ultralytics library, which are AGPL-3.0. The recorded dataset is CC BY 4.0.
Most of the training pictures are cut from HaGRIDv2 by Anton Nuzhdin, Alexander Nagaev, Alexander Sautin, Alexander Kapitanov and Karina Kvanchiani, which is distributed under the HaGRID public license. See the extension's dataset card for what was changed.
@misc{nuzhdin2024hagridv21mimagesstatic,
title={HaGRIDv2: 1M Images for Static and Dynamic Hand Gesture Recognition},
author={Anton Nuzhdin and Alexander Nagaev and Alexander Sautin and Alexander Kapitanov and Karina Kvanchiani},
year={2024},
eprint={2412.01508},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
- Downloads last month
- 100
Model tree for denizkaryaacikbas/Madeline-Finger-Tip-Recognition-Model
Base model
Ultralytics/YOLO26