Instructions to use Xenova/owlvit-base-patch32 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use Xenova/owlvit-base-patch32 with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('zero-shot-object-detection', 'Xenova/owlvit-base-patch32');
Update README.md
Browse files20 unmodified lines2122232425262720 unmodified linesconst url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png';const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];const output = await detector (url, candidate_labels);// [// { score: 0.24392342567443848, label: 'human face', box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 } },// { score: 0.15129457414150238, label: 'american flag', box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 } },20 unmodified lines2122232425262720 unmodified linesconst url = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/astronaut.png';const candidate_labels = ['human face', 'rocket', 'helmet', 'american flag'];const output = await detector(url, candidate_labels);// [// { score: 0.24392342567443848, label: 'human face', box: { xmin: 180, ymin: 67, xmax: 274, ymax: 175 } },// { score: 0.15129457414150238, label: 'american flag', box: { xmin: 0, ymin: 4, xmax: 106, ymax: 513 } },
README.md+1-1