Downloads · 30 days
10
10% of all-time downloads
toilaluan/raev2-compressor
raev2-compressor is a machine learning model from toilaluan. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as osl-3.0.
This is an adapter for RAEv2 checkpoint. This adapter further compresses feature space of RAE with pool size is 2. That means if input is 256x256, original RAE produces 256x1024 latent space. With this adapter, we tra…
Downloads · 30 days
10
10% of all-time downloads
All-time downloads
100
Public
Parameters
232M
2.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors929 MB · 100%
From the Hugging Face model README
This is an adapter for RAEv2 checkpoint. This adapter further compresses feature space of RAE with pool size is 2. That means if input is 256x256, original RAE produces 256x1024 latent space. With this adapter, we trained on AutoEncoder objective, produces only 64x1024 latent space, which mostly remove redundancy of original latent space.
from transformers import AutoModel
# Load rae
rae = AutoModel.from_pretrained(
"toilaluan/raev2-dinov3l-k7",
trust_remote_code=True,
).eval().to("cuda")
compact_rae = AutoModel.from_pretrained(
"toilaluan/rae-compressor",
rae=rae,
trust_remote_code=True,
).eval().to("cuda")
images = torch.rand(1, 3, 256, 256, device="cuda")
latents = model.encode(images) # [1, 1024, 8, 8]
reconstructions = model.decode(latents) # [1, 3, 256, 256]