User-2468's picture
Release v3.0: selected sub-4M semantic colorizer, inference and verified ONNX
1a9eb8a verified
Raw History Blame
420 Bytes
from pathlib import Path
from semantic_model import SemanticColorizer, load_semantic, save_semantic
def load_model(source, revision=None, device="cpu"):
from huggingface_hub import snapshot_download
path=Path(source)
if not path.is_dir(): path=Path(snapshot_download(source,revision=revision,allow_patterns=["config.json","model.safetensors"]))
return load_semantic(path,device)
save_model=save_semantic