{"id":17190716,"url":"https://github.com/dyollb/segmantic","last_synced_at":"2025-04-13T19:42:32.007Z","repository":{"id":36951390,"uuid":"405870116","full_name":"dyollb/segmantic","owner":"dyollb","description":"Semantic segmentation and image-to-image translation based on AI","archived":false,"fork":false,"pushed_at":"2024-11-07T15:13:11.000Z","size":8500,"stargazers_count":1,"open_issues_count":11,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T10:21:30.554Z","etag":null,"topics":["image-processing","image-segmentation","machine-learning","medical-image-analysis","monai","pytorch","simpleitk"],"latest_commit_sha":null,"homepage":"https://dyollb.github.io/segmantic/","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/dyollb.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}},"created_at":"2021-09-13T07:12:45.000Z","updated_at":"2024-11-07T15:13:56.000Z","dependencies_parsed_at":"2024-03-14T09:31:03.946Z","dependency_job_id":"3d02a1a2-6b50-4b6e-bc19-b2378759b414","html_url":"https://github.com/dyollb/segmantic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2Fsegmantic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2Fsegmantic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2Fsegmantic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dyollb%2Fsegmantic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dyollb","download_url":"https://codeload.github.com/dyollb/segmantic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248771128,"owners_count":21159094,"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":["image-processing","image-segmentation","machine-learning","medical-image-analysis","monai","pytorch","simpleitk"],"created_at":"2024-10-15T01:23:42.069Z","updated_at":"2025-04-13T19:42:31.964Z","avatar_url":"https://github.com/dyollb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic segmentation\n\n[![Build Actions Status](https://github.com/dyollb/segmantic/workflows/CI/badge.svg)](https://github.com/dyollb/segmantic/actions)\n[![Documentation Status](https://github.com/dyollb/segmantic/workflows/Docs/badge.svg)](https://github.com/dyollb/segmantic/actions)\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](https://https://opensource.org/licenses/MIT)\n[![codecov](https://codecov.io/gh/dyollb/segmantic/branch/main/graph/badge.svg)](https://codecov.io/gh/dyollb/segmantic)\n\nSemantic segmentation and image-to-image translation based on AI. This repo collects methods for pre-process data, style transfer and semantic segmentation.\n\n## Installation\n\nDependencies for specific versions of CUDA are listed in `requirements/cu113.txt`, `requirements/cu111.txt`, etc.. It is advisable to install the package in a virtual environment, e.g. using `venv`\n\n```sh\ncd /your/working/directory\npython -m venv .venv\n```\n\nActivate it using e.g. `source .venv/bin/activate` on Linux/Mac and `.venv\\Scripts\\activate.bat` on Windows.\n\nTo install this repo (this will install all dependencies):\n\n```sh\npip install git+https://github.com/dyollb/segmantic.git#egg=segmantic\n```\n\nOr in edit/dev mode\n\n```sh\npip install -e git+https://github.com/dyollb/segmantic.git#egg=segmantic[dev]\n```\n\nOn Windows installing torch with GPU support is slightly more involved. Make sure to first install torch matching the installed CUDA version first or use the requirements files, e.g. for CUDA 11.3\n\n```\n--find-links https://download.pytorch.org/whl/cu113/torch_stable.html\ntorch==1.11.0+cu113\ntorchvision==0.12.0+cu113\n```\n\n## Example scripts\n\nRun training:\n\n```sh\nsegmantic-unet train --help\nsegmantic-unet train -i work/inputs/images -l work/inputs/labels -t work/inputs/labels.txt -r work/outputs\n```\n\nOr with a config file - first create empty config file (yml or json format):\n\n```sh\nsegmantic-unet train-config -c config.yml --print-defaults\n```\n\nEdit `config.yml` e.g. to\n\n```yaml\nimage_dir: work/inputs/images\nlabels_dir: work/inputs/labels\ntissue_list: work/inputs/labels.txt\noutput_dir: work/outputs\ncheckpoint_file: null\nnum_channels: 1\nspatial_dims: 3\nmax_epochs: 500\naugment_intensity: true\naugment_spatial: false\nmixed_precision: true\ncache_rate: 1.0\ngpu_ids:\n- 0\n```\n\nNow run training:\n\n```sh\nsegmantic-unet train-config -c config.yml\n```\n\n## What is this tisse_list?\n\nThe example above included a tissue_list option. This is a path to a text file specifying the labels contained in a segmented image. By convention the 'label=0' is the background and is omitted from the the format. A segmentation with three tissues 'Bone'=1, 'Fat'=2, and 'Skin'=3 would be specified as follows:\n\n```\n    V7\n    N3\n    C0.00 0.00 1.00 0.50 Bone\n    C0.00 1.00 0.00 0.50 Fat\n    C1.00 0.00 0.00 0.50 Skin\n```\n\n## Specifying a dataset via the 'dataset' option\n\nInstead of providing the 'image_dir'/'labels_dir' pair, the training data can also be described by one or multiple json files. Example config that globs data from multiple json files:\n\n```json\n{\n    \"datalist\": [\"/dataA/dataset.json\", \"/dataB/dataset.json\"],\n    \"output_dir\": \"\u003cpath where trained model and logs are saved\u003e\",\n    \"Etc\": \"etc\"\n}\n```\n\nThe `dataset.json` loosely follows the convention used for the [Medical Segmentation Decathlon](http://medicaldecathlon.com/) datasets, and popular codes e.g. [nnUNet](https://github.com/MIC-DKFZ/nnUNet/blob/master/documentation/dataset_conversion.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyollb%2Fsegmantic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdyollb%2Fsegmantic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdyollb%2Fsegmantic/lists"}