This is the official (Pytorch) implementation for the paper "Synthetic-to-Real Camouflaged Object Detection", ACM MM 2025.
The main python libraries we use:
- Python 3.10.11
- torch 2.0.1
- numpy 1.24.3
Please create a directory named Dataset in current directory, then download the following datasets and unzip into Dataset:
Source (Synthetic):
- HKU-IS ( GoogleDrive | BaiduYun )
- CAMO + NC4K + CHAMELEON (CNC) ( GoogleDrive | BaiduYun )
We generate synthetic COD images using the LAKE-RED project. You can also use it to generate your own synthetic COD data.
Target (Real):
- COD10K-train ( GoogleDrive | BaiduYun )
Test (Real):
- COD10K-test ( GoogleDrive | BaiduYun )
Val (Real):
- CAMO ( GoogleDrive | BaiduYun )
After finishing above steps, your directory structure of code may like this:
S2R-COD/
|-- Dataset/
|-- Source/
|-- CNC/
|-- HKU-IS/
|-- Target/
|-- Test/
|-- Val/
|-- Eval/
|-- Src/
CLS.py
MyTest.py
MyTrain.py
README.md
-
Downloading ResNet weights ( GoogleDrive | BaiduYun ) pretrained on ImageNet dataset for SINet, and move it into
./Src/model/SINet. Res2Net ( GoogleDrive | BaiduYun ) for SINet-v2 and move it into./Src/model/SINetV2. -
You can use the following command to start training:
python MyTrain.py --network [SINet, SINet-v2] --task [C2C, S2C] --save_model Your_save_path --source_root Your_source_pathUse the following command to generate prediction masks with a trained model:
python MyTest.py --network [SINet, SINet-v2] --model_path Your_checkpoint_path --test_save Your_mask_path([x,y,z] means choices.)
We adopt the evaluation protocol from the DGNet project. Use the command below to evaluate your predicted masks:
python MyEval.py --pred_root Your_mask_path --txt_name Your_result_path-
C2C: SINet ( GoogleDrive | BaiduYun ) SINet-v2 ( GoogleDrive | BaiduYun )
-
S2C: SINet ( GoogleDrive | BaiduYun ) SINet-v2 ( GoogleDrive | BaiduYun )
If you would like to cite our work, the following bibtex code may be helpful:
This source code is released under the MIT license. View it here