|
Download README.md from quangduc/casopad: direct link, hf CLI and curl.
- Browser
- Download file 4.53 kB
-
https://huggingface.co/quangduc/casopad/resolve/main/README.md
- Command line
-
hf download hf://quangduc/casopad/README.md
-
curl -L -o README.md https://huggingface.co/quangduc/casopad/resolve/main/README.md
4.53 kB
metadata
library_name: pytorch
tags:
- face-anti-spoofing
- presentation-attack-detection
- facepad
- caso-pad
- mobilenetv3
- involution
- offline
- air-gapped
pipeline_tag: image-classification
license: other
CASO-PAD — offline bundle (native python, không Docker)
Bundle chạy toàn bộ chương trình train CASO-PAD trên cụm GPU không có internet:
code + 17 file weight ImageNet (1.42 GB) cho 13 backbone. Không cần tải bất cứ thứ gì
ở runtime (đã kiểm chứng bằng check_weights.py với mọi download bị chặn).
File
| File | Size | Mô tả |
|---|---|---|
caso-pad-offline-2026-11-27.zip |
~1.3 GB | toàn bộ bundle (code + weight + scripts + README) |
SHA256SUMS.txt |
— | checksum của file zip |
sha256sum -c SHA256SUMS.txt
Nội dung zip
caso-pad-offline/
├── CASO-PAD-code/ # 16 .py: train.py, train_node1/2.py, ddp_common.py,
│ # build_data.py (+ loader CVPR2023), build_model.py,
│ # evaluate.py, evaluate_fn.py, check_cvpr_dataset.py…
├── torch_cache/hub/checkpoints/ # 17 .pth (1422 MB): 13 backbone × 2 API torchvision
├── env.sh # source -> TORCH_HOME + PYTHONPATH
├── check_env.py # kiểm tra thư viện / GPU / weight / dataset
├── check_weights.py # kiểm tra đủ weight, CHẶN mọi download
├── requirements.txt # torch 2.4.1+cu124, torchvision 0.19.1, numpy 2.1.1,
│ # opencv-headless 4.10, scikit-learn 1.5.2, pillow,
│ # tqdm, tensorboard
├── make_wheelhouse.sh # (tuỳ chọn) sinh .whl để pip offline
├── dataset_paths.example.json
├── MANIFEST.sha256 # sha256 của 50 file
├── VERSION.txt # commit gốc 9fc5604 (2026-08-04)
└── README.md # hướng dẫn đầy đủ (bản trong zip)
Backbone đã cache (cả 2 API weights="DEFAULT" và pretrained=True):
mobilenet_v3_large, mobilenet_v3_small, mobilenet_v2, resnet18, resnet34,
resnet50, efficientnet_b0/b1/b2, convnext_tiny/small, vgg16, shufflenet_v2_x1_0.
Chạy nhanh
scp caso-pad-offline-2026-11-27.zip user@h100:/data/tools/
cd /data/tools && unzip caso-pad-offline-2026-11-27.zip && cd caso-pad-offline
source env.sh
python check_weights.py # -> OK: đủ weight cho 13 backbone (17 file), không cần internet
cp dataset_paths.example.json dataset_paths.json
vi dataset_paths.json # { "CVPR": "/data/datasets/CVPR2023/Train" }
# 1 GPU
python CASO-PAD-code/train.py --paper_method caso_pad --training_mode single \
--datasets CVPR --img_size 256 --num_frames 1 --num_frames_val 1 \
--batch_size 32 --num_workers 8 --num_epochs 30 --lr 1e-4 \
--early_stop_patience 5 --inv_kernel 5 --inv_groups 120 --inv_reduce 4
# 1 node x 8 GPU
OMP_NUM_THREADS=1 torchrun --nproc_per_node=8 CASO-PAD-code/train_node1.py \
--datasets CVPR --img_size 256 --num_frames 1 --num_frames_val 1 \
--batch_size 64 --num_workers 8 --amp bf16 --num_epochs 30 --lr 4e-4
Yêu cầu: Python 3.9–3.12, PyTorch ≥ 2.0 + torchvision, numpy/opencv/scikit-learn/pillow/tqdm/tensorboard.
Nếu cụm thiếu thư viện → ./make_wheelhouse.sh trên máy có internet rồi
pip install --no-index --find-links wheelhouse -r requirements.txt.
Dataset (không kèm trong zip)
- Loader có sẵn:
CVPR(CVPR2023 Wild layoutliving/+spoof/<type>/<subject>/), cùng OULU-NPU, SiW-Mv2, MSU-MFSD, CASIA-FASD, Replay-Attack/Mobile, ROSE-Youtu. - Khai báo đường dẫn trong
dataset_paths.json(đường dẫn trên máy đích). - Kiểm tra trước khi train:
python CASO-PAD-code/check_cvpr_dataset.py --root /data/datasets/CVPR2023/Train --limit 1000
Liên quan
- Docker image (đã cài sẵn mọi thứ):
quangducc/caso-pad-face-spoofingtrên Docker Hub. - Upstream code: https://github.com/Shujaat123/CASO-PAD
Đã kiểm chứng (2026-11-27)
| Test | Kết quả |
|---|---|
sha256sum -c MANIFEST.sha256 (50 file) |
✅ |
check_weights.py khi mạng bị chặn |
✅ 13 backbone / 17 file |
train.py 1 epoch khi mạng bị chặn |
✅ không request download |
unzip -t file zip |
✅ no errors |