Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Table Transformer model #477

Merged
merged 1 commit into from
Dec 26, 2023
Merged

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Dec 25, 2023

Needed by #475

Example usage

Quantized

import { pipeline } from '@xenova/transformers';

const detector = await pipeline('object-detection', 'Xenova/table-transformer-detection');

const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice-with-table.png';
const output = await detector(img);
console.log(output);
// [{ score: 0.9969743490219116, label: 'table', box: { xmin: 53, ymin: 324, xmax: 547, ymax: 524 } }]
Show example output

image

Unquantized

import { pipeline } from '@xenova/transformers';

const detector = await pipeline('object-detection', 'Xenova/table-transformer-detection', { quantized: false });

const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/invoice-with-table.png';
const output = await detector(img);
console.log(output);
// [{ score: 0.9967531561851501, label: 'table', box: { xmin: 52, ymin: 322, xmax: 546, ymax: 525 } }]
Show example output

image

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@xenova xenova merged commit f5bc758 into main Dec 26, 2023
4 checks passed
@xenova xenova deleted the add-table-transformer branch December 26, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants