-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhubconf.py
More file actions
36 lines (26 loc) · 1021 Bytes
/
hubconf.py
File metadata and controls
36 lines (26 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import pyiqa
dependencies = ["torch", "torchvision", "gdown", "yaml", "cv2", "scipy", "huggingface_hub", "pandas"]
available_models = {
'arniqa': 'arniqa-iisadb',
'clipiqa': 'clipiqa+-iisadb',
'contrique': 'contrique-iisadb',
'dbcnn': 'dbcnn-iisadb',
'qualiclip': 'qualiclip+-iisadb',
'topiq': 'topiq_nr-iisadb',
}
def _make_model(model_key: str, device: str = "cpu"):
assert model_key in available_models, f"Unsupported model {model_key}"
return pyiqa.create_metric(available_models[model_key], device=device)
# Entrypoints
def arniqa(device: str = "cpu"):
return _make_model("arniqa", device)
def clipiqa(device: str = "cpu"):
return _make_model("clipiqa", device)
def contrique(device: str = "cpu"):
return _make_model("contrique", device)
def dbcnn(device: str = "cpu"):
return _make_model("dbcnn", device)
def qualiclip(device: str = "cpu"):
return _make_model("qualiclip", device)
def topiq(device: str = "cpu"):
return _make_model("topiq", device)