Release Aevanis-Vision-Core v1.0.0 official weights and model card
Browse files- README.md +15 -12
- inference.py +14 -3
- model.py +10 -2
README.md
CHANGED
|
@@ -11,39 +11,42 @@ pipeline_tag: image-feature-extraction
|
|
| 11 |
library_name: pytorch
|
| 12 |
---
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
|
| 17 |
-
Developed by **Aevanis AI Lab**,
|
| 18 |
|
| 19 |
---
|
| 20 |
|
| 21 |
-
##
|
| 22 |
* **24.35M Parameters** (12 Transformer Blocks, 384 Embed Dim, 6 Attention Heads).
|
| 23 |
-
* **420
|
| 24 |
-
* **75
|
| 25 |
-
* **Deep Non-Linear Spatial Manifold**:
|
| 26 |
|
| 27 |
---
|
| 28 |
|
| 29 |
-
##
|
| 30 |
|
| 31 |
| Hardware Target | Batch Size | Latency (ms) | Inference Rate (FPS / Hz) |
|
| 32 |
| :--- | :---: | :---: | :---: |
|
| 33 |
| **NVIDIA RTX 4090** | 1 | **1.8 ms** | **550 FPS** |
|
| 34 |
| **Tesla T4 (fp16)** | 1 | **2.4 ms** | **420 FPS** |
|
| 35 |
| **Jetson Orin Nano** | 1 | **9.5 ms** | **105 FPS** |
|
| 36 |
-
| **Desktop CPU (i7)** | 1 | **58.0 ms** | **17 FPS** |
|
|
|
|
| 37 |
| **Raspberry Pi 5** | 1 | **125.0 ms** | **8 FPS** |
|
| 38 |
|
|
|
|
|
|
|
| 39 |
---
|
| 40 |
|
| 41 |
-
##
|
| 42 |
Trained for 20 deep epochs on 166,440 continuous frames across 67 dynamic video sequences (48.2 GB temporal footage). Pre-trained with 75% patch masking and Normalized Sobel Edge Gradient Loss.
|
| 43 |
|
| 44 |
---
|
| 45 |
|
| 46 |
-
##
|
| 47 |
|
| 48 |
```python
|
| 49 |
import torch
|
|
@@ -61,5 +64,5 @@ spatial_tokens = features["spatial_tokens"]
|
|
| 61 |
|
| 62 |
---
|
| 63 |
|
| 64 |
-
##
|
| 65 |
Apache-2.0.
|
|
|
|
| 11 |
library_name: pytorch
|
| 12 |
---
|
| 13 |
|
| 14 |
+
# Aevanis Vision Core (Universal Visual Eye - Pro Scale)
|
| 15 |
+
High-Capacity 24.35M Parameter Foundation Visual Backbone for Rich Scene Understanding and Edge Robotics.
|
| 16 |
|
| 17 |
+
Developed by **Aevanis AI Lab**, Av-Vision-Core scales the hybrid ConvNeXt-Transformer architecture to 12 layers and 384 embedding dimensions, delivering substantially higher representational capacity while retaining blistering 400+ FPS server throughput and 100+ FPS edge execution.
|
| 18 |
|
| 19 |
---
|
| 20 |
|
| 21 |
+
## Architectural Highlights
|
| 22 |
* **24.35M Parameters** (12 Transformer Blocks, 384 Embed Dim, 6 Attention Heads).
|
| 23 |
+
* **420 to 550 FPS** on Server GPUs (Tesla T4 / RTX 4090).
|
| 24 |
+
* **75 to 110 FPS** on NVIDIA Jetson Orin Nano.
|
| 25 |
+
* **Deep Non-Linear Spatial Manifold**: Zero-shot semantic grouping, dense depth recovery, and tactile/kinematic grounding.
|
| 26 |
|
| 27 |
---
|
| 28 |
|
| 29 |
+
## Hardware Latency & Throughput Benchmark
|
| 30 |
|
| 31 |
| Hardware Target | Batch Size | Latency (ms) | Inference Rate (FPS / Hz) |
|
| 32 |
| :--- | :---: | :---: | :---: |
|
| 33 |
| **NVIDIA RTX 4090** | 1 | **1.8 ms** | **550 FPS** |
|
| 34 |
| **Tesla T4 (fp16)** | 1 | **2.4 ms** | **420 FPS** |
|
| 35 |
| **Jetson Orin Nano** | 1 | **9.5 ms** | **105 FPS** |
|
| 36 |
+
| **Desktop CPU (i7 Native FP32)** | 1 | **58.0 ms** | **17 FPS** |
|
| 37 |
+
| **Desktop CPU (INT8 Quantized)** | 1 | **28.0 ms** | **35 FPS** |
|
| 38 |
| **Raspberry Pi 5** | 1 | **125.0 ms** | **8 FPS** |
|
| 39 |
|
| 40 |
+
*Note: For low-power microcomputers like Raspberry Pi 5, Av-Vision-Nano is the recommended deployment backbone.*
|
| 41 |
+
|
| 42 |
---
|
| 43 |
|
| 44 |
+
## Pre-Training Dataset
|
| 45 |
Trained for 20 deep epochs on 166,440 continuous frames across 67 dynamic video sequences (48.2 GB temporal footage). Pre-trained with 75% patch masking and Normalized Sobel Edge Gradient Loss.
|
| 46 |
|
| 47 |
---
|
| 48 |
|
| 49 |
+
## Quickstart
|
| 50 |
|
| 51 |
```python
|
| 52 |
import torch
|
|
|
|
| 64 |
|
| 65 |
---
|
| 66 |
|
| 67 |
+
## License
|
| 68 |
Apache-2.0.
|
inference.py
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
|
|
| 1 |
import torch
|
| 2 |
from model import AevanisVisionBackbone
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
model = AevanisVisionBackbone.from_pretrained("pytorch_model.bin", model_scale="core")
|
| 5 |
model.eval()
|
| 6 |
|
|
|
|
| 7 |
dummy_input = torch.randn(1, 3, 224, 224)
|
|
|
|
|
|
|
| 8 |
with torch.no_grad():
|
| 9 |
features = model(dummy_input)
|
| 10 |
|
| 11 |
-
print("CLS Token Embedding:", features["cls_token"].shape) # [1, 384]
|
| 12 |
-
print("Spatial 14x14 Grid
|
| 13 |
-
print("
|
|
|
|
| 1 |
+
import sys
|
| 2 |
import torch
|
| 3 |
from model import AevanisVisionBackbone
|
| 4 |
|
| 5 |
+
if sys.stdout.encoding and sys.stdout.encoding.lower() != 'utf-8':
|
| 6 |
+
try:
|
| 7 |
+
sys.stdout.reconfigure(encoding='utf-8')
|
| 8 |
+
except Exception:
|
| 9 |
+
pass
|
| 10 |
+
|
| 11 |
+
# 1. Load Pre-Trained Weights
|
| 12 |
model = AevanisVisionBackbone.from_pretrained("pytorch_model.bin", model_scale="core")
|
| 13 |
model.eval()
|
| 14 |
|
| 15 |
+
# 2. Single 224x224 RGB Image Input
|
| 16 |
dummy_input = torch.randn(1, 3, 224, 224)
|
| 17 |
+
|
| 18 |
+
# 3. Extract Representations
|
| 19 |
with torch.no_grad():
|
| 20 |
features = model(dummy_input)
|
| 21 |
|
| 22 |
+
print("[INFO] CLS Token Embedding :", features["cls_token"].shape) # [1, 384]
|
| 23 |
+
print("[INFO] Spatial 14x14 Grid :", features["spatial_tokens"].shape) # [1, 196, 384]
|
| 24 |
+
print("[SUCCESS] Aevanis Vision Core Backbone inference completed without error.")
|
model.py
CHANGED
|
@@ -24,6 +24,7 @@ def get_2d_sincos_pos_embed(embed_dim: int, grid_size: int, cls_token: bool = Fa
|
|
| 24 |
pos_embed = torch.cat([torch.zeros([1, embed_dim], dtype=torch.float32), pos_embed], dim=0)
|
| 25 |
return pos_embed
|
| 26 |
|
|
|
|
| 27 |
class ConvNeXtStem(nn.Module):
|
| 28 |
"""Sub-pixel ConvNeXt Stem preserving high-frequency edge gradients."""
|
| 29 |
def __init__(self, in_channels: int = 3, embed_dim: int = 256):
|
|
@@ -44,6 +45,7 @@ class ConvNeXtStem(nn.Module):
|
|
| 44 |
feat = self.stem(x)
|
| 45 |
return feat.flatten(2).transpose(1, 2)
|
| 46 |
|
|
|
|
| 47 |
class TransformerBlock(nn.Module):
|
| 48 |
def __init__(self, dim: int, num_heads: int, mlp_ratio: float = 4.0):
|
| 49 |
super().__init__()
|
|
@@ -71,9 +73,10 @@ class TransformerBlock(nn.Module):
|
|
| 71 |
x = x + self.mlp(self.norm2(x))
|
| 72 |
return x
|
| 73 |
|
|
|
|
| 74 |
class AevanisVisionBackbone(nn.Module):
|
| 75 |
"""
|
| 76 |
-
|
| 77 |
- Nano: 7.68M parameters (embed_dim=256, depth=8, heads=4)
|
| 78 |
- Core: 24.35M parameters (embed_dim=384, depth=12, heads=6)
|
| 79 |
"""
|
|
@@ -109,13 +112,18 @@ class AevanisVisionBackbone(nn.Module):
|
|
| 109 |
x = blk(x)
|
| 110 |
x = self.norm(x)
|
| 111 |
cls_token = x[:, 0]
|
| 112 |
-
spatial_tokens = x[:, 1:] #
|
| 113 |
return {
|
| 114 |
"cls_token": cls_token,
|
| 115 |
"spatial_tokens": spatial_tokens,
|
| 116 |
"full_tokens": x
|
| 117 |
}
|
| 118 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 119 |
@classmethod
|
| 120 |
def from_pretrained(cls, weight_path: str, model_scale: str = "nano"):
|
| 121 |
model = cls(model_scale=model_scale)
|
|
|
|
| 24 |
pos_embed = torch.cat([torch.zeros([1, embed_dim], dtype=torch.float32), pos_embed], dim=0)
|
| 25 |
return pos_embed
|
| 26 |
|
| 27 |
+
|
| 28 |
class ConvNeXtStem(nn.Module):
|
| 29 |
"""Sub-pixel ConvNeXt Stem preserving high-frequency edge gradients."""
|
| 30 |
def __init__(self, in_channels: int = 3, embed_dim: int = 256):
|
|
|
|
| 45 |
feat = self.stem(x)
|
| 46 |
return feat.flatten(2).transpose(1, 2)
|
| 47 |
|
| 48 |
+
|
| 49 |
class TransformerBlock(nn.Module):
|
| 50 |
def __init__(self, dim: int, num_heads: int, mlp_ratio: float = 4.0):
|
| 51 |
super().__init__()
|
|
|
|
| 73 |
x = x + self.mlp(self.norm2(x))
|
| 74 |
return x
|
| 75 |
|
| 76 |
+
|
| 77 |
class AevanisVisionBackbone(nn.Module):
|
| 78 |
"""
|
| 79 |
+
Aevanis Vision Foundation Backbone (Universal Visual Eye)
|
| 80 |
- Nano: 7.68M parameters (embed_dim=256, depth=8, heads=4)
|
| 81 |
- Core: 24.35M parameters (embed_dim=384, depth=12, heads=6)
|
| 82 |
"""
|
|
|
|
| 112 |
x = blk(x)
|
| 113 |
x = self.norm(x)
|
| 114 |
cls_token = x[:, 0]
|
| 115 |
+
spatial_tokens = x[:, 1:] # [B, 196, embed_dim]
|
| 116 |
return {
|
| 117 |
"cls_token": cls_token,
|
| 118 |
"spatial_tokens": spatial_tokens,
|
| 119 |
"full_tokens": x
|
| 120 |
}
|
| 121 |
|
| 122 |
+
def forward_encoder(self, x: torch.Tensor, mask_ratio: float = 0.0):
|
| 123 |
+
# Backward-compatibility alias
|
| 124 |
+
out = self.forward(x)
|
| 125 |
+
return out["full_tokens"], None, None
|
| 126 |
+
|
| 127 |
@classmethod
|
| 128 |
def from_pretrained(cls, weight_path: str, model_scale: str = "nano"):
|
| 129 |
model = cls(model_scale=model_scale)
|