{"id":22067972,"url":"https://github.com/likaiucas/OBM","last_synced_at":"2025-07-24T05:31:22.090Z","repository":{"id":246565351,"uuid":"821497117","full_name":"likaiucas/OBM","owner":"likaiucas","description":"TGRS paper \"prompt-driven building footprint extraction in aerial images with offset-building model\"","archived":false,"fork":false,"pushed_at":"2025-07-04T06:45:39.000Z","size":19149,"stargazers_count":11,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T07:34:36.217Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/likaiucas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2024-06-28T17:13:32.000Z","updated_at":"2025-07-04T06:45:44.000Z","dependencies_parsed_at":"2024-06-28T18:38:01.439Z","dependency_job_id":"cc0949b2-8011-43b3-bf7a-f542eb157fdb","html_url":"https://github.com/likaiucas/OBM","commit_stats":null,"previous_names":["likaiucas/obm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/likaiucas/OBM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaiucas%2FOBM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaiucas%2FOBM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaiucas%2FOBM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaiucas%2FOBM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/likaiucas","download_url":"https://codeload.github.com/likaiucas/OBM/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/likaiucas%2FOBM/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266796832,"owners_count":23985483,"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-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-30T20:03:39.749Z","updated_at":"2025-07-24T05:31:22.072Z","avatar_url":"https://github.com/likaiucas.png","language":"Python","funding_links":[],"categories":["Paper List"],"sub_categories":["Follow-up Papers"],"readme":"# TGRS preprint paper\n\n\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\u003c!--\n*** Thanks for checking out the Best-README-Template. If you have a suggestion\n*** that would make this better, please fork the repo and create a pull request\n*** or simply open an issue with the tag \"enhancement\".\n*** Don't forget to give the project a star!\n*** Thanks again! Now go create something AMAZING! :D\n--\u003e\n\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** I'm using markdown \"reference style\" links for readability.\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n*** See the bottom of this document for the declaration of the reference variables\n*** for contributors-url, forks-url, etc. This is an optional, concise syntax you may use.\n*** https://www.markdownguide.org/basic-syntax/#reference-style-links\n--\u003e\n\u003c!-- [![Contributors][contributors-shield]][contributors-url] --\u003e\n\n[![MIT License][license-shield]][license-url]\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com\"\u003e\n    \u003cimg src=\"images/logo2.png\" alt=\"Logo\" width=\"256\" height=\"256\"\u003e\n  \u003c/a\u003e\n\n  \u003ch3 align=\"center\"\u003eExtract Building Footprint from Aerial Images with Offset-Building Model (OBM)\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Extract building footprint in off-nadir images like a human\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/\"\u003eView Demo\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#What is OBM?\"\u003eWhat is OBM?\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#Workflow and Results\"\u003eResults\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## What is OBM?\n\n\u003c!-- [![Product Name Screen Shot][product-screenshot]](https://example.com) --\u003e\n| ![Product Name Screen Shot][product-screenshot] | ![Product Name Screen Shot][ROAM-screenshot] |\n| :---: | :---: |\n| (a) OBM Model | (b) ROAM module |\n\nWe first proposed a novel interactive model for footprint extraction and designed a series of Distance NMS algorithms tailored for the Building Footprint Extraction (BFE) problem. We also designed new metrics to measure the interactive BFE model.  \n\nBased on our accurate extraction of the roof and root-to-footprint offset. We can rebuild buildings' relative height maps. \n\n**(a)** illustrates our  structure which inherits from the Segment Anything Model (SAM). \n\n**(b)** gives out the structure of our core module, Reference Offset Adaptive Module (ROAM). During inference, based on the results of the base offset head, each building will classified by its length and then roam to the adaptive head. The final result is determined by the Basehead and adaptive head.   \n\n\nOur model reaches new SOTA:\n* A clear drop of offset error by 16.99%, increase roof boundary iou by 13.15%, on open dataset BONAI. \n* Without extra training, we tested all models on a newly annotated dataset for generalization, improving 20.29% in vector and 76.36% in offset angle. \n* DNMS series can bring extra gain in all situations. \n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Built With\n\nOur work is based on the following:\n\n-  [pytorch]\n-  [MMDetection]\n-  [BONAI]\n-  [SAM]\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\nOur weight of OBM is available at \u003ca href=\"https://1drv.ms/u/c/4714078bb90d0216/EbVLDOlRwlZHr5h60nC3HuoBk1QrRFc6QqY_oXPCz-_3nA?e=Xbe1Qc\" title=\"OBM_weight_BONAI\"\u003eOBM weight BONAI\u003c/a\u003e.  \n\u003ca href=\"https://1drv.ms/u/c/4714078bb90d0216/ETHrZ7LPl-dAn-mKaGrZdnsBk6UmdOwF_sYWmqBFuUQDOw?e=oamaWZ\" title=\"OBM_weight_OmniCity\"\u003eOBM weight OmniCity\u003c/a\u003e. \n\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting Started\n\nThis is a quick start of OBM. \n\n### Prerequisites\n\nThe code is built on the old version of mmdetection, and trained with a server that has 6x RTX3090.     \n* ensure you have the correct CUDA and compatible torch version\n  ```sh\n  nvidia-smi\n  ```\nOur runnable environments:\n `pytorch 1.7.0, CUDA 11.1`\n\n\n### Dataset\nDownloads training images and test images from [BONAI]. We newly added building segementation label in our newly launched dataset which are avaliable with [Huizhou] together. \n\n### Installation\n\nNOTE: Please follow the installation of [BONAI] and the early edition of [MMdetection].\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n* Train on your own dataset:\n```bash\nbash tools/dist_train.sh configs/obm_seg_fintune/smlcdr_obm_pretrain.py 6 # train with ROAM\nbash tools/dist_train.sh configs/obm_seg/obm_seg_b.py 6 # train without ROAM\n```\n\n* Inference your dataset:\n```bash\npython tools/test_offset.py --config obm_seg_fintune/smlcdr_obm_pretrain.py\n```\n\n_``WARNING: OUR TRAINING DOES NOT SUPPORT FINETUNE LIKE LORA, BACKBONE IS INCLUDED, PLEASE SET `samples_per_gpu = 1` !!!``_\n\n_``WARNING: PLEASE SET `samples_per_gpu = 1` WHILE INFERENCING !!!``_\n\n* Improve offset quality:\n\n```bash\n# using function fixangle()\n## parameter: model = 'max' represents DNMS\n## parameter: model = 'guassia_std' represents soft-DNMS\n\npython tools/postprocess_offset.py \n```\n\n* Visualize your results:\n```bash\n\n# we provide two kinds of visualizing functions: \n## 1: vis_3d() for relative height maps. \n## 2:  vis_boundary_offset: for roof and footprint boundary. \npython tools/visual_offset.py \n\n# if you want to visualize the results of LOFT in BONAI\npython tools/visual_instance_seg.py\n\n```\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ROADMAP --\u003e\n## Workflow and Results\nOur model  simulates the process of how a human annotates a footprint. \n\n### 1. At the **`first`** stage, we input an image with some prompts to imply buildings' rough location, using box prompts as an example:\n\u003cdiv align=center\u003e\n  \u003cimg src=\"images/inputim.png\" \u003e\n\u003c/div\u003e\n\n### 2. **`Then`** Our OBM will give out roof segmentation and a roof-to-footprint offset for each prompt. \n\u003cdiv align=center\u003e\n  \u003cimg src=\"images/model_out.png\"\u003e\n\u003c/div\u003e\n\n### 3. **`Finally`**, we drag the roof to its footprint via the offset. \n\n* We provide two kinds of operation: one is to directly get **footprints**, and the other is to get the **relative height maps**. \n\u003cdiv align=center\u003e\n  \u003cimg src=\"images/boundary.png\" width=\"200\" height=\"200\"\u003e \u003cimg src=\"images/HeightMap.png\" width=\"200\" height=\"200\"\u003e\n\u003c/div\u003e\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\nOffset tokens are hard to train; they are very sensitive to the settings. \nIf you have any problems training the offset tokens, please contact me by likai211#mails.ucas.ac.cn or kaili37-c#my.cityu.edu.hk. \nI think my experience of failure in training will help you train your model.\nYou can also contact me for any building-related problem or collaboration. \n\n\n\n## Citing\n```\n@ARTICLE{li2023obm,\n  author={Li, Kai and Deng, Yupeng and Kong, Yunlong and Liu, Diyou and Chen, Jingbo and Meng, Yu and Ma, Junxian and Wang, Chenhao},\n  journal={IEEE Transactions on Geoscience and Remote Sensing}, \n  title={Prompt-Driven Building Footprint Extraction in Aerial Images With Offset-Building Model}, \n  year={2024},\n  volume={62},\n  number={},\n  pages={1-15},\n  keywords={Buildings;Prediction algorithms;Production;Data models;Data mining;Remote sensing;Instance segmentation;Feature extraction;Training;Three-dimensional displays;Building footprint extraction (BFE);nonmaximum suppression (NMS);roof segmentation;roof-to-footprint offset extraction;segment anything model (SAM)},\n  doi={10.1109/TGRS.2024.3487652}}\n```\n\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/othneildrew/Best-README-Template.svg?style=for-the-badge\n[contributors-url]: https://github.com/\n[forks-shield]: https://img.shields.io/github/forks/othneildrew/Best-README-Template.svg?style=for-the-badge\n[forks-url]: https://github.com/network/members\n[stars-shield]: https://img.shields.io/github/stars/othneildrew/Best-README-Template.svg?style=for-the-badge\n[stars-url]: https://github.com/stargazers\n[issues-shield]: https://img.shields.io/github/issues/othneildrew/Best-README-Template.svg?style=for-the-badge\n[issues-url]: https://github.com/issues\n[license-shield]: https://img.shields.io/github/license/othneildrew/Best-README-Template.svg?style=for-the-badge\n[license-url]: https://github.com/likaiucas/OBM/blob/main/LICENSE.txt\n[product-screenshot]: images/model2.png\n[ROAM-screenshot]: images/ROAM.png\n[Next.js]: https://img.shields.io/badge/next.js-000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=white\n[Next-url]: https://nextjs.org/\n[React.js]: https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB\n[React-url]: https://reactjs.org/\n[Vue.js]: https://img.shields.io/badge/Vue.js-35495E?style=for-the-badge\u0026logo=vuedotjs\u0026logoColor=4FC08D\n[Vue-url]: https://vuejs.org/\n[Angular.io]: https://img.shields.io/badge/Angular-DD0031?style=for-the-badge\u0026logo=angular\u0026logoColor=white\n[Angular-url]: https://angular.io/\n[Svelte.dev]: https://img.shields.io/badge/Svelte-4A4A55?style=for-the-badge\u0026logo=svelte\u0026logoColor=FF3E00\n[Svelte-url]: https://svelte.dev/\n[Laravel.com]: https://img.shields.io/badge/Laravel-FF2D20?style=for-the-badge\u0026logo=laravel\u0026logoColor=white\n[Laravel-url]: https://laravel.com\n[Bootstrap.com]: https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge\u0026logo=bootstrap\u0026logoColor=white\n[Bootstrap-url]: https://getbootstrap.com\n[JQuery.com]: https://img.shields.io/badge/jQuery-0769AD?style=for-the-badge\u0026logo=jquery\u0026logoColor=white\n[JQuery-url]: https://jquery.com \n\n[Huizhou]: https://portland-my.sharepoint.com/:f:/g/personal/kaili37-c_my_cityu_edu_hk/Ep2EnO01ZghPuebKASl5h60BUjbBvrbiSHKoSiwfIBYBNg?e=7hdlzQ\n\n[OBMweight]: https://1drv.ms/u/c/4714078bb90d0216/EbVLDOlRwlZHr5h60nC3HuoBk1QrRFc6QqY_oXPCz-_3nA?e=Xbe1Qc\n[pytorch.org]: https://pytorch.org\n[MMDetection.git]: https://github.com/open-mmlab/mmdetection\n[pytorch]: https://pytorch.org\n[MMDetection]: https://github.com/open-mmlab/mmdetection\n[BONAI.git]: https://github.com/jwwangchn/BONAI\n[BONAI]: https://github.com/jwwangchn/BONAI\n[SAM]: https://github.com/facebookresearch/segment-anything\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikaiucas%2FOBM","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flikaiucas%2FOBM","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flikaiucas%2FOBM/lists"}