Aevanis-Vision-Core / inference.py
Aevanis's picture
Release Aevanis-Vision-Core v1.0.0 official weights and model card
8623ebb verified
Raw History Blame Contribute Delete
800 Bytes
import sys
import torch
from model import AevanisVisionBackbone
if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
try:
sys.stdout.reconfigure(encoding='utf-8')
except Exception:
pass
# 1. Load Pre-Trained Weights
model = AevanisVisionBackbone.from_pretrained("pytorch_model.bin", model_scale="core")
model.eval()
# 2. Single 224x224 RGB Image Input
dummy_input = torch.randn(1, 3, 224, 224)
# 3. Extract Representations
with torch.no_grad():
features = model(dummy_input)
print("[INFO] CLS Token Embedding :", features["cls_token"].shape) # [1, 384]
print("[INFO] Spatial 14x14 Grid :", features["spatial_tokens"].shape) # [1, 196, 384]
print("[SUCCESS] Aevanis Vision Core Backbone inference completed without error.")