scrimba
AI Engineering
Open-source AI Models
AI Models In The Browser With Transformers.js
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

AI Models In The Browser With Transformers.js
AboutCommentsNotes
AI Models In The Browser With Transformers.js
Expand for more info
index.js
run
preview
console

import { pipeline } from 'https://cdn.jsdelivr.net/npm/@xenova/transformers@2.8.0'

// Reference the elements that we will need
const status = document.getElementById('status')
const image = document.getElementById('image')

// Load model and create a new object detection pipeline
status.textContent = 'Loading model...'

status.textContent = 'Done!'
Console
/index.html
-7:02