ml-aim
ml-aim copied to clipboard
MLX example?
Hi, wanted to do some quick tests using aimv2-large-patch14-224-lit with the MLX backend but can't seem to find any convenience function to encode text in the repo? Digging through the code for a little while now and not seeing anything like the image encoding example using MLX:
from PIL import Image
import mlx.core as mx
from aim.v2.utils import load_pretrained
from aim.v1.torch.data import val_transforms
img = Image.open(...)
model = load_pretrained("aimv2-large-patch14-336", backend="mlx")
transform = val_transforms(img_size=336)
inp = transform(img).unsqueeze(0)
inp = mx.array(inp.numpy())
features = model(inp)