{"id":15073409,"url":"https://github.com/cherubicxn/hawp","last_synced_at":"2025-09-25T22:30:26.934Z","repository":{"id":38187354,"uuid":"247752803","full_name":"cherubicXN/hawp","owner":"cherubicXN","description":"Holistically-Attracted Wireframe Parsing [TPAMI'23] \u0026 [CVPR' 20] ","archived":false,"fork":false,"pushed_at":"2024-02-26T03:46:40.000Z","size":7013,"stargazers_count":305,"open_issues_count":19,"forks_count":54,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-01-16T19:32:44.255Z","etag":null,"topics":["cvpr2020","deep","lsd","wireframe"],"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/cherubicXN.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,"publiccode":null,"codemeta":null}},"created_at":"2020-03-16T15:51:02.000Z","updated_at":"2025-01-13T06:00:04.000Z","dependencies_parsed_at":"2024-09-25T03:54:43.731Z","dependency_job_id":"d995a84a-726a-447d-ad4d-bd492cd14f59","html_url":"https://github.com/cherubicXN/hawp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cherubicXN/hawp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherubicXN%2Fhawp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherubicXN%2Fhawp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherubicXN%2Fhawp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherubicXN%2Fhawp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cherubicXN","download_url":"https://codeload.github.com/cherubicXN/hawp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cherubicXN%2Fhawp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276989873,"owners_count":25741091,"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-09-25T02:00:09.612Z","response_time":80,"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":["cvpr2020","deep","lsd","wireframe"],"created_at":"2024-09-25T02:52:28.963Z","updated_at":"2025-09-25T22:30:26.101Z","avatar_url":"https://github.com/cherubicXN.png","language":"Python","funding_links":[],"categories":["0. Edge detection related dataset"],"sub_categories":[],"readme":"# Holistically-Attracted Wireframe Parsing: From Supervised Learning to Self-Supervised Learning\n\nThis is the official implementation of our [paper](https://arxiv.org/abs/2210.12971).\n\n\u003c!-- [**News**] The upgraded HAWPv2 and HAWPv3 are available now! \n[**News**] We experimentally provided an easy-to-install version for inference-only usage of HAWP, please checkout the [``inference``](https://github.com/cherubicXN/hawp/tree/inference) branch for the details. --\u003e\n[**News**] Our journal version has been accepted in PAMI!\n\n[**News**] The upgraded HAWPv2 and HAWPv3 are available now! \n## Highlights\n\n- **HAT Fields**: A General and Robust Representation of Line Segments for Wireframe Parsing\n- **HAWPv2**: A state-of-the-art fully-supervised wireframe parser. Please checkout [HAWPv2.md](docs/HAWPv2.md) for its details.\n- **HAWPv3**: A state-of-the-art self-supervised wireframe parser. Please checkout [HAWPv3.md](docs/HAWPv3.md) for its details and [HAWPv3.train.md](docs/HAWPv3.train.md) for the training recipe. \n- HAWPv3 can be used as a good wireframe parser for the out-of-distribution images.\n  \n\u003cp align=\"center\"\u003e\n\u003c!-- \u003cimg src=\"figures/teaser.png\" height=\"400\" \u003e\n --\u003e\n \u003cimg src=\"docs/figures/v3-wireframe/00037187.png\" width=\"30%\"\u003e\n \u003cimg src=\"docs/figures/v3-wireframe/00051510.png\" width=\"30%\"\u003e\n \u003cimg src=\"docs/figures/v3-wireframe/00074259.png\" width=\"30%\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"docs/figures/v3-BSDS/37073.png\" width=\"30%\"\u003e\n \u003cimg src=\"docs/figures/v3-BSDS/42049.png\" width=\"30%\"\u003e\n \u003cimg src=\"docs/figures/v3-BSDS/85048.png\" width=\"30%\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n \u003cimg src=\"docs/figures/v3-CrowdAI/000000000190.png\" width=\"30%\"\u003e\n \u003cimg src=\"docs/figures/v3-CrowdAI/000000000210.png\" width=\"30%\"\u003e\n \u003cimg src=\"docs/figures/v3-CrowdAI/000000000230.png\" width=\"30%\"\u003e\n\u003cp\u003e\n\n- **We provide a running example on the images of [DTU dataset](https://roboimagedata.compute.dtu.dk/?page_id=36) (scene24) as below.**\n  ```bash\n  python -m hawp.ssl.predict --ckpt checkpoints/hawpv3-imagenet-03a84.pth  \\\n    --threshold 0.05  \\\n    --img ~/datasets/DTU/scan24/image/*.png \\ \n    --saveto docs/figures/dtu-24 --ext png \\\n  ```\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000000.png\" width=\"30%\" height=auto\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000001.png\" width=\"30%\" height=auto\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000002.png\" width=\"30%\" height=auto\u003e\n    \u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000003.png\" width=\"30%\" height=auto\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000004.png\" width=\"30%\" height=auto\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000005.png\" width=\"30%\" height=auto\u003e\n    \u003c/p\u003e\n    \u003cp align=\"center\"\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000009.png\" width=\"30%\" height=auto\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000015.png\" width=\"30%\" height=auto\u003e\n      \u003cimg src=\"docs/figures/dtu-24/000045.png\" width=\"30%\" height=auto\u003e\n    \u003c/p\u003e\n   \n## Data Downloading\n\u003cdetails\u003e\n\u003csummary\u003e\n\u003cb\u003eTraining and Testing datasets for HAWPv2\u003c/b\u003e\n\u003c/summary\u003e\n\n- The training and testing data (including [Wireframe dataset](https://github.com/huangkuns/wireframe) and [YorkUrban dataset](http://www.elderlab.yorku.ca/resources/york-urban-line-segment-database-information/)) for **HAWPv2** can be downloaded via [Google Drive](https://drive.google.com/file/d/134L-u9pgGtnzw0auPv8ykHqMjjZ2claO/view?usp=sharing). *Many thanks to authors of these two excellent datasets!* \n\n- You can also use the [gdown](https://pypi.org/project/gdown/) to download the data in the terminal by\n  ```bash\n  gdown 134L-u9pgGtnzw0auPv8ykHqMjjZ2claO\n  unzip data.zip\n  ```\n\u003c/details\u003e\n\n## Installation \n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eAnaconda\u003c/b\u003e\u003c/summary\u003e\n\n- Clone the code repo: ``git clone https://github.com/cherubicXN/hawp.git``.\n- Install ninja-build by ``sudo apt install ninja-build``.\n- Create a conda environment by\n```bash\nconda create -n hawp python==3.9\nconda activate hawp\npip install -e .\n```\n- Run the following command lines to install the dependencies of HAWP\n```bash\n# Install pytorch, please be careful for the version of CUDA on your machine\npip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116 \n# Install other dependencies\npip install -r requirement.txt\n```\n- Verify the installation.\n```bash\npython -c \"import torch; print(torch.cuda.is_available())\" # Check if the installed pytorch supports CUDA.\n```\n- Downloading the offically-trained checkpoints of both **HAWPv2** and **HAWPv3**.\n```bash\nsh downloads.sh\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eDocker\u003c/b\u003e\u003c/summary\u003e\n\nWe also provide a [Dockerfile](docker/Dockerfile). You could build the docker image by running the following command lines.\n```bash\nsudo docker build - \u003c Dockerfile --tag hawp:latest\n```\n\u003c/details\u003e\n\n## Citations\nIf you find our work useful in your research, please consider citing:\n```\n@article{HAWP-journal,\ntitle = \"Holistically-Attracted Wireframe Parsing: From Supervised to Self-Supervised Learning\",\nauthor = \"Nan Xue and Tianfu Wu and Song Bai and Fu-Dong Wang and Gui-Song Xia and Liangpei Zhang and Philip H.S. Torr\njournal = \"IEEE Trans. on Pattern Analysis and Machine Intelligence (PAMI)\",\nyear = {2023}\n}\n```\nand \n```\n@inproceedings{HAWP,\ntitle = \"Holistically-Attracted Wireframe Parsing\",\nauthor = \"Nan Xue and Tianfu Wu and Song Bai and Fu-Dong Wang and Gui-Song Xia and Liangpei Zhang and Philip H.S. Torr\n\",\nbooktitle = \"IEEE Conference on Computer Vision and Pattern Recognition (CVPR)\",\nyear = {2020},\n}\n```\n\n## Acknowledgment\nWe acknowledge the effort from the authors of the Wireframe dataset and the YorkUrban dataset. These datasets make accurate line segment detection and wireframe parsing possible. We also thank [Rémi Pautrat](https://rpautrat.github.io/) for helpful discussions.\n\n\n## TODO\n  - Documentations\n  - Google Colab Notebook\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcherubicxn%2Fhawp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcherubicxn%2Fhawp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcherubicxn%2Fhawp/lists"}