| --- |
| license: mit |
| language: |
| - zh |
| tags: |
| - image-forgery-detection |
| - convnext |
| - pytorch |
| --- |
| |
| # face-forgery-detection |
|
|
| Image forgery detection models. |
|
|
| ## Models |
|
|
| | Model | Backbone | Task | |
| |-------|----------|------| |
| | convnext_base | ConvNeXt-Base | Image Forgery Detection | |
| | inceptionnext_base | InceptionNeXt-Base | Image Forgery Detection | |
| | maxvit_base | MaxViT-Base | Image Forgery Detection | |
| | fastervit_2 | FasterViT-2 | Image Forgery Detection | |
| | internvit_300m | InternViT-300M | Image Forgery Detection | |
| | mambavision_t | MambaVision-T | Image Forgery Detection | |
| | dinov2_base | DINOv2-Base | Image Forgery Detection | |
| |
| ## Usage |
| |
| ```python |
| import json |
| import torch |
| from huggingface_hub import hf_hub_download |
|
|
| # Download model files |
| config_path = hf_hub_download("OhMyYuwan/face-forgery-detection", "convnext_base/config.json") |
| model_path = hf_hub_download("OhMyYuwan/face-forgery-detection", "convnext_base/pytorch_model.bin") |
| |
| # Load model |
| with open(config_path) as f: |
| config = json.load(f) |
| |
| from convnext_base.model import OurNet |
| model = OurNet(config) |
| state = torch.load(model_path, map_location="cpu") |
| model.load_state_dict(state, strict=False) |
| model.eval() |
| ``` |
| |