{"id":32643898,"url":"https://github.com/postmalloc/skeletonide","last_synced_at":"2026-02-27T16:04:36.145Z","repository":{"id":50579985,"uuid":"303361573","full_name":"postmalloc/skeletonide","owner":"postmalloc","description":"Skeletonide is a parallel implementation of Zhang-Suen morphological thinning algorithm written in Halide-lang. Use it for fast skeletonization of binary masks on the GPU.","archived":false,"fork":false,"pushed_at":"2020-10-21T17:44:23.000Z","size":142,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-08-19T03:40:52.130Z","etag":null,"topics":["gpu","halide-lang","halide-pipeline","image-processing","skeletonization","zhang-suen"],"latest_commit_sha":null,"homepage":"","language":"C++","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/postmalloc.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}},"created_at":"2020-10-12T10:51:09.000Z","updated_at":"2023-08-19T03:40:52.130Z","dependencies_parsed_at":"2022-08-24T01:40:23.954Z","dependency_job_id":null,"html_url":"https://github.com/postmalloc/skeletonide","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/postmalloc/skeletonide","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postmalloc%2Fskeletonide","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postmalloc%2Fskeletonide/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postmalloc%2Fskeletonide/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postmalloc%2Fskeletonide/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/postmalloc","download_url":"https://codeload.github.com/postmalloc/skeletonide/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/postmalloc%2Fskeletonide/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281925781,"owners_count":26584821,"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","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["gpu","halide-lang","halide-pipeline","image-processing","skeletonization","zhang-suen"],"created_at":"2025-10-31T03:57:56.291Z","updated_at":"2025-10-31T03:59:01.355Z","avatar_url":"https://github.com/postmalloc.png","language":"C++","readme":"# skeletonide\n\u003cimg src=\"./assets/2spooky.png\" width=\"250px\"/\u003e\n\nSkeletonide is a parallel implementaion of Zhang-Suen morphological\nthinning algorithm written in Halide-lang. It can be used for fast\nskeletonization of binary masks. Can also be run on the GPU.\n\nWhen you build the project, it generates an ahead-of-time\ncompiled static library from the halide pipeline. It is then\nlinked with the caller code to generate a single binary.\n\nNote: The halide pipeline represents a single pass of the\nZhang-Suen method. The iterations have to be handled by the \ncaller code - see `spook.cpp` for an example. The number of\niterations is hardcoded right now. It should depend on the \ncompletion flags returned by the halide pipeline.\n\n\n## Usage\n\nSee `spook.cpp` for an example. The example benchmarks the time \ntaken to skeletonize a large image on the GPU. Pipeline code is in\n`src/pipeline.cpp`.\n\n\n## Benchmarks\n\nWe get the best performance when it is run on a GPU. The tests are\nrun on the scikit-image's horse mask, but tiled 10x10 to create a large\n(3280, 4000) shaped test image. The time is averaged over 100 runs.\n\n| Implementation                        | CPU (i7-7700HQ) | GPU (GTX 1050m) |\n| ------------------------------------- | --------------- | --------------- |\n| Scikit-image `morphology.skeletonize` | **2073 ms**     | NA              |\n| Skeletonide                           | 3786 ms         | **210 ms**     |\n\nThe scheduling of the Halide pipeline can be further tweaked through \ntrial-and-error to achieve better CPU times. The slow performance on the CPU\nis partly explained by the fact that the pipeline only represents a single pass\nof the thinning algorithm. There is significant time penalty in handling the \niterations from the outside as illustrated in `spook.cpp`.  \nHowever, on the GPU, Skeletonide performs roughly 10x faster than the scikit-image's \nCPU implemetation without major modifications. Not a level playing field, obviously.\n\nThe output on the scikit-image's horse mask:\n\nMask:  \n![mask](test/images/horse.png)    \n\nSkeleton:  \n![skel](test/output/spook_out.png)  \n\n## Build\n\n```sh\nmkdir build\ncd build\ncmake ..\ncmake --build .\n# this will build the static library and its \n# header in `build/` and a single test binary \n# called `spook` in `skeletonide` - which can\n# be run `./spook` to see it in action.\n```\n\n## License\nMIT License","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostmalloc%2Fskeletonide","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpostmalloc%2Fskeletonide","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpostmalloc%2Fskeletonide/lists"}