Image Feature Extraction
Transformers
PyTorch
manekko_3d
feature-extraction
vision-transformer
3d
medical-imaging
manekko
custom_code
Instructions to use Tenbatsu2424/Manekko_PanCancerCT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Tenbatsu2424/Manekko_PanCancerCT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-feature-extraction", model="Tenbatsu2424/Manekko_PanCancerCT", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Tenbatsu2424/Manekko_PanCancerCT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
|
Download README.md from Tenbatsu2424/Manekko_PanCancerCT: direct link, hf CLI and curl.
- Browser
- Download file 1.58 kB
-
https://huggingface.co/Tenbatsu2424/Manekko_PanCancerCT/resolve/main/README.md
- Command line
-
hf download hf://Tenbatsu2424/Manekko_PanCancerCT/README.md
-
curl -L -o README.md https://huggingface.co/Tenbatsu2424/Manekko_PanCancerCT/resolve/main/README.md
1.58 kB
| library_name: transformers | |
| pipeline_tag: image-feature-extraction | |
| tags: | |
| - pytorch | |
| - vision-transformer | |
| - 3d | |
| - medical-imaging | |
| - manekko | |
| inference: false | |
| # Manekko_PanCancerCT | |
| **Manekko Small** is a 3D volume encoder for the PanCancerCT release, with 12 transformer blocks, 6 attention heads, and 384-dimensional features. | |
| **Weights are not uploaded yet.** Pretrained loading reports “weights unavailable” until they are added. The example below is ready to use once weights are available. | |
| Input is a preprocessed, single-channel float tensor `[B,1,D,H,W]`. Each spatial dimension must be divisible by **8**, with at least two patches overall. Rectangular volumes are supported. The model preserves axis order and does not resize or normalize intensities automatically. | |
| `forward_features` returns: | |
| | Output | Shape | | |
| |---|---| | |
| | `latent` | `[B,384]` | | |
| | `patch_latent` | `[B,384,D/8,H/8,W/8]` | | |
| | `patch_tokens` | `[B,N,384]`, where `N=(D/8)(H/8)(W/8)` | | |
| Patch tokens flatten the last spatial axis fastest. The encoder components are accessible through `patch_embed`, `eva`, `blocks`, and `norm`. | |
| ```python | |
| import numpy as np | |
| import torch | |
| from transformers import AutoModel | |
| model = AutoModel.from_pretrained( | |
| "Tenbatsu2424/Manekko_PanCancerCT", trust_remote_code=True | |
| ).eval() | |
| x = torch.from_numpy(np.load("preprocessed_volume.npy", allow_pickle=False)).float()[None, None] | |
| with torch.inference_mode(): | |
| features = model.forward_features(x) | |
| latent, patch_latent = features["latent"], features["patch_latent"] | |
| ``` | |