Objectives
- ๐ฏ Understand what Transformers.js is and its applications for creative projects.
- ๐ Learn how to integrate an ES6 module like Transformers.js into p5.js using dynamic imports.
- โณ Gain experience with asynchronous JavaScript (async/await) for handling machine learning models.
- ๐ค Explore a selection of pre-trained models available in Transformers.js (e.g., sentiment analysis, object detection, Whisper, LLMs).
- ๐ Learn about the new WebGPU support and how to use it for accelerated machine learning.
p5.js DOM Basics and Resources
Example Projects and Demos
Code Examples
Assignment
For this weekโs assignment:
-
Choose any model available in Transformers.js and create a p5.js sketch using it. Try any transformer.sj compatible model! Some things you might look for are:
- Object Detection: ๐ต๏ธ Detect objects in an image.
- Image Segmentation: โ๏ธ Segment an image into parts.
- Text Generation: โ๏ธ Generate text based on a user prompt.
- Whisper (Speech-to-Text): ๐๏ธ Transcribe audio from a file or real-time microphone.
- Depth Estimation: ๐ Create a depth map from an image or video feed.
-
Compare and Contrast:
- Compare your experience of using Transformers.js with ml5.js. Reflect on differences in ease of use, performance, model variety, and integration with p5.js.
-
Document your sketch in a blog post and add a link to the Assignment Wiki page. Remember to include visual documentation (screenshots, GIFs, etc) Also, please document what did and did not work! What errors did you encounter with Transformers.js?