-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python3Packages.mtcnn: init at 0.1.1; python3Packages.retinaface: ini…
…t at 0.0.17; python3Packages.deepface: init at 0.0.92 (#347052)
- Loading branch information
Showing
4 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
fetchFromGitHub, | ||
fire, | ||
flask, | ||
flask-cors, | ||
gdown, | ||
gunicorn, | ||
mtcnn, | ||
numpy, | ||
opencv4, | ||
pandas, | ||
pillow, | ||
pythonOlder, | ||
requests, | ||
retinaface, | ||
setuptools, | ||
tensorflow, | ||
tqdm, | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "deepface"; | ||
version = "0.0.92"; | ||
pyproject = true; | ||
|
||
disabled = pythonOlder "3.7"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "serengil"; | ||
repo = "deepface"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-Vjm8lfpGyJ7/1CUwIvxXxHqwmv0+iKewYV3vE08gpPQ="; | ||
}; | ||
|
||
postPatch = '' | ||
# prevent collisions | ||
substituteInPlace setup.py \ | ||
--replace-fail "data_files=[(\"\", [\"README.md\", \"requirements.txt\", \"package_info.json\"])]," "" \ | ||
--replace-fail "install_requires=requirements," "" | ||
substituteInPlace deepface/detectors/OpenCv.py \ | ||
--replace-fail "opencv_home = cv2.__file__" "opencv_home = os.readlink(cv2.__file__)" \ | ||
--replace-fail "folders = opencv_home.split(os.path.sep)[0:-1]" "folders = opencv_home.split(os.path.sep)[0:-4]" \ | ||
--replace-fail "return path + \"/data/\"" "return path + \"/share/opencv4/haarcascades/\"" | ||
''; | ||
|
||
build-system = [ setuptools ]; | ||
|
||
dependencies = [ | ||
fire | ||
flask | ||
flask-cors | ||
gdown | ||
gunicorn | ||
mtcnn | ||
numpy | ||
opencv4 | ||
pandas | ||
pillow | ||
requests | ||
retinaface | ||
tensorflow | ||
tqdm | ||
]; | ||
|
||
# requires internet connection | ||
doCheck = false; | ||
|
||
pythonImportsCheck = [ "deepface" ]; | ||
|
||
meta = { | ||
description = "Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python"; | ||
homepage = "https://github.com/serengil/deepface"; | ||
changelog = "https://github.com/serengil/deepface/releases/tag/v${version}"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ derdennisop ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
fetchFromGitHub, | ||
opencv4, | ||
pytestCheckHook, | ||
pythonOlder, | ||
setuptools, | ||
tensorflow, | ||
}: | ||
|
||
buildPythonPackage { | ||
pname = "mtcnn"; | ||
version = "0.1.1"; | ||
pyproject = true; | ||
|
||
disabled = pythonOlder "3.7"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "ipazc"; | ||
repo = "mtcnn"; | ||
# No tags / releases; using commit: https://github.com/ipazc/mtcnn/commit/3208d443a8f01d317c65d7c97a03bc0a6143c41d | ||
rev = "3208d443a8f01d317c65d7c97a03bc0a6143c41d"; | ||
hash = "sha256-GXUrLJ5XD6V2hT/gjyYSuh/CMMw2xIXKBsYFvQmbLYs="; | ||
}; | ||
|
||
postPatch = '' | ||
substituteInPlace setup.py \ | ||
--replace-fail "setup, setuptools" "setup, find_packages"\ | ||
--replace-fail "setuptools.find_packages" "find_packages"\ | ||
--replace-fail "opencv-python>=4.1.0" ""\ | ||
--replace-fail "keras>=2.0.0" ""\ | ||
--replace-fail "tests_require=['nose']," "" | ||
''; | ||
|
||
build-system = [ setuptools ]; | ||
|
||
dependencies = [ | ||
opencv4 | ||
tensorflow | ||
]; | ||
|
||
pythonImportsCheck = [ "mtcnn" ]; | ||
|
||
nativeCheckInputs = [ pytestCheckHook ]; | ||
|
||
meta = { | ||
description = "MTCNN face detection implementation for TensorFlow"; | ||
homepage = "https://github.com/ipazc/mtcnn"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ derdennisop ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{ | ||
lib, | ||
buildPythonPackage, | ||
fetchFromGitHub, | ||
gdown, | ||
numpy, | ||
opencv4, | ||
pillow, | ||
pytestCheckHook, | ||
pythonOlder, | ||
setuptools, | ||
tensorflow, | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "retinaface"; | ||
version = "0.0.17"; | ||
pyproject = true; | ||
|
||
disabled = pythonOlder "3.7"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "serengil"; | ||
repo = "retinaface"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-0s1CSGlK2bF1F2V/IuG2ZqD7CkNfHGvp1M5C3zDnuKs="; | ||
}; | ||
|
||
postPatch = '' | ||
# prevent collisions | ||
substituteInPlace setup.py \ | ||
--replace-fail "data_files=[(\"\", [\"README.md\", \"requirements.txt\", \"package_info.json\"])]," "" \ | ||
--replace-fail "install_requires=requirements," "" | ||
''; | ||
|
||
# requires internet connection | ||
disabledTestPaths = [ | ||
"tests/test_actions.py" | ||
"tests/test_align_first.py" | ||
"tests/test_expand_face_area.py" | ||
]; | ||
|
||
build-system = [ setuptools ]; | ||
|
||
dependencies = [ | ||
gdown | ||
numpy | ||
opencv4 | ||
pillow | ||
tensorflow | ||
]; | ||
|
||
nativeCheckInputs = [ pytestCheckHook ]; | ||
|
||
pythonImportsCheck = [ "retinaface" ]; | ||
|
||
meta = { | ||
description = "Deep Face Detection Library for Python"; | ||
homepage = "https://github.com/serengil/retinaface"; | ||
changelog = "https://github.com/serengil/retinaface/releases/tag/v${version}"; | ||
license = lib.licenses.mit; | ||
maintainers = with lib.maintainers; [ derdennisop ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters