metadata
license: apache-2.0
language:
- en
pipeline_tag: image-segmentation
tags:
- manipulation
- forgery
- image
- cnn
- transformer
- residual-noise
- efficientnet
- swin
- localization
NGIML Model Card
Inference
NGIML performs single-image forgery localization from a pretrained checkpoint and an input RGB image.
Checkpoints
Pretrained checkpoints are hosted on Hugging Face:
Available checkpoints:
casia-effnet.ptcasia-effnet+noise.ptcasia-effnet+swin.ptcasia-full.ptcasia-swin.ptcasia-swin+noise.pt
Run Inference
Recommended: Google Colab
The easiest way to test the model is through Colab:
- Google Colab: Open
infer.ipynbin Colab
This is the recommended path for quick testing because the notebook is already set up for checkpoint-based inference.
Local CLI
If you want to run the project locally, use the repository files here:
- GitHub: juhenes/ngiml-infer
Install the dependencies:
pip install -r requirements.txt
Run the CLI:
python predict.py --checkpoint /path/to/checkpoint.pt --image /path/to/image.png
Example:
python predict.py --checkpoint checkpoints_cache/casia-full.pt --image /path/to/image.png
If --output-dir is omitted, outputs are saved under outputs/<image-stem>/.
Optional Arguments
--output-dirto choose where outputs are saved--thresholdto override the default binary threshold--normalization-modeto setimagenetorzero_one--resize-max-sideto resize large images before preprocessing--crop-sizeto override the inference crop size--deviceto choose a device such ascpuorcuda:0
Output Files
When an output directory is used, the runtime saves:
input_rgb.pngpreview_input_rgb.pngpreview_probability_map.pngpreview_binary_mask.pngpreview_overlay.pngprobability_map.pngbinary_mask.pngoverlay.pngprediction.json
prediction.json includes summary metadata such as the checkpoint path, threshold, normalization mode, device, and basic prediction statistics.
References
- Dong, J., Wang, W., and Tan, T. "CASIA Image Tampering Detection Evaluation Database." 2013 IEEE China Summit and International Conference on Signal and Information Processing, 2013. DOI
@inproceedings{Dong2013,
doi = {10.1109/chinasip.2013.6625374},
url = {https://doi.org/10.1109/chinasip.2013.6625374},
year = {2013},
month = jul,
publisher = {{IEEE}},
author = {Jing Dong and Wei Wang and Tieniu Tan},
title = {{CASIA} Image Tampering Detection Evaluation Database},
booktitle = {2013 {IEEE} China Summit and International Conference on Signal and Information Processing}
}
- Pham, N. T., Lee, J.-W., Kwon, G.-R., and Park, C.-S. "Hybrid Image-Retrieval Method for Image-Splicing Validation." Symmetry, 11(1), 83, 2019.
@article{pham2019hybrid,
title = {Hybrid Image-Retrieval Method for Image-Splicing Validation},
author = {Pham, Nam Thanh and Lee, Jong-Weon and Kwon, Goo-Rak and Park, Chun-Su},
journal = {Symmetry},
volume = {11},
number = {1},
pages = {83},
year = {2019},
publisher = {Multidisciplinary Digital Publishing Institute}
}