Image forgery detection models.
1import json
2import torch
3from huggingface_hub import hf_hub_download
4
5# Download model files
6config_path = hf_hub_download("OhMyYuwan/face-forgery-detection", "convnext_base/config.json")
7model_path = hf_hub_download("OhMyYuwan/face-forgery-detection", "convnext_base/pytorch_model.bin")
8
9# Load model
10with open(config_path) as f:
11 config = json.load(f)
12
13from convnext_base.model import OurNet
14model = OurNet(config)
15state = torch.load(model_path, map_location="cpu")
16model.load_state_dict(state, strict=False)
17model.eval()