Skip to content

Commit 3ddbbd2

Browse files
authored
Merge pull request #81 from serengil/feat-task-1002-package-version
package version added into the interface
2 parents 2d5b56e + ba8b517 commit 3ddbbd2

File tree

6 files changed

+28
-3
lines changed

6 files changed

+28
-3
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ for face in faces:
8787

8888
<p align="center"><img src="https://raw.githubusercontent.com/serengil/retinaface/master/tests/outputs/alignment-procedure.png" width="80%" height="80%"></p>
8989

90+
If you prefer to prioritize alignment before detection, you may opt to set the `align_first` parameter to True. By following this approach, you will eliminate the black pixel areas that arise as a result of alignment following detection. This functionality is applicable only when the provided image contains a single face.
91+
9092
**Face Recognition** - [`Demo`](https://youtu.be/WnUVYQP4h44)
9193

9294
Notice that face recognition module of insightface project is [ArcFace](https://sefiks.com/2020/12/14/deep-face-recognition-with-arcface-in-keras-and-python/), and face detection module is RetinaFace. ArcFace and RetinaFace pair is wrapped in [deepface](https://github.com/serengil/deepface) library for Python. Consider to use deepface if you need an end-to-end face recognition pipeline.
@@ -151,7 +153,7 @@ If you are using RetinaFace in your research, please consider to cite its [origi
151153
}
152154
```
153155

154-
Finally, if you use this RetinaFace re-implementation in your GitHub projects, please add retina-face dependency in the requirements.txt.
156+
Finally, if you use this RetinaFace re-implementation in your GitHub projects, please add `retina-face` dependency in the requirements.txt.
155157

156158
## Licence
157159

package_info.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"version": "0.0.15"
3+
}

retinaface/RetinaFace.py

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import numpy as np
77
import tensorflow as tf
88

9+
from retinaface import __version__
910
from retinaface.model import retinaface_model
1011
from retinaface.commons import preprocess, postprocess
1112
from retinaface.commons.logger import Logger

retinaface/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "0.0.15"

setup.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import json
12
import setuptools
23

34
with open("README.md", "r", encoding="utf-8") as fh:
@@ -6,13 +7,17 @@
67
with open("requirements.txt", "r", encoding="utf-8") as f:
78
requirements = f.read().split("\n")
89

10+
with open("package_info.json", "r", encoding="utf-8") as f:
11+
package_info = json.load(f)
12+
13+
914
setuptools.setup(
1015
name="retina-face", # pip install retina-face
11-
version="0.0.14",
16+
version=package_info["version"],
1217
author="Sefik Ilkin Serengil",
1318
author_email="[email protected]",
1419
description="RetinaFace: Deep Face Detection Framework in TensorFlow for Python",
15-
data_files=[("", ["README.md", "requirements.txt"])],
20+
data_files=[("", ["README.md", "requirements.txt", "package_info.json"])],
1621
long_description=long_description,
1722
long_description_content_type="text/markdown",
1823
url="https://github.com/serengil/retinaface",

tests/test_package.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import json
2+
from retinaface import RetinaFace
3+
from retinaface.commons.logger import Logger
4+
5+
logger = Logger("tests/test_package.py")
6+
7+
8+
def test_version():
9+
with open("./package_info.json", "r", encoding="utf-8") as f:
10+
package_info = json.load(f)
11+
12+
assert RetinaFace.__version__ == package_info["version"]
13+
logger.info("✅ versions are matching in both package_info.json and retinaface/__init__.py")

0 commit comments

Comments
 (0)