Merge pull request #311731 from TomaSajt/mokuro

mokuro: init at 0.1.8
This commit is contained in:
Pol Dellaiera 2024-06-05 04:18:50 +02:00 committed by GitHub
commit dcc42c10b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 97 additions and 0 deletions

@ -0,0 +1,61 @@
{
lib,
python3Packages,
fetchFromGitHub,
}:
python3Packages.buildPythonApplication rec {
pname = "mokuro";
version = "0.1.8";
pyproject = true;
src = fetchFromGitHub {
owner = "kha-white";
repo = "mokuro";
rev = "v${version}";
hash = "sha256-w+hhUt2fTl9zrca4xotK5eNhbfragYNC0u5WDwNGb7k=";
fetchSubmodules = true;
};
postPatch = ''
substituteInPlace setup.py \
--replace-fail 'opencv-python' 'opencv'
'';
nativeBuildInputs = with python3Packages; [ pythonRelaxDepsHook ];
pythonRelaxDeps = [ "torchvision" ];
build-system = with python3Packages; [ setuptools ];
dependencies = with python3Packages; [
fire
loguru
manga-ocr
natsort
numpy
opencv4
pillow
pyclipper
requests
scipy
shapely
torch
torchsummary
torchvision
transformers
tqdm
yattag
];
# tests try to use the network
doCheck = false;
meta = {
description = "Read Japanese manga inside browser with selectable text";
homepage = "https://github.com/kha-white/mokuro";
license = lib.licenses.gpl3Only;
mainProgram = "mokuro";
maintainers = with lib.maintainers; [ tomasajt ];
};
}

@ -0,0 +1,34 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
torch,
}:
buildPythonPackage rec {
pname = "torchsummary";
version = "1.5.1";
pyproject = true;
src = fetchPypi {
inherit pname version;
hash = "sha256-mBv2ieIuDPf5XHRgAvIKJK0mqmudhhE0oUvGzpIjBZA=";
};
build-system = [ setuptools ];
dependencies = [ torch ];
# no tests in pypi tarball
doCheck = false;
pythonImportsCheck = [ "torchsummary" ];
meta = {
description = "Model summary in PyTorch similar to `model.summary()` in Keras";
homepage = "https://github.com/sksq96/pytorch-summary";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ tomasajt ];
};
}

@ -15326,6 +15326,8 @@ self: super: with self; {
torchsde = callPackage ../development/python-modules/torchsde { };
torchsummary = callPackage ../development/python-modules/torchsummary { };
torchvision = callPackage ../development/python-modules/torchvision { };
torchvision-bin = callPackage ../development/python-modules/torchvision/bin.nix {