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:
pythonMyTrain.py--network [SINet, SINet-v2] --task [C2C, S2C] --save_modelYour_save_path--source_rootYour_source_pathUse the following command to generate prediction masks with a trained model:
pythonMyTest.py--network [SINet, SINet-v2] --model_pathYour_checkpoint_path--test_saveYour_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:
pythonMyEval.py--pred_rootYour_mask_path--txt_nameYour_result_pathC2C: 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