Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion explainability/explainer/base_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def __init__(
branch_level: Literal["low", "high"] = "high",
l_stage_idx: int = -1, # gcvit low branch stage index (0~3)
block_idx: int = -1, # vit, gcvit block index
model: Optional[torch.nn.Module] = None,
):

self.device = "cuda:0" if torch.cuda.is_available() else 'cpu'
Expand All @@ -34,7 +35,9 @@ def __init__(
self.transformer_type = model_name.split("_")[-2] # vit, gcvit

# Model & Tools setup
self.model = timm.create_model(model_name, pretrained=True, dataset=dataset)
self.model = model if model is not None else timm.create_model(
model_name, pretrained=True, dataset=dataset
)
self.face_detector = FaceDetector2(conf_thres)
self.img_size = [224,224] if self.model_variant == "b0" else [384,384]
self.transforms = get_test_transforms(img_size=self.img_size)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
# ─────────────────────────────────────────────
[project]
name = "deepguard" # pip install deepguard 할 때 이 이름
version = "0.2.4" # pip install deepguard==0.2.4 으로 버전 고정 가능
version = "0.3.0" # pip install deepguard==0.2.4 으로 버전 고정 가능
description = "Multi-Scale Efficient Global Context Vision Transformer for Robust Deepfake Detection"
readme = "README.md" # PyPI 페이지에 표시될 설명 (마크다운)
requires-python = ">=3.10" # 이 버전 미만이면 pip install 자체를 막음
Expand Down
Loading