diff options
author | Martin Weinelt <mweinelt@users.noreply.github.com> | 2022-02-23 11:36:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-23 11:36:10 +0100 |
commit | 6a3a14be42fca25934c1d297f81c5ddc6221780a (patch) | |
tree | 73b5de61e35d3b15a60eeb341ca8f90b5d44bbf1 /pkgs/development | |
parent | 312dde723cd1546eef66b4e750343c0fbabf894f (diff) | |
parent | c995349365e82fcf8510a97d9847b9136e92cf49 (diff) |
Merge pull request #161418 from ozkutuk/init-videocr
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/python-modules/videocr/default.nix | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/videocr/default.nix b/pkgs/development/python-modules/videocr/default.nix new file mode 100644 index 0000000000000..a6ac156b70635 --- /dev/null +++ b/pkgs/development/python-modules/videocr/default.nix @@ -0,0 +1,46 @@ +{ lib +, buildPythonPackage +, fetchPypi +, python-Levenshtein +, pytesseract +, opencv4 +, fuzzywuzzy +}: + +buildPythonPackage rec { + pname = "videocr"; + version = "0.1.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "1clifwczvhvbaw2spgxkkyqsbqh21vyfw3rh094pxfmq89ylyj63"; + }; + + propagatedBuildInputs = [ + python-Levenshtein + pytesseract + opencv4 + fuzzywuzzy + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace "opencv-python" "opencv" + substituteInPlace videocr/constants.py \ + --replace "master" "main" + substituteInPlace videocr/video.py \ + --replace '--tessdata-dir "{}"' '--tessdata-dir="{}"' + ''; + + # Project has no tests + doCheck = false; + + pythonImportsCheck = [ "videocr" ]; + + meta = with lib; { + description = "Extract hardcoded subtitles from videos using machine learning"; + homepage = "https://github.com/apm1467/videocr"; + license = licenses.mit; + maintainers = with maintainers; [ ozkutuk ]; + }; +} |