torchlm  by xlite-dev

PyTorch library for face landmark detection: training, evaluation, and inference

created 3 years ago
264 stars

Top 97.5% on sourcepulse

GitHubView on GitHub
Project Summary

This library provides a high-level PyTorch pipeline for face landmark detection, offering training, evaluation, export, and inference capabilities. It targets researchers and developers needing a flexible and efficient solution for facial landmark analysis, featuring over 100 data augmentations and support for various backbone architectures.

How It Works

torchlm abstracts the complexities of face landmark detection into a unified pipeline. It supports multiple model architectures (PIPNet, YOLOX, ResNet, MobileNet, ShuffleNet) and integrates seamlessly with torchvision and albumentations for extensive data augmentation. A key feature is its autodtype wrapper, which handles data type compatibility between NumPy arrays and PyTorch tensors transparently, simplifying the augmentation process.

Quick Start & Requirements

  • Install via pip: pip install torchlm>=0.1.6.10
  • Install from source for the latest version: git clone --depth=1 https://github.com/DefTruth/torchlm.git && cd torchlm && pip install -e .
  • Requires PyTorch. GPU acceleration is recommended for training and inference.
  • For albumentations integration, ensure correct OpenCV installation (opencv-python-headless).

Highlighted Details

  • Offers 30+ native data augmentations for landmarks, plus bindings for 80+ from torchvision and albumentations.
  • Supports training, evaluation (NME, FR, AUC), ONNX export, and both Python and C++ inference.
  • Includes pre-defined dataset converters for common benchmarks like 300W, COFW, WFLW, and AFLW.
  • Provides C++ inference APIs via lite.ai.toolkit for ONNXRuntime, MNN, NCNN, and TNN.

Maintenance & Community

The project is actively maintained by xlite-dev. Links to documentation, ZhiHu, and PyPI are provided.

Licensing & Compatibility

Released under the MIT License, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

The README mentions potential OpenCV version conflicts when using albumentations, requiring specific uninstallation and reinstallation steps. Some advanced features or custom settings might require diving into model-specific source code for detailed configuration.

Health Check
Last commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
1
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.