Skip to content

MetaVisionLab/S2R-COD

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

python MyTrain.py --network [SINet, SINet-v2] --task [C2C, S2C] --save_model Your_save_path --source_root Your_source_path

Testing

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

Evaluation

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

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%