{"id":47336644,"url":"https://github.com/structuralneurobiologylab/banis","last_synced_at":"2026-03-17T22:00:30.196Z","repository":{"id":258413645,"uuid":"873737031","full_name":"StructuralNeurobiologyLab/banis","owner":"StructuralNeurobiologyLab","description":"BANIS: Baseline for Affinity-based Neuron Instance Segmentation","archived":false,"fork":false,"pushed_at":"2025-08-29T12:39:36.000Z","size":132,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-29T15:53:48.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StructuralNeurobiologyLab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-16T16:23:53.000Z","updated_at":"2025-08-14T20:59:05.000Z","dependencies_parsed_at":"2024-10-18T22:27:55.714Z","dependency_job_id":"67ad05ed-ccbf-434d-8926-f972d4d05968","html_url":"https://github.com/StructuralNeurobiologyLab/banis","commit_stats":null,"previous_names":["structuralneurobiologylab/banis"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StructuralNeurobiologyLab/banis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StructuralNeurobiologyLab%2Fbanis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StructuralNeurobiologyLab%2Fbanis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StructuralNeurobiologyLab%2Fbanis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StructuralNeurobiologyLab%2Fbanis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StructuralNeurobiologyLab","download_url":"https://codeload.github.com/StructuralNeurobiologyLab/banis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StructuralNeurobiologyLab%2Fbanis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30633125,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T17:32:55.572Z","status":"ssl_error","status_checked_at":"2026-03-17T17:32:38.732Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-03-17T22:00:09.783Z","updated_at":"2026-03-17T22:00:30.188Z","avatar_url":"https://github.com/StructuralNeurobiologyLab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BANIS: Baseline for Affinity-based Neuron Instance Segmentation\n\n**An easily adaptable baseline for the [Neuron Instance Segmentation Benchmark (NISB)](https://structuralneurobiologylab.github.io/nisb/), [predicting affinities](https://arxiv.org/abs/1706.00120) with [modern architectures](https://arxiv.org/abs/2303.09975) and simple connected components for post-processing**\n\n## Prerequisites\n\n[Download NISB datasets](https://structuralneurobiologylab.github.io/nisb/) and set up a conda/mamba environment:\n\n```bash\n# With environment.yaml\nmamba env create -f environment.yaml\nmamba activate nisb\n\n# Without yaml\nmamba create -n nisb -c conda-forge python=3.11 -y\nmamba activate nisb \npip install torch torchvision torchaudio numpy connected-components-3d numba pytorch-lightning zarr monai scipy cython tensorboard\npip install git+https://github.com/MIC-DKFZ/MedNeXt.git#egg=mednextv1\npip install git+https://github.com/funkelab/funlib.evaluate.git \n```\n\nTested on a Slurm cluster with nodes equipped with 1 NVIDIA A40 GPU and 500 GB RAM (stay tuned for a less RAM-intensive version).\n\n## Usage\n\nRun a single training session (BANIS-S(mall)):\n\n```bash\npython BANIS.py --seed 0 --batch_size 8 --n_steps 50000 --data_setting base --base_data_path /local/dataset/dir/ --save_path /local/logging/dir/\n```\nResults are logged to TensorBoard. For GPUs with less than 48 GB memory, reduce `batch_size` (and adjust `n_steps` / `learning_rate`). For BANIS-L(arge) add `--model_id L --kernel_size 5`. Additional options are in `parse_args` of `BANIS.py`.\n\nTo run multiple jobs on Slurm, adjust `config.yaml` and `aff_train.sh`, then:\n\n```bash\npython slurm_job_scheduler.py\n```\n\nAdding an `auto_resubmit` argument to `config.yaml` allows Slurm to automatically resubmit jobs that reach the Slurm time limit (see `aff_train.sh`).\n\n## Evaluation\n\nTo evaluate a predicted segmentation (`.zarr` or `.npy`):\n\n```bash\npython metrics.py --pred_seg /path/to/predictions.zarr --skel_path /path/to/skeleton.pkl [--load_to_memory]\n```\n\n## Visualization\n\nTo visualize the validation cube of each dataset, run:\n\n```bash\n show_data.py --base_path /local/benchmark/dir/ \n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstructuralneurobiologylab%2Fbanis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstructuralneurobiologylab%2Fbanis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstructuralneurobiologylab%2Fbanis/lists"}