{"id":13688948,"url":"https://github.com/neuronets/nobrainer-zoo","last_synced_at":"2025-04-24T13:33:34.651Z","repository":{"id":38818466,"uuid":"368897930","full_name":"neuronets/nobrainer-zoo","owner":"neuronets","description":"A Python CLI to execute a collection of deep learning models for brain imaging.","archived":false,"fork":false,"pushed_at":"2023-10-23T15:04:50.000Z","size":305,"stargazers_count":9,"open_issues_count":4,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-03T05:51:09.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuronets.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}},"created_at":"2021-05-19T14:29:10.000Z","updated_at":"2024-08-16T10:18:01.000Z","dependencies_parsed_at":"2022-06-26T22:01:41.412Z","dependency_job_id":"84f318af-6696-4bea-b6a3-0d7409a037be","html_url":"https://github.com/neuronets/nobrainer-zoo","commit_stats":{"total_commits":160,"total_committers":6,"mean_commits":"26.666666666666668","dds":0.2875,"last_synced_commit":"175052f434fb9c9cae77e22ce3e6a7e1e0286e06"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fnobrainer-zoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fnobrainer-zoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fnobrainer-zoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuronets%2Fnobrainer-zoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuronets","download_url":"https://codeload.github.com/neuronets/nobrainer-zoo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250636336,"owners_count":21463058,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":"2024-08-02T15:01:28.512Z","updated_at":"2025-04-24T13:33:34.330Z","avatar_url":"https://github.com/neuronets.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Nobrainer-zoo\nNobrainer-zoo is a toolbox with a collection of deep learning neuroimaging models that eases the use of pretrained \nmodels for various applications. Nobrainer-zoo provides the required environment with all the dependencies for \ntraining/inference of models. You need `singularity/apptainer` (\u003e= 3.7.x/1.0.x) or `docker` to run the Nobrainer-zoo.\n\n\n## Installation\nWe highly recommend to create a separate environment for the nobrainer-zoo. You can use conda or python to create the environment.\n\n```\nconda create -n nobrainer-zoo python=3\nconda activate nobrainer-zoo\n```\n\nor\n\n```\npython3 -m venv /path/to/new/virtual/environment/nobrainer-zoo\nsource /path/to/new/virtual/environment/nobrainer-zoo/bin/activate\n```\n\nThen install the nobrainer-zoo:\n\n```\n[Releases]    pip install nobrainer-zoo\n[Dev version] pip install https://github.com/neuronets/nobrainer-zoo/archive/refs/heads/main.zip\n```\n\nAfter installation, Nobrainer-zoo should be initialized. It also needs a cache folder to download some helper files based on your needs. By default, it creates a cache folder in your home directory (`~/.nobrainer`). If you do not want the cache folder in your `home` directory, you can setup a different cache location by setting the environmental variable `NOBRAINER_CACHE`. run below command to set it.\n\n```\nexport NOBRAINER_CACHE=\u003cpath_to_your_cache_directory\u003e\n```\n\nsince this environmental variable will be lost when you close your terminal session you need to run it next time or a better solution is, to add it to your `~/.bashrc` file.\nsimply open the file with your text editor and add the above line at the end. Restart your terminal or re-run your `bashrc` file by `.~/bashrc` to make this change effective.\n\nTo initialize the `nobrainer-zoo` run:\n\n```\nnobrainer-zoo init\n```\n\n*\u003cfont size=\"1\"\u003eNote: You need to initialize the nobrainer-zoo only once.\n\nRun help to see the functions and each function's options.\n\n```\nnobrainer-zoo --help\nnobrainer-zoo ls --help\nnobrainer-zoo predict --help\nnobrainer-zoo fit --help\nnobrainer-zoo register --help\nnobrainer-zoo generate --help\n```\n\n## Available models\n\nTo see the list of available models in the nobrainer-zoo run `nobrainer-zoo ls`\n\nModels are added based on their organization, model name , and version. One model might have different versions. Some models (such as `kwyk` or `SyntSR`) have various types which means there was various training method or dataset that lead to different trained models. You can select the model type with `model_type` option for the train and inference.\n\n\nList of models which will be added in near future can be find [here](https://github.com/Hoda1394/zoo/blob/add/inference_scripts/models_to_add.md). You can suggest a model [here](https://github.com/neuronets/zoo/issues/new/choose).\n\n*\u003cfont size=\"1\"\u003eNote: models are distributed under their original license.\u003c/font\u003e*\n\n## Inference Example\n\nInference with default options,\n\n```\nnobrainer-zoo predict -m neuronets/brainy/0.1.0 \u003cpath_to_input\u003e \u003cpath_to_save_output\u003e\n\nnobrainer-zoo register -m DDIG/SynthMorph/1.0.0 --model_type brains \u003cpath_to_moving\u003e \u003cpath_to_fixed\u003e \u003cpath_to_moved\u003e\n```\n\npass the model specific options with `--options` argument to the model.\n\n```\nnobrainer-zoo predict -m neuronets/brainy/0.1.0 \u003cpath_to_input\u003e \u003cpath_to_save_output\u003e --options verbose block_shape=[128,128,128]\n\nnobrainer-zoo predict -m UCL/SynthSeg/0.1 \u003cpath_to_input\u003e \u003cpath_to_save_output\u003e --options post=\u003cpath_to_posteriors\u003e\n```\n\n**Note**: Nobrainer-zoo will use the gpu by default. So, if you want to force it to use the cpu while the gpu is available you need to pass `--cpu` flag. If you are using docker without any gpu passing the `--cpu` flag is a must. Otherwise, you will get an error.\n\n**Note**: If you are using docker make sure to use the absolute path for input and putput files.\n\n## Train Example\n\nFor training with sample dataset you do not need to pass any dataset pattern.\n\n```\nnobrainer-zoo fit -m neuronets/brainy\n```\n\nTo train the network with your own data pass the dataset pattern in the form of tfrecords.\n\n```\nnobrainer-zoo fit -m neuronets/brainy \"\u003cdata_train_pattern\u003e\" \"\u003cdata_evaluate_pattern\u003e\"\n```\n\nOther parameters can be changed by providing a spec file or changing them with cli command.\n\n```\nnobrainer-zoo fit -m neuronets/brainy --spec_file \u003cpath_to_spec_file\u003e\n```\n\n```\nnobrainer-zoo fit -m neuronets/brainy --train epoch=2\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuronets%2Fnobrainer-zoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuronets%2Fnobrainer-zoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuronets%2Fnobrainer-zoo/lists"}