2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
2024-09-19 14:19:46 +00:00
|
|
|
setuptools,
|
2024-06-05 15:53:02 +00:00
|
|
|
levenshtein,
|
|
|
|
pytesseract,
|
|
|
|
opencv4,
|
|
|
|
fuzzywuzzy,
|
2022-03-05 16:20:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "videocr";
|
|
|
|
version = "0.1.6";
|
2024-09-19 14:19:46 +00:00
|
|
|
pyproject = true;
|
2022-03-05 16:20:37 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-w0hPfUK4un5JAjAP7vwOAuKlsZ+zv6sFV2vD/Rl3kbI=";
|
2022-03-05 16:20:37 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2023-01-20 10:41:00 +00:00
|
|
|
levenshtein
|
2022-03-05 16:20:37 +00:00
|
|
|
pytesseract
|
|
|
|
opencv4
|
|
|
|
fuzzywuzzy
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail "python-Levenshtein" "Levenshtein" \
|
|
|
|
--replace-fail "opencv-python" "opencv"
|
2022-03-05 16:20:37 +00:00
|
|
|
substituteInPlace videocr/constants.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail "master" "main"
|
2022-03-05 16:20:37 +00:00
|
|
|
substituteInPlace videocr/video.py \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail '--tessdata-dir "{}"' '--tessdata-dir="{}"'
|
2022-03-05 16:20:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# 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 ];
|
|
|
|
};
|
|
|
|
}
|