Official code for Map-Assisted Remote-Sensing Image Compression at Extremely Low Bitrates
# clone this repo
git clone https://github.com/WHUyyx/MAGC.git
# create an environment with python >= 3.9
conda create -n MAGC python=3.9
conda activate MAGC
pip install -r requirements.txtPlease download the pretrained model from Google Drive and place it in the magc_ckpts/ckpts_stage2/ folder for inference.
Please access the training set and test set from SGDM.
CUDA_VISIBLE_DEVICES=0 python inference.py \
--ckpt magc_ckpts/ckpts_stage2/v40_step=120999-lpips=0.3132.ckpt \
--config configs/model/cldm_stage2.yaml \
--input_path ../dataset/Synthetic-v18-45k/test_4500 \
--steps 50 \
--batchsize 30 \
--output_root metrics_4500_magc \
--device cuda For the first stage, you can loat the pretrained parameters:
python scripts/make_stage1_init_weight.py \
--cldm_config configs/model/cldm_stage2.yaml \
--sd_weight pretrained/v2-1_512-ema-pruned.ckpt \
--output pretrained/init_stage1.ckptThen you can start the first training stage:
python train.py \
--config configs/train_cldm_stage1.yamlFor the second stage, you can loat the parameters obtained in the first stage:
python scripts/make_stage2_init_weight.py \
--cldm_config configs/model/cldm_stage2.yaml \
--sd_weight magc_ckpts/ckpts_stage1/v38_step=115999-val_loss=0.2284.ckpt \
--output pretrained/init_stage2.ckptFinally you can start training:
python train.py \
--config configs/train_cldm_stage2.yamlPlease cite us if our work is useful for your research.
@misc{ye2024map,
title={Map-Assisted Remote-Sensing Image Compression at Extremely Low Bitrates},
author={Yixuan Ye and Ce Wang and Wanjie Sun and Zhenzhong Chen},
year={2024},
eprint={2409.01935},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
This project is based on DiffBIR and CompressAI. Thanks for their awesome work.
If you have any questions, please feel free to contact with me at yeyixuan@whu.edu.cn.


