Authors: Dongdong Zhang, Chunping Wang, Huiying Wang, Qiang Fu, Zhaorui Li.
- This repository provides code for "An Effective CNN and Transformer Fusion Network for Camouflaged Object Detection"
The training and testing experiments are conducted using PyTorch with a single NVIDIA GeForce RTX 3090 GPU of 24 GB Memory.
-
Configuring your environment (Prerequisites):
-
Creating a virtual environment in terminal:
conda create -n CTFNet python=3.7. -
Installing necessary packages:
pip install -r requirements.txt.
-
-
Downloading necessary data:
-
downloading testing dataset and move it into
./data/TestDataset/, which can be found in this download link (Google Drive). -
downloading training dataset and move it into
./data/TrainDataset/, which can be found in this download link (Google Drive). -
downloading pretrained weights and move it into
./checkpoints/CTF-Net/Net_epoch_best.pth, which can be found in this [download link (Baidu Pan)](https://pan.baidu.com/s/1id9-vZy3bReN90PDXKfu4Q hyu2). -
downloading Res2Net weights and move it into
./models/res2net50_v1b_26w_4s-3cf99910.pthdownload link (Google Drive). -
downloading PVTv2 weights and move it into
./pvt_v2_b2.pth[download link (Baidu Pan)](https://pan.baidu.com/s/1n5d-q4Wj3EN7kLxNv6Xg1A a8of).
-
-
Training Configuration:
- Assigning your costumed path, like
--train_saveand--train_pathinetrain.py.
- Assigning your costumed path, like
-
Testing Configuration:
- After you download all the pre-trained model and testing dataset, just run
etest.pyto generate the final prediction map: replace your trained model directory (--pth_path).
- After you download all the pre-trained model and testing dataset, just run
Assigning your costumed path, like pred_root and model_lst in MyEval.py.
Just run MyEval.py to evaluate the trained model.
pre-computed maps of CTF-Net can be found in [download link (Baidu Pan)](https://pan.baidu.com/s/1IPxvXD49Oq5yyjhNyiRqpw irmx).