Views
No views yet

The model weights and their respective implementation were taken from moonshotai/Kimi-K2.6, so all credit and thanks go to the Moonshot AI team.
Kimi_K25VisionModel format, so it works directly with transformers — no trust_remote_code needed.1from transformers import AutoImageProcessor, AutoModel
2import torch
3from PIL import Image
4
5img = Image.open("a_red_car.png")
6processor = AutoImageProcessor.from_pretrained("Aquiles-ai/MoonViT-3D")
7model = AutoModel.from_pretrained("Aquiles-ai/MoonViT-3D", dtype=torch.bfloat16).to("cuda")
8
9inputs = processor(images=[img], return_tensors="pt")
10with torch.no_grad():
11 out = model(
12 pixel_values=inputs["pixel_values"].to(torch.bfloat16).to("cuda"),
13 grid_thw=inputs["image_grid_thw"].to("cuda"),
14 )
15print(out.last_hidden_state.shape) # (num_patches, 1152)
16print(out.pooler_output.shape) # (num_merged_blocks, 4, 1152)1from transformers import AutoImageProcessor, AutoModel
2import torch
3from PIL import Image
4
5img = Image.open("a_red_car.png")
6img2 = Image.open("a_gray_cat.png")
7processor = AutoImageProcessor.from_pretrained("Aquiles-ai/MoonViT-3D")
8model = AutoModel.from_pretrained("Aquiles-ai/MoonViT-3D", dtype=torch.bfloat16).to("cuda")
9
10inputs = processor(images=[img, img2], return_tensors="pt")
11with torch.no_grad():
12 out = model(
13 pixel_values=inputs["pixel_values"].to(torch.bfloat16).to("cuda"),
14 grid_thw=inputs["image_grid_thw"].to("cuda"),
15 )
16print(out.last_hidden_state.shape) # (total_patches, 1152) - flattened over the batch
17print(out.pooler_output.shape) # (total_merged_blocks, 4, 1152)grid_thw with a temporal dimension, in theory you can pass sequences of frames and get spatio-temporal features, although the modelcard doesn't include an example of this — you'd need to build it yourself.