face_morpher: init at unstable-2019-06-30

This commit is contained in:
Simon Bruder 2021-06-12 11:08:06 +02:00
parent 6609282c70
commit daa5967b81
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 51 additions and 0 deletions

48
face_morpher/default.nix Normal file
View file

@ -0,0 +1,48 @@
{ lib, fetchurl, runCommandNoCC, buildPythonPackage, fetchFromGitHub, dlib, docopt, matplotlib, numpy, opencv4, scipy, model ? null }:
let
model' = if !isNull model then model else
fetchurl {
url = "http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2";
sha256 = "0bxr25mp6zpzk6icgrmnx7ph0qxs6bdgvjvjhrspmamr1sw2rp7v";
downloadToTemp = true;
postFetch = ''
bzcat $downloadedFile > $out
'';
};
modelDir = runCommandNoCC "face_morpher-models" { } ''
install -Dm 444 ${lib.escapeShellArg model'} "$out/shape_predictor_68_face_landmarks.dat"
'';
in
buildPythonPackage rec {
pname = "face_morpher";
version = "unstable-2019-06-30";
src = fetchFromGitHub {
owner = "alyssaq";
repo = pname;
rev = "7a30611cd9d33469e843cec9cfa23ccf819386a8";
sha256 = "09ahar661r5046gr3qsv2z22x50jz1bv116ci55fsvcjzv64rygw";
};
propagatedBuildInputs = [
dlib
docopt
matplotlib
numpy
opencv4
scipy
];
makeWrapperArgs = [ "--set DLIB_DATA_DIR ${lib.escapeShellArg modelDir}" ];
doCheck = false;
meta = with lib; {
description = "A warper, morpher and averager for human faces";
homepage = "https://github.com/alyssaq/face_morpher";
license = licenses.mit;
maintainers = with maintainers; [ sbruder ];
platforms = platforms.unix;
};
}

View file

@ -28,6 +28,8 @@
deemix = callPythonPackage ./deemix { };
face_morpher = callPythonPackage ./face_morpher { };
mpvScripts = prev.mpvScripts // {
pitchcontrol = callPackage ./mpv-scripts/pitchcontrol { };
};
@ -72,6 +74,7 @@
VisiCut
cyanrip
deemix
face_morpher
oha
snownews
textidote