### Install Other HAWP Dependencies Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Install the remaining project dependencies listed in the requirement.txt file. ```bash # Install other dependencies pip install -r requirement.txt ``` -------------------------------- ### Install PyTorch with CUDA Support Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Install PyTorch version 1.12.0 with CUDA 11.6 support. Ensure your system's CUDA version matches the installation. This command specifies the exact versions for torch, torchvision, and torchaudio. ```bash # Install pytorch, please be careful for the version of CUDA on your machine pip install torch==1.12.0+cu116 torchvision==0.13.0+cu116 torchaudio==0.12.0 --extra-index-url https://download.pytorch.org/whl/cu116 ``` -------------------------------- ### Create and Activate Conda Environment for HAWP Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Set up a new Conda environment named 'hawp' with Python 3.9, activate it, and install the HAWP package in editable mode. ```bash conda create -n hawp python==3.9 conda activate hawp pip install -e . ``` -------------------------------- ### Verify PyTorch CUDA Availability Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Check if the installed PyTorch version correctly recognizes and can utilize the CUDA-enabled GPU on your machine. ```python python -c "import torch; print(torch.cuda.is_available())" # Check if the installed pytorch supports CUDA. ``` -------------------------------- ### HAWPv3 Training Script Arguments Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.md This displays the available command-line arguments for the HAWPv3 training script. It covers configuration file paths, experiment naming, pretrained model loading, and various training parameters like batch size, learning rate, and epochs. ```bash python -m hawp.ssl.train --help usage: train.py [-h] --datacfg DATACFG --modelcfg MODELCFG --name NAME [--pretrained PRETRAINED] [--overwrite] [--tf32] [--dtm {True,False}] [--batch-size BATCH_SIZE] [--num-workers NUM_WORKERS] [--base-lr BASE_LR] [--steps STEPS [STEPS ...]] [--gamma GAMMA] [--epochs EPOCHS] [--seed SEED] [--iterations ITERATIONS] optional arguments: -h, --help show this help message and exit --datacfg DATACFG filepath of the data config --modelcfg MODELCFG filepath of the model config --name NAME the name of experiment --pretrained PRETRAINED the pretrained model --overwrite [Caution!] the option to overwrite an existed experiment --tf32 toggle on the TF32 of pytorch --dtm {True,False} toggle the deterministic option of CUDNN. This option will affect the replication of experiments training recipe: --batch-size BATCH_SIZE the batch size of training --num-workers NUM_WORKERS the number of workers for training --base-lr BASE_LR the initial learning rate --steps STEPS [STEPS ...] the steps of the scheduler --gamma GAMMA the lr decay factor --epochs EPOCHS the number of epochs for training --seed SEED the random seed for training --iterations ITERATIONS the number of training iterations ``` -------------------------------- ### Download Officially-Trained HAWP Checkpoints Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Execute the downloads.sh script to obtain the pre-trained model checkpoints for HAWPv2 and HAWPv3. ```bash sh downloads.sh ``` -------------------------------- ### Build HAWP Docker Image Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Build a Docker image tagged as 'hawp:latest' from the provided Dockerfile. This command streams the Dockerfile content to the docker build command. ```bash sudo docker build - < Dockerfile --tag hawp:latest ``` -------------------------------- ### Synthetic Data Training for HAWPv3 Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.train.md Initiates the synthetic training phase for HAWPv3. Configure dataset, model, learning rate, epochs, batch size, and training name. ```bash python -m hawp.ssl.train \ --datacfg hawp/ssl/config/synthetic_dataset.yaml \ --modelcfg hawp/ssl/config/hawpv3.yaml \ --base-lr 0.0004 \ --epochs 10 \ --batch-size 6 \ --name hawpv3-round0 ``` -------------------------------- ### Training HAWPv3 on Real-World Images Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.train.md Trains HAWPv3 using pseudo wireframe labels generated from real-world images. Specify the generated data configuration, model configuration, learning rate, epochs, training name, and batch size. ```bash python -m hawp.ssl.train --datacfg data-ssl/export_datasets/{name}/{hash}-model-00010.yaml --modelcfg hawp/ssl/config/hawpv3.yaml --base-lr 0.0004 --epochs 30 --name hawpv3-round1 --batch-size 6 ``` -------------------------------- ### Inference with HAWPv3 (Wireframe Dataset) Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.md Use this command to perform inference and extract wireframes using the HAWPv3 model trained on the Wireframe dataset. Specify the checkpoint path, a confidence threshold, and the input image filename. ```bash python -m hawp.ssl.predict --ckpt checkpoints/hawpv3-fdc5487a.pth \ --threshold 0.05 \ --img {filename.png} ``` -------------------------------- ### Download HAWPv2 Data using gdown Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Use the gdown tool to download the HAWPv2 training and testing datasets from Google Drive. Unzip the downloaded file to access the data. ```bash gdown 134L-u9pgGtnzw0auPv8ykHqMjjZ2claO unzip data.zip ``` -------------------------------- ### Batch Inference on DTU-24 Images Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.md This command demonstrates running inference on multiple images from the DTU-24 dataset. It specifies the checkpoint, threshold, input image path pattern, output directory, and image format. ```bash python -m hawp.ssl.predict --ckpt checkpoints/hawpv3-imagenet-03a84.pth \ --threshold 0.05 \ --img ~/datasets/DTU/scan24/image/*.png \ --saveto docs/figures/dtu-24 --ext png \ ``` -------------------------------- ### Inference with HAWPv3 (ImageNet Dataset) Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.md Use this command to perform inference and extract wireframes using the HAWPv3 model trained on ImageNet. Specify the checkpoint path, a confidence threshold, and the input image filename. ```bash python -m hawp.ssl.predict --ckpt checkpoints/hawpv3-imagenet-03a84.pth \ --threshold 0.05 \ --img {filename.png} ``` -------------------------------- ### Homographic Adaptation (Batch Mode) Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.train.md Performs homographic adaptation for pseudo wireframe generation in batch mode. Specify meta-architecture, dataset config, working directory, epoch, model config, minimum score threshold, and batch size. ```bash python -m hawp.ssl.homoadp-bm --metarch HAWP-heatmap \ --datacfg hawp/ssl/config/exports/wireframe-10iters.yaml \ --workdir exp-ssl/hawpv3-round0 \ --epoch 10 \ --modelcfg exp-ssl/hawpv3-round0/model.yaml \ --min-score 0.75 --batch-size=16 ``` -------------------------------- ### Homographic Adaptation (Single Image Mode) Source: https://github.com/cherubicxn/hawp/blob/main/docs/HAWPv3.train.md Performs homographic adaptation for pseudo wireframe generation in single-image mode to minimize GPU memory. Specify meta-architecture, dataset config, working directory, epoch, model config, and minimum score threshold. ```bash python -m hawp.ssl.homoadp --metarch HAWP-heatmap \ --datacfg hawp/ssl/config/export/wireframe-10iters.yaml \ --workdir exp-ssl/hawpv3-round0 \ --epoch 10 \ --modelcfg exp-ssl/hawpv3-round0/model.yaml \ --min_score 0.75 ``` -------------------------------- ### HAWP Journal Citation Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Citation for the journal publication of the Holistically-Attracted Wireframe Parsing (HAWP) work. Use this when referencing the PAMI journal publication. ```bibtex @article{HAWP-journal, title = "Holistically-Attracted Wireframe Parsing: From Supervised to Self-Supervised Learning", author = "Nan Xue and Tianfu Wu and Song Bai and Fu-Dong Wang and Gui-Song Xia and Liangpei Zhang and Philip H.S. Torr" journal = "IEEE Trans. on Pattern Analysis and Machine Intelligence (PAMI)", year = {2023} } ``` -------------------------------- ### HAWP Conference Citation Source: https://github.com/cherubicxn/hawp/blob/main/readme.md Citation for the conference publication of the Holistically-Attracted Wireframe Parsing (HAWP) work. Use this when referencing the CVPR conference publication. ```bibtex @inproceedings{HAWP, title = "Holistically-Attracted Wireframe Parsing", author = "Nan Xue and Tianfu Wu and Song Bai and Fu-Dong Wang and Gui-Song Xia and Liangpei Zhang and Philip H.S. Torr" booktitle = "IEEE Conference on Computer Vision and Pattern Recognition (CVPR)", year = {2020}, } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.