-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
103 lines (91 loc) · 3.72 KB
/
Copy pathpyproject.toml
File metadata and controls
103 lines (91 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[project]
name = "face-recognition-cli"
version = "0.8.0"
description = "Face recognition and identity management: detect faces, collect embeddings per identity, and manage them by generated id and human name — enroll, match, list, forget one, and forget all at once. Extracted from reachy-mini-cli's OpenCV YuNet+SFace engine so Reachy Mini depends on it instead of carrying its own copy."
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.12"
authors = [{name = "AgentCulture"}]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: Apache Software License",
"Topic :: Software Development",
"Intended Audience :: Developers",
]
dependencies = ["numpy>=1.26,<3"]
# `numpy` is the only base dependency: both the ported FaceEngine (embedding
# arrays) and FaceStore (per-embedding .npy files) need it, so it can't stay
# behind an extra the way the template's zero-runtime-deps property would
# prefer — this deliberately gives that property up (issue #1, q1).
#
# [cpu] and [gpu] are compute-class extras, not model-class extras: both pull
# the SAME opencv-python-headless wheel and run the SAME ONNX models
# (YuNet detector + SFace embedder), producing the SAME embedding space. A
# face enrolled under one extra must match under the other — accelerating
# *execution* must never fork the model.
[project.optional-dependencies]
# The Raspberry-Pi-class robot box: the default path. headless because a
# robot box has no GUI to bind against. cv2 is lazy-imported inside
# face_recognition_cli's engine module only — never at import time — so a
# bare install without this extra stays importable and fails with a clean
# exit-2 CliError naming [cpu]/[gpu] instead of an ImportError traceback.
cpu = ["opencv-python-headless>=4.9,<5"]
# DGX Spark / Jetson / RTX-class hosts, for throughput. Same package, same
# models: v1 GPU acceleration is cv2's own CUDA DNN backend, used when the
# locally installed OpenCV build carries it (Jetson/DGX builds typically do;
# the PyPI opencv-python-headless wheel does not ship CUDA DNN, so this extra
# alone doesn't guarantee acceleration — the build backing it does). No
# second inference stack is introduced here, so the embedding space stays
# identical by construction. onnxruntime-gpu over the same ONNX files is the
# documented future path if throughput demands more than the DNN backend
# gives.
gpu = ["opencv-python-headless>=4.9,<5"]
[project.urls]
Homepage = "https://github.com/agentculture/face-recognition-cli"
Issues = "https://github.com/agentculture/face-recognition-cli/issues"
[project.scripts]
face-recognition = "face_recognition_cli.cli:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["face_recognition_cli"]
[dependency-groups]
dev = [
"pytest>=8.0",
"pytest-xdist>=3.0",
"pytest-cov>=4.1",
"bandit>=1.7.5",
"flake8>=6.1",
"isort>=5.12.0",
"black>=23.7.0",
"teken>=0.8",
]
[tool.coverage.run]
source = ["face_recognition_cli"]
omit = ["face_recognition_cli/__pycache__/*"]
# Emit repo-relative paths in coverage.xml so SonarCloud maps them to
# sonar.sources=face_recognition_cli (absolute/.venv paths fail to map → empty coverage).
relative_files = true
[tool.coverage.report]
fail_under = 60
show_missing = true
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.",
"if TYPE_CHECKING:",
]
[tool.isort]
profile = "black"
line_length = 100
known_first_party = ["face_recognition_cli"]
[tool.black]
line-length = 100
target-version = ["py312"]
[tool.bandit]
exclude_dirs = ["tests"]
skips = ["B101", "B404", "B603"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-ra"