AICraft Experiment: Image Classifier
Build a web app that uses a Teachable Machine model to classify images from your webcam!
Project Overview
Goal: Create a web app that classifies webcam images using a Teachable Machine model.
Tasks:
- Train an image classification model in Teachable Machine (e.g., cat vs. dog).
- Export the model and get its hosted URL.
- Add Teachable Machine libraries via CDN in the HTML tab.
- Create an HTML UI with a webcam video feed and prediction display.
- Write JavaScript to load the model and show real-time predictions.
Skills Learned: Basic machine learning (training, classification), Teachable Machine, JavaScript (model integration, webcam APIs).
Get Started
Follow these steps to build your image classifier:
- Train: Visit Teachable Machine to train an image model (e.g., classify two objects).
- Export: Export the model and copy its hosted URL.
- Code: Use the OneCompiler editor below, starting from scratch.
- Add Libraries: In the HTML tab, add Teachable Machine CDNs:
<script src="https://cdn.jsdelivr.net/npm/@teachablemachine/image@0.8/dist/teachablemachine-image.min.js"></script>
- UI: In the HTML tab, add a
<video>
for the webcam and a<div>
for predictions. - Logic: In the JavaScript tab, load the model and display predictions.
- Learn: Visit the AICraft course on Xion Apex Academy for tutorials.
- Submit: Share your web app URL for feedback.
Code Workspace
Write your image classifier web app from scratch in the editor below. Use the HTML, CSS, and JavaScript tabs to build your app.
Prefer coding externally? Use Replit or Download Starter Files (includes empty HTML/CSS/JS files).
Submit Your Web App
Once your image classifier is ready, submit the URL (e.g., Replit or GitHub Pages) for feedback or share it on Discord!