Skip to content

RefOnce: Distilling References into a Prototype Memory for Referring Camouflaged Object Detection

Notifications You must be signed in to change notification settings

yuhuan-wu/RefOnce

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RefOnce

RefOnce: Distilling References into a Prototype Memory for Referring Camouflaged Object Detection

Requirements

  • Python 3.8+
  • PyTorch and TorchVision
  • Other deps: timm==0.4.12, py_sod_metrics==1.2.4, opencv-python, pillow, tqdm

Install example (choose a proper CUDA or CPU wheel as needed):

pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install timm==0.4.12 py_sod_metrics==1.2.4 opencv-python pillow tqdm

Get Started (prepare data)

  • Dataset root should contain the following structure (R2C7K example, at least test set should exist):
dataset/
  R2C7K/
    Camo/
      test/
        Imgs/<Class>/<name>.jpg|.png
        GT/<Class>/<name>.png
    Ref/   # keep original structure if present; not strictly required for inference
  • Weights: place the checkpoint (e.g., RefOnce.pth) anywhere and pass it via --checkpoint.

  • Entry points and useful references:

Inference

Shell script (recommended):

bash test.sh 0   # optional GPU index, default 0;

The script calls test.py with defaults:

  • data-root: ./dataset/R2C7K
  • checkpoint: RefOnce.pth
  • batch-size: 22
  • save-dir: ./output/release/
  • save-preds: False (metrics only)

Notes:

  • By default, predictions are not saved; enable with --save-preds True and provide --save-dir.
  • Metrics are reported by CalTotalMetric.get_results() and include Smeasure, wFmeasure, MAE, adpEm, meanEm, maxEm, adpFm, meanFm, maxFm.

Citation

If this release helps your research, please cite it. Example BibTeX (replace with your official paper info):

@article{wu2025refonce,
  title={RefOnce: Distilling References into a Prototype Memory for Referring Camouflaged Object Detection},
  author={Wu, Yu-Huan and Zhu, Zi-Xuan and Wang, Yan and Zhen, Liangli and Fan, Deng-Ping},
  journal={arXiv preprint arXiv:2511.20989},
  year={2025}
}

Acknowledgements

This project is based on ZoomNet, RefCOD, and PySODMetrics. Thanks to the authors for their open-source contributions.

About

RefOnce: Distilling References into a Prototype Memory for Referring Camouflaged Object Detection

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published