about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/videocr/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/videocr/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/videocr/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/videocr/default.nix b/nixpkgs/pkgs/development/python-modules/videocr/default.nix
new file mode 100644
index 000000000000..a6ac156b7063
--- /dev/null
+++ b/nixpkgs/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 ];
+  };
+}