Skip to content

Latest commit

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

S2R-COD: Synthetic-to-Real Camouflaged Object Detection

This is the official (Pytorch) implementation for the paper "Synthetic-to-Real Camouflaged Object Detection", ACM MM 2025.

🛠️Setup

Runtime

The main python libraries we use:

  • Python 3.10.11
  • torch 2.0.1
  • numpy 1.24.3

Datasets

Please create a directory named Dataset in current directory, then download the following datasets and unzip into Dataset:

Source (Synthetic):

We generate synthetic COD images using the LAKE-RED project. You can also use it to generate your own synthetic COD data.

Target (Real):

Test (Real):

Val (Real):

🎢Run

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

Training

  • 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_path

Testing

Use 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.)

Evaluation

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_path

Pretrained models

📌Citation

If you would like to cite our work, the following bibtex code may be helpful:

⚖️License

This source code is released under the MIT license. View it here

About

Synthetic-to-Real Camouflaged Object Detection (ACM MM 2025)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages