{"id":15630673,"url":"https://github.com/zhiqiangdon/cu-net","last_synced_at":"2025-04-13T09:52:02.737Z","repository":{"id":112374591,"uuid":"142354080","full_name":"zhiqiangdon/CU-Net","owner":"zhiqiangdon","description":"Code for \"Quantized Densely Connected U-Nets for Efficient Landmark Localization\" (ECCV 2018) and \"CU-Net: Coupled U-Nets\" (BMVC 2018 oral)","archived":false,"fork":false,"pushed_at":"2021-08-16T03:47:07.000Z","size":8504,"stargazers_count":228,"open_issues_count":12,"forks_count":40,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-27T01:12:56.537Z","etag":null,"topics":["face-align","human-pose-estimation","quantized-neural-network","quantized-training","u-net"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhiqiangdon.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}},"created_at":"2018-07-25T21:07:30.000Z","updated_at":"2025-01-18T07:40:18.000Z","dependencies_parsed_at":"2023-04-08T22:01:24.102Z","dependency_job_id":null,"html_url":"https://github.com/zhiqiangdon/CU-Net","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/zhiqiangdon%2FCU-Net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2FCU-Net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2FCU-Net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiqiangdon%2FCU-Net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhiqiangdon","download_url":"https://codeload.github.com/zhiqiangdon/CU-Net/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695301,"owners_count":21146952,"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":["face-align","human-pose-estimation","quantized-neural-network","quantized-training","u-net"],"created_at":"2024-10-03T10:34:58.783Z","updated_at":"2025-04-13T09:52:02.715Z","avatar_url":"https://github.com/zhiqiangdon.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \n## **[Quantized Densely Connected U-Nets for Efficient Landmark Localization](https://arxiv.org/abs/1808.02194)**\n## **[CU-Net: Coupled U-Nets](https://arxiv.org/abs/1808.06521)**\n\n## Overview\nThe follwoing figure gives an illustration of naive dense U-Net, stacked U-Nets and coupled U-Nets (CU-Net). The naive dense U-Net and stacked U-Nets have shortcut connections only inside each U-Net. In contrast, the coupled U-Nets also have connections for semantic blocks across U-Nets. The CU-Net is a hybrid of naive dense U-Net and stacked U-Net, integrating the merits of both dense connectivity, intermediate supervisions and multi-stage top-down and bottom-up refinement. The resulted CU-Net could save ~70% parameters of the previous stacked U-Nets but with comparable accuracy.\n\u003cp align=\"center\"\u003e\u003cimg src=\"figures/framework-comparison.jpg\" alt=\"\" width=\"600\"\u003e\u003c/p\u003e\n\nIf we couple each U-Net pair in multiple U-Nets, the coupling connections would have quadratic growth with respect to the U-Net number. To make the model more parameter efficient, we propose the order-K coupling to trim off the long-distance coupling connections.\n\u003cp align=\"center\"\u003e\u003cimg src=\"figures/order-k.jpg\" alt=\"\" width=\"400\"\u003e\u003c/p\u003e\nFor simplicity, each dot represents one U-Net. The red and blue lines are the shortcut connections of inside semantic blocks and outside inputs. Order-0 connectivity (Top) strings U-Nets together only by their inputs and outputs, i.e. stacked U-Nets. Order-1 connectivity (Middle) has shortcut connections for adjacent U-Nets. Similarly, order-2 connectivity (Bottom) has shortcut connections for 3 nearby U-Nets.\n\n### Prerequisites\n\nThis package has the following requirements:\n\n* `Python 2.7`\n* `Pytorch v0.4.0` or `Pytorch v0.1.12`\n\nNote that the script name with string `prev-version` requires `Pytorch v0.1.12`.\n\n### Training\n\n```\npython cu-net.py --gpu_id 0 --exp_id cu-net-2 --layer_num 2 --order 1 --loss_num 2 --is_train true --bs 24\n```\n\n### Validation\n\n```\npython cu-net.py --gpu_id 0 --exp_id cu-net-2 --layer_num 2 --order 1 --loss_num 2 --resume_prefix your_pretrained_model.pth.tar --is_train false --bs 24\n```\n\n### Model Options\n```\nlayer_num     # number of coupled U-Nets\norder         # the order of coupling\nloss_num      # number of losses. Losses are uniformly distributed along the CU-Net. Each U-Net at most has one loss. (loss_num \u003c= layer_num)\n```\n\n### Pretrained Models\n1. [face-layer-num-8-order-1](https://drive.google.com/file/d/1_znMNl2PDBW5E-bhJeBuDGB7-ExzqAoq/view?usp=sharing)\n2. [human-layer-num-16-order-1](https://drive.google.com/file/d/1Y7b6vdBXVfecemykOwvI1U2PrrjnX1TZ/view?usp=sharing)\n\n## Citation\nIf you find this code useful in your research, please consider citing:\n\n```\n@inproceedings{tang2018quantized,\n  title={Quantized densely connected U-Nets for efficient landmark localization},\n  author={Tang, Zhiqiang and Peng, Xi and Geng, Shijie and Wu, Lingfei and Zhang, Shaoting and Metaxas, Dimitris},\n  booktitle={ECCV},\n  year={2018}\n}\n@inproceedings{tang2018cu,\n  title={CU-Net: Coupled U-Nets},\n  author={Tang, Zhiqiang and Peng, Xi and Geng, Shijie and Zhu, Yizhe and Metaxas, Dimitris},\n  booktitle={BMVC},\n  year={2018}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiqiangdon%2Fcu-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhiqiangdon%2Fcu-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiqiangdon%2Fcu-net/lists"}