Skip to content

UniFace: A Unified Face Analysis Library for Python | Detection, alignment, landmarks, face-mesh, recognition, parsing, gaze, attributes and anti-spoofing under one API.

3.8 KB
Raw Blame
[project]
name = "uniface"
version = "4.2.1"
description = "UniFace: A Unified Face Analysis Library for Python"
readme = "README.md"
license = "MIT"
authors = [{ name = "Yakhyokhuja Valikhujaev", email = "[email protected]" }]
maintainers = [
    { name = "Yakhyokhuja Valikhujaev", email = "[email protected]" },
]

requires-python = ">=3.11,<3.15"
keywords = [
    "face-detection",
    "face-recognition",
    "face-tracking",
    "facial-landmarks",
    "face-parsing",
    "face-segmentation",
    "gaze-estimation",
    "age-detection",
    "gender-detection",
    "computer-vision",
    "deep-learning",
    "onnx",
    "onnxruntime",
    "face-analysis",
    "bisenet",
]

classifiers = [
    "Development Status :: 5 - Production/Stable",
    "Intended Audience :: Developers",
    "Intended Audience :: Science/Research",
    "Operating System :: OS Independent",
    "Programming Language :: Python :: 3",
    "Programming Language :: Python :: 3.11",
    "Programming Language :: Python :: 3.12",
    "Programming Language :: Python :: 3.13",
    "Programming Language :: Python :: 3.14",
]

dependencies = [
    "numpy>=1.24",
    "opencv-python>=4.5.5.62",
    "scikit-image>=0.26",
    "scipy>=1.11.4",
    "requests>=2.28.0",
    "tqdm>=4.64.0",
]

[project.optional-dependencies]
cpu = ["onnxruntime>=1.17"]
gpu = ["onnxruntime-gpu>=1.17"]
dev = ["pytest>=7.0.0", "ruff>=0.4.0", "pre-commit>=3.0.0"]
docs = [
    "mkdocs-material",
    "pymdown-extensions",
    "mkdocs-git-committers-plugin-2",
    "mkdocs-git-revision-date-localized-plugin",
]

[project.urls]
Homepage = "https://github.com/yakhyo/uniface"
Repository = "https://github.com/yakhyo/uniface"
Documentation = "https://yakhyo.github.io/uniface"
"Quick Start" = "https://yakhyo.github.io/uniface/quickstart/"
"Model Zoo" = "https://yakhyo.github.io/uniface/models/"

[build-system]
requires = ["setuptools>=77"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = { find = { where = ["."], include = ["uniface*"] } }

[tool.setuptools.package-data]
uniface = ["py.typed"]

[tool.ruff]
line-length = 120
target-version = "py311"
exclude = [
    ".git",
    ".ruff_cache",
    "__pycache__",
    "build",
    "dist",
    "*.egg-info",
    ".venv",
    "venv",
    ".pytest_cache",
    ".mypy_cache",
    "*.ipynb",
]

[tool.ruff.format]
quote-style = "single"
docstring-code-format = true

[tool.ruff.lint]
select = [
    "E",      # pycodestyle errors
    "F",      # pyflakes
    "I",      # isort
    "W",      # pycodestyle warnings
    "UP",     # pyupgrade (modern Python syntax)
    "B",      # flake8-bugbear
    "C4",     # flake8-comprehensions
    "SIM",    # flake8-simplify
    "RUF",    # Ruff-specific rules
    "D205",   # pydocstyle: blank line between docstring summary and description
    "D212",   # pydocstyle: multi-line docstring summary starts on the first line
]
ignore = [
    "E501",   # Line too long (handled by formatter)
    "B008",   # Function call in default argument (common in FastAPI/Click)
    "SIM108", # Use ternary operator (can reduce readability)
    "RUF022", # Allow logical grouping in __all__ instead of alphabetical sorting
    "UP042",  # Keep (str, Enum) weight enums: StrEnum would change their str() output
]

[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"

[tool.ruff.lint.isort]
force-single-line = false
force-sort-within-sections = true
known-first-party = ["uniface"]
section-order = [
    "future",
    "standard-library",
    "third-party",
    "first-party",
    "local-folder",
]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.bandit]
exclude_dirs = ["tests", "scripts", "examples"]
skips = ["B101", "B614"]  # B101: assert, B614: torch.jit.load (models are SHA256 verified)

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
addopts = "-v --tb=short"