Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
82 lines (74 loc) · 3.08 KB
/
Copy pathsetup.py
File metadata and controls
82 lines (74 loc) · 3.08 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
import json
import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
def parse_requirements(file_name):
"""Read a requirements file, skipping its blank lines, comments and pip options"""
with open(file_name, "r", encoding="utf-8") as f:
lines = [line.strip() for line in f]
return [line for line in lines if line and not line.startswith(("#", "-"))]
requirements = parse_requirements("requirements_base.txt")
# deepface runs on tensorflow, pytorch or onnxruntime. onnxruntime is a base requirement, so
# `pip install deepface` is enough to run it on onnx. `pip install "deepface[tensorflow]"` and
# `pip install "deepface[pytorch]"` install the other backend engines if you want them.
tensorflow_requirements = parse_requirements("requirements_tf.txt")
pytorch_requirements = parse_requirements("requirements_pytorch.txt")
# `pip install "deepface[api]"` installs the dependencies to serve deepface as a rest api
api_requirements = parse_requirements("requirements_api.txt")
# `pip install "deepface[cli]"` installs the dependencies to use deepface from the command line
cli_requirements = parse_requirements("requirements_cli.txt")
# `pip install "deepface[pandas]"` installs pandas, which will not be a base requirement in the future
pandas_requirements = parse_requirements("requirements_pandas.txt")
# `pip install "deepface[grpc]"` installs the dependencies to serve deepface over grpc
grpc_requirements = parse_requirements("requirements_grpc.txt")
with open("package_info.json", "r", encoding="utf-8") as f:
package_info = json.load(f)
setuptools.setup(
name="deepface",
version=package_info["version"],
author="Sefik Ilkin Serengil",
author_email="serengil@gmail.com",
description=(
"A Lightweight Face Recognition and Facial Attribute Analysis Framework"
" (Age, Gender, Emotion, Race) for Python"
),
data_files=[
(
"",
[
"README.md",
"requirements_base.txt",
"requirements_tf.txt",
"requirements_pytorch.txt",
"requirements_api.txt",
"requirements_cli.txt",
"requirements_pandas.txt",
"requirements_grpc.txt",
"package_info.json",
],
)
],
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/serengil/deepface",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
entry_points={
"console_scripts": ["deepface = deepface.DeepFace:cli"],
},
python_requires=">=3.8",
license="MIT",
install_requires=requirements,
extras_require={
"tensorflow": tensorflow_requirements,
"pytorch": pytorch_requirements,
"api": api_requirements,
"grpc": grpc_requirements,
"cli": cli_requirements,
"pandas": pandas_requirements,
},
)