2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
levenshtein,
|
|
|
|
pytesseract,
|
|
|
|
opencv4,
|
|
|
|
fuzzywuzzy,
|
2022-03-05 16:20:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "videocr";
|
|
|
|
version = "0.1.6";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
sha256 = "1clifwczvhvbaw2spgxkkyqsbqh21vyfw3rh094pxfmq89ylyj63";
|
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-01-20 10:41:00 +00:00
|
|
|
levenshtein
|
2022-03-05 16:20:37 +00:00
|
|
|
pytesseract
|
|
|
|
opencv4
|
|
|
|
fuzzywuzzy
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2023-02-02 18:25:31 +00:00
|
|
|
--replace "python-Levenshtein" "Levenshtein" \
|
2022-03-05 16:20:37 +00:00
|
|
|
--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 ];
|
|
|
|
};
|
|
|
|
}
|