Skip to content

Instantly share code, notes, and snippets.

@travishsu
Created April 24, 2025 02:42
Show Gist options
  • Save travishsu/7fc009b6bb00cdc7b81cb02df81420f2 to your computer and use it in GitHub Desktop.
Save travishsu/7fc009b6bb00cdc7b81cb02df81420f2 to your computer and use it in GitHub Desktop.
# uvx --with "git+https://github.com/travishsu/mimm.git" --with numpy ipython
import mlx.core as mx
from mimm import get_model, list_models
model = get_model('resnet50', pretrained=True)
img = mx.random.normal((3, 256, 256, 3))
features = model.features(img)
for layer, feature in features.items():
print(layer, feature.shape)
# layer1 (3, 64, 64, 256)
# layer2 (3, 32, 32, 512)
# layer3 (3, 16, 16, 1024)
# layer4 (3, 8, 8, 2048)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment