mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
docs: model benchmarks (#17036)
* model benchmarks * minor fixes * formatting * docs build * maybe fix reference * clarify optimal * use emojis * wording * wording * clarify optimal wording * bolding * more detailed instructions * clarify edge case fix * early exit in dim loop
This commit is contained in:
parent
ad151130f9
commit
4bfef2460a
16 changed files with 2209 additions and 255 deletions
22
machine-learning/export/immich_model_exporter/get_dims.py
Normal file
22
machine-learning/export/immich_model_exporter/get_dims.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
|
||||
models_dir = Path("models")
|
||||
model_to_embed_dim = {}
|
||||
for model_dir in models_dir.iterdir():
|
||||
if not model_dir.is_dir():
|
||||
continue
|
||||
|
||||
config_path = model_dir / "config.json"
|
||||
if not config_path.exists():
|
||||
print(f"Skipping {model_dir.name} as it does not have a config.json")
|
||||
continue
|
||||
with open(config_path) as f:
|
||||
config = json.load(f)
|
||||
embed_dim = config.get("embed_dim")
|
||||
if embed_dim is None:
|
||||
print(f"Skipping {model_dir.name} as it does not have an embed_dim")
|
||||
continue
|
||||
print(f"{model_dir.name}: {embed_dim}")
|
||||
model_to_embed_dim[model_dir.name] = {"dimSize": embed_dim}
|
||||
print(json.dumps(model_to_embed_dim))
|
||||
Loading…
Add table
Add a link
Reference in a new issue