jeffliulab/card-calibration-v1-data
Viewer β’ Updated β’ 1 β’ 48
How to use jeffliulab/card-calibration-v1 with ultralytics:
# Couldn't find a valid YOLO version tag.
# Replace XX with the correct version.
from ultralytics import YOLOvXX
model = YOLOvXX.from_pretrained("jeffliulab/card-calibration-v1")
source = 'http://images.cocodataset.org/val2017/000000039769.jpg'
model.predict(source=source, save=True)Inference weights for the Card Calibration project β automated color calibration via two-stage YOLO detection + tree-based regression.
Best result: XGBoost with Bayesian-tuned hyperparameters β Lab Mean ΞE = 4.59 (meets commercial printing standards).
Try it directly in your browser: HuggingFace Space
| File | Description | Size |
|---|---|---|
yolo_first.pt |
YOLOv8-nano β calibration card detector | 6 MB |
yolo_second.pt |
YOLOv8-nano β 4-pattern detector (red/green/blue/black box) | 6 MB |
xgboost_v1.pkl |
XGBoost calibration model (best) | 3.5 MB |
random_forest_v1.pkl |
Random Forest calibration model | 45 MB |
from huggingface_hub import hf_hub_download
import joblib
from ultralytics import YOLO
REPO = "jeffliulab/card-calibration-v1"
# Download weights (cached in ~/.cache/huggingface/)
yolo_card_path = hf_hub_download(repo_id=REPO, filename="yolo_first.pt")
yolo_pattern_path = hf_hub_download(repo_id=REPO, filename="yolo_second.pt")
xgb_path = hf_hub_download(repo_id=REPO, filename="xgboost_v1.pkl")
# Load
yolo_card = YOLO(yolo_card_path)
yolo_pattern = YOLO(yolo_pattern_path)
xgb_model = joblib.load(xgb_path)
For the full inference pipeline (detect card β detect patterns β extract RGB β predict true color), see space/model_utils.py.
Photo βββΆ YOLO Stage 1 βββΆ Card Crop βββΆ YOLO Stage 2 βββΆ 4 Patches
β
βββββββββββββββββββββ
βΌ
Feature Engineering
(9 deltas + 3 RGB)
β
βΌ
XGBoost / RF Model
β
βΌ
Predicted True RGB
| Model | RΒ² | RMSE | Lab Mean ΞE | Lab Median ΞE |
|---|---|---|---|---|
| XGBoost (tuned) | 0.8280 | 11.76 | 4.59 | 3.61 |
| Random Forest | 0.8225 | 12.10 | 5.20 | 3.96 |
ΞE < 3: professional Β· ΞE < 5: commercial printing Β· ΞE < 10: acceptable
Dataset: jeffliulab/card-calibration-v1-data
random_state=42MIT β both data and model weights are freely available for research and commercial use.