{"id":20663738,"url":"https://github.com/vita-group/glnet","last_synced_at":"2025-04-07T09:19:05.888Z","repository":{"id":107046031,"uuid":"175670845","full_name":"VITA-Group/GLNet","owner":"VITA-Group","description":"[CVPR 2019, Oral] \"Collaborative Global-Local Networks for Memory-Efﬁcient Segmentation of Ultra-High Resolution Images\" by Wuyang Chen*, Ziyu Jiang*, Zhangyang Wang, Kexin Cui, and Xiaoning Qian","archived":false,"fork":false,"pushed_at":"2021-12-29T12:17:41.000Z","size":2273,"stargazers_count":352,"open_issues_count":7,"forks_count":76,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-03-31T07:07:32.581Z","etag":null,"topics":["deepglobe","memory-efficiency","segmentation"],"latest_commit_sha":null,"homepage":"","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/VITA-Group.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":"2019-03-14T17:38:50.000Z","updated_at":"2025-03-13T16:28:02.000Z","dependencies_parsed_at":"2023-06-13T19:00:33.682Z","dependency_job_id":null,"html_url":"https://github.com/VITA-Group/GLNet","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/VITA-Group%2FGLNet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGLNet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGLNet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VITA-Group%2FGLNet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VITA-Group","download_url":"https://codeload.github.com/VITA-Group/GLNet/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247622983,"owners_count":20968575,"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":["deepglobe","memory-efficiency","segmentation"],"created_at":"2024-11-16T19:19:35.543Z","updated_at":"2025-04-07T09:19:05.863Z","avatar_url":"https://github.com/VITA-Group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GLNet for Memory-Efficient Segmentation of Ultra-High Resolution Images\n\n[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/chenwydj/ultra_high_resolution_segmentation.svg?logo=lgtm\u0026logoWidth=18)](https://lgtm.com/projects/g/chenwydj/ultra_high_resolution_segmentation/context:python) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\n\u003ca href=\"https://arxiv.org/abs/1905.06368\"\u003eCollaborative Global-Local Networks for Memory-Efﬁcient Segmentation of Ultra-High Resolution Images\u003c/a\u003e\n\nWuyang Chen*, Ziyu Jiang*, Zhangyang Wang, Kexin Cui, and Xiaoning Qian\n\nIn CVPR 2019 (Oral). [[Youtube](https://www.youtube.com/watch?v=am1GiItQI88)]\n\n## Overview\n\nSegmentation of ultra-high resolution images is increasingly demanded in a wide range of applications (e.g. urban planning), yet poses signiﬁcant challenges for algorithm efficiency, in particular considering the (GPU) memory limits.\n\nWe propose collaborative **Global-Local Networks (GLNet)** to effectively preserve both global and local information in a highly memory-efficient manner.\n\n* **Memory-efficient**: **training w. only one 1080Ti** and **inference w. less than 2GB GPU memory**, for ultra-high resolution images of up to 30M pixels.\n\n* **High-quality**: GLNet outperforms existing segmentation models on ultra-high resolution images.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/chenwydj/ultra_high_resolution_segmentation/master/docs/images/deep_globe_acc_mem_ext.jpg\" alt=\"Acc_vs_Mem\" width=\"900\"/\u003e\u003c/br\u003e\n\u003cb\u003eInference memory v.s. mIoU\u003c/b\u003e on the \u003ca href=\"https://arxiv.org/abs/1805.06561\"\u003eDeepGlobe dataset\u003c/a\u003e.\n\u003c/br\u003e\nGLNet (red dots) integrates both global and local information in a compact way, contributing to a well-balanced trade-off between accuracy and memory usage.\u003c/br\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/chenwydj/ultra_high_resolution_segmentation/master/docs/images/examples.jpg\" alt=\"Examples\" width=\"450\"/\u003e\u003c/br\u003e\n\u003cb\u003eUltra-high resolution Datasets\u003c/b\u003e: \u003ca href=\"https://arxiv.org/abs/1805.06561\"\u003eDeepGlobe\u003c/a\u003e, \u003ca href=\"https://arxiv.org/abs/1710.05006\"\u003eISIC\u003c/a\u003e, \u003ca href=\"https://ieeexplore.ieee.org/document/8127684\"\u003eInria Aerial\u003c/a\u003e\n\u003c/p\u003e\n\n## Methods\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/chenwydj/ultra_high_resolution_segmentation/master/docs/images/glnet.png\" alt=\"GLNet\" width=\"600\"/\u003e\u003c/br\u003e\n\u003cb\u003eGLNet\u003c/b\u003e: the global and local branch takes downsampled and cropped images, respectively. Deep feature map sharing and feature map regularization enforce our global-local collaboration. The final segmentation is generated by aggregating high-level feature maps from two branches.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/chenwydj/ultra_high_resolution_segmentation/master/docs/images/gl_branch.png\" alt=\"GLNet\" width=\"600\"/\u003e\u003c/br\u003e\n\u003cb\u003eDeep feature map sharing\u003c/b\u003e: at each layer, feature maps with global context and ones with local fine structures are bidirectionally brought together, contributing to a complete patch-based deep global-local collaboration.\n\u003c/p\u003e\n\n## Training\nCurrent this code base works for Python version \u003e= 3.5.\n\nPlease install the dependencies: `pip install -r requirements.txt`\n\nFirst, you could register and download the Deep Globe \"Land Cover Classification\" dataset here:\nhttps://competitions.codalab.org/competitions/18468\n\nThen please sequentially finish the following steps:\n1. `./train_deep_globe_global.sh`\n2. `./train_deep_globe_global2local.sh`\n3. `./train_deep_globe_local2global.sh`\n\nThe above jobs complete the following tasks:\n* create folder \"saved_models\" and \"runs\" to store the model checkpoints and logging files (you could configure the bash scrips to use your own paths).\n* step 1 and 2 prepare the trained models for step 2 and 3, respectively. You could use your own names to save the model checkpoints, but this requires to update values of the flag `path_g` and `path_g2l`.\n\n## Evaluation\n1. Please download the pre-trained models for the Deep Globe dataset and put them into folder \"saved_models\":\n* [fpn_deepglobe_global.pth](https://drive.google.com/file/d/1xUJoNEzj5LeclH9tHXZ2VsEI9LpC77kQ/view?usp=sharing)\n* [fpn_deepglobe_global2local.pth](https://drive.google.com/file/d/1_lCzi2KIygcrRcvBJ31G3cBwAMibn_AS/view?usp=sharing)\n* [fpn_deepglobe_local2global.pth](https://drive.google.com/file/d/198EcAO7VN8Ujn4N4FBg3sRgb8R_UKhYv/view?usp=sharing)\n2. Download (see above \"Training\" section) and prepare the Deep Globe dataset according to the train.txt and crossvali.txt: put the image and label files into folder \"train\" and folder \"crossvali\"\n3. Run script `./eval_deep_globe.sh`\n\n## Citation\nIf you use this code for your research, please cite our paper.\n```\n@inproceedings{chen2019GLNET,\n  title={Collaborative Global-Local Networks for Memory-Efﬁcient Segmentation of Ultra-High Resolution Images},\n  author={Chen, Wuyang and Jiang, Ziyu and Wang, Zhangyang and Cui, Kexin and Qian, Xiaoning},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  year={2019}\n}\n```\n\n## Acknowledgement\nWe thank Prof. Andrew Jiang and Junru Wu for helping experiments.\n\n\u003c!--- ### Personal Acknowledgement\nWuyang, the author of this work, would like to thank his wife Ye Yuan for her love and great support. --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fglnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvita-group%2Fglnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvita-group%2Fglnet/lists"}