This is an implement of the TACL, βTwin-Adversarial-Contrastive-Learning-for-Underwater-Image-Enhancement-and-Beyondβ, Risheng Liu*, Zhiying Jiang, Shuzhou Yang, Xin Fan, IEEE Transactions on Image Processing (TIP), 2022.
Type the command:
pip install -r requirements.txt
Download the pre-trained model and put it in ./checkpoints
YSZD β
./dataset/testA
and ./dataset/testB
. Put your test images in ./dataset/testA
(And you should keep whatever one image in ./dataset/testB
to make sure program can start.)python test.py --dataroot ./datasets/[YOUR-DATASETS] --name underwater --model cycle_gan
Results will be shown in results folder.
python train.py --dataroot ./datasets/[YOUR-DATASETS] --name chinamm_train --model cycle_gan
Second, you need to train a TAF module (here we adopt SSD):
python makeTXT.py
Download the fc-reduced VGG-16 PyTorch base network weights at: https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
By default, we assume you have downloaded the file in the ssd.pytorch/weights
dir:
mkdir weights
cd weights
wget https://s3.amazonaws.com/amdegroot-models/vgg16_reducedfc.pth
train.py
as a flag or manually change them.python train.py
Note:
train.py
for options)Evaluation To evaluate a trained network:
python eval.py
You can specify the parameters listed in the eval.py
file by flagging them or manually changing them.
cd ./ssd.pytorch-master \ Run
python trainall.py
python visual.py
If you find this code useful for your research, please use the following BibTeX entry.
@ARTICLE{9832540,
author={Liu, Risheng and Jiang, Zhiying and Yang, Shuzhou and Fan, Xin},
journal={IEEE Transactions on Image Processing},
title={Twin Adversarial Contrastive Learning for Underwater Image Enhancement and Beyond},
year={2022},
volume={31},
number={},
pages={4922-4936},
doi={10.1109/TIP.2022.3190209}}