Run this model with HF Jobs
Run NeuronZero/MRI-Reader on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/NeuronZero/MRI-Reader. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/NeuronZero/MRI-Reader on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use NeuronZero/MRI-Reader with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use NeuronZero/MRI-Reader with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="NeuronZero/MRI-Reader") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# pip install -U transformers accelerate # Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("NeuronZero/MRI-Reader") model = AutoModelForImageClassification.from_pretrained("NeuronZero/MRI-Reader", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files1234567891011121314151617181920212223242526---tags:- autotrain- image-classification- medicalwidget:- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/tiger.jpgexample_title: Tiger- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/teapot.jpgexample_title: Teapot- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/palace.jpgexample_title: Palacedatasets:- sartajbhuvaji/Brain-Tumor-Classificationlicense: apache-2.0language:- enpipeline_tag: image-classification---# Model Trained Using AutoTrain- Problem type: Image Classification## Validation MetricsNo validation metrics available123456789101112131415161718192021222324252627282930313233343536373839404142434445464748---license: apache-2.0tags:- vision- image-classificationdatasets:- sartajbhuvaji/Brain-Tumor-Classificationlanguage:- enpipeline_tag: image-classification---# MRI-Reader(small-sized model)MRI-Reader is a fine-tuned version of [swin-base](https://huggingface.co/microsoft/swin-base-patch4-window7-224-in22k). It was introduced in this [paper](https://arxiv.org/abs/2103.14030) by Liu et al. and first released in this [repository](https://github.com/microsoft/Swin-Transformer).## Model descriptionThe Swin Transformer is a type of Vision Transformer. It builds hierarchical feature maps by merging image patches (shown in gray) in deeper layers and has linear computation complexity to input image size due to computation of self-attention only within each local window (shown in red). It can thus serve as a general-purpose backbone for both image classification and dense recognition tasks. In contrast, previous vision Transformers produce feature maps of a single low resolution and have quadratic computation complexity to input image size due to computation of self-attention globally.[Source](https://paperswithcode.com/method/swin-transformer)### How to useHere is how to use this model to classify an image of the COCO 2017 dataset into one of the 1,000 ImageNet classes:```pythonfrom transformers import AutoImageProcessor, SwinForImageClassificationfrom PIL import Imageimport requestsurl = "http://images.cocodataset.org/val2017/000000039769.jpg"image = Image.open(requests.get(url, stream=True).raw)processor = AutoImageProcessor.from_pretrained("microsoft/swin-base-patch4-window7-224-in22k")model = SwinForImageClassification.from_pretrained("microsoft/swin-base-patch4-window7-224-in22k")inputs = processor(images=image, return_tensors="pt")outputs = model(**inputs)logits = outputs.logits# model predicts one of the 1000 ImageNet classespredicted_class_idx = logits.argmax(-1).item()print("Predicted class:", model.config.id2label[predicted_class_idx])```
README.md+36-14