-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean biapy package files and create binary for CLI
- Loading branch information
1 parent
2a19d9d
commit 3a0a035
Showing
4 changed files
with
70 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,54 @@ | ||
__version__="3.2.0" | ||
__version__="3.4.0" | ||
|
||
import argparse | ||
import os | ||
import sys | ||
from ._biapy import BiaPy | ||
|
||
|
||
def main(): | ||
|
||
########################## | ||
# ARGS COMPROBATION # | ||
########################## | ||
|
||
# Normal exec: | ||
# python -u main.py \ | ||
# --config $input_job_cfg_file \ | ||
# --result_dir $result_dir \ | ||
# --name $job_name \ | ||
# --run_id $job_counter \ | ||
# --gpu 0 | ||
# Distributed: | ||
# python -u -m torch.distributed.run \ | ||
# --nproc_per_node=2 \ | ||
# main.py \ | ||
# --config $input_job_cfg_file \ | ||
# --result_dir $result_dir \ | ||
# --name $job_name \ | ||
# --run_id $job_counter \ | ||
# --gpu 0,1 | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--config", required=True, help="Path to the configuration file") | ||
parser.add_argument("--result_dir", help="Path to where the resulting output of the job will be stored", | ||
default=os.getenv('HOME')) | ||
parser.add_argument("--name", help="Job name", default="unknown_job") | ||
parser.add_argument("--run_id", help="Run number of the same job", type=int, default=1) | ||
parser.add_argument("--gpu", help="GPU number according to 'nvidia-smi' command", type=str) | ||
|
||
# Distributed training parameters | ||
parser.add_argument('--world_size', default=1, type=int, | ||
help='number of distributed processes') | ||
parser.add_argument('--local_rank', default=-1, type=int, | ||
help='Node rank for distributed training. Necessary for using the torch.distributed.launch utility.') | ||
parser.add_argument('--dist_on_itp', action='store_true') | ||
parser.add_argument('--dist_url', default='env://', | ||
help='url used to set up distributed training') | ||
parser.add_argument('--dist_backend', type=str, default='nccl', choices=['nccl', 'gloo'], | ||
help='Backend to use in distributed mode') | ||
args = parser.parse_args() | ||
|
||
_biapy = BiaPy(**vars(args)) | ||
_biapy.run_job() | ||
sys.exit(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
[build-system] | ||
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2", "numpy>=1.24.3"] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "biapy" | ||
version = "3.3.8" | ||
version = "3.4.0" | ||
description = "BiaPy: Bioimage analysis pipelines in Python" | ||
readme = "README.md" | ||
requires-python = ">=3.10" | ||
authors = [{ name = "Daniel Franco-Barranco", email = "[email protected]" }] | ||
license = { file = "LICENSE" } | ||
maintainers = [{ name = "Daniel Franco-Barranco", email = "[email protected]" }] | ||
license = { file = "LICENSE.md" } | ||
classifiers = [ | ||
"License :: OSI Approved :: MIT License", | ||
"Environment :: GPU :: NVIDIA CUDA :: 11.8", | ||
|
@@ -34,11 +36,19 @@ dependencies = [ | |
"bioimageio.core==0.5.9", | ||
"imagecodecs>=2024.1.1", | ||
"pytorch-msssim>=1.0.0", | ||
"numpy>=1.26.4", | ||
] | ||
requires-python = ">=3.10" | ||
|
||
[project.scripts] | ||
spam-cli = "biapy:BiaPy" | ||
biapy = "biapy:main" | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/BiaPyX/BiaPy" | ||
"Homepage" = "https://biapyx.github.io" | ||
"Source" = "https://github.com/BiaPyX/BiaPy" | ||
"Forum" = "https://forum.image.sc/tag/biapy" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
include = ['biapy*'] |