Run this model with HF Jobs
Run Xenova/slimsam-50-uniform 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/Xenova/slimsam-50-uniform. 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/Xenova/slimsam-50-uniform 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 Xenova/slimsam-50-uniform with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Xenova/slimsam-50-uniform with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('mask-generation', 'Xenova/slimsam-50-uniform');
Transformers.js v3
Browse files7 unmodified lines8910111213141 unmodified line161718192021222 unmodified lines252627282930313233347 unmodified lines## Usage (Transformers.js)If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@xenova/transformers) using:```bashnpm i @xenova/transformers```1 unmodified line**Example:** Perform mask generation with `Xenova/slimsam-50-uniform`.```jsimport { SamModel, AutoProcessor, RawImage } from '@xenova/transformers';// Load model and processorconst model = await SamModel.from_pretrained('Xenova/slimsam-50-uniform');2 unmodified lines// Prepare image and input pointsconst img_url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/corgi.jpg';const raw_image = await RawImage.read(img_url);const input_points = [[[340, 250]]] // 2D localization of a window// Process inputs and perform mask generationconst inputs = await processor(raw_image, input_points);const outputs = await model(inputs);// Post-process masks7 unmodified lines8910111213141 unmodified line161718192021222 unmodified lines252627282930313233347 unmodified lines## Usage (Transformers.js)If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:```bashnpm i @xenova/transformers```1 unmodified line**Example:** Perform mask generation with `Xenova/slimsam-50-uniform`.```jsimport { SamModel, AutoProcessor, RawImage } from '@huggingface/transformers';// Load model and processorconst model = await SamModel.from_pretrained('Xenova/slimsam-50-uniform');2 unmodified lines// Prepare image and input pointsconst img_url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/corgi.jpg';const raw_image = await RawImage.read(img_url);const input_points = [[[340, 250]]];// Process inputs and perform mask generationconst inputs = await processor(raw_image, { input_points });const outputs = await model(inputs);// Post-process masks
README.md+4-4