Views
No views yet
1conda create --name GenD python=3.12 uv
2conda activate GenD
3uv pip install -r requirements.txt1import requests
2import torch
3from PIL import Image
4
5from src.hf.modeling_gend import GenD
6
7model = GenD.from_pretrained("yermandy/GenD_DINOv3_L")
8
9urls = [
10 "https://github.com/yermandy/deepfake-detection/blob/main/datasets/FF/DF/000_003/000.png?raw=true",
11 "https://github.com/yermandy/deepfake-detection/blob/main/datasets/FF/real/000/000.png?raw=true",
12]
13images = [Image.open(requests.get(url, stream=True).raw) for url in urls]
14tensors = torch.stack([model.feature_extractor.preprocess(img) for img in images])
15logits = model(tensors)
16probs = logits.softmax(dim=-1)
17
18print(probs)