Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

3 Commits

Folders and files

Repository files navigation

Teachable Machine + p5.js Templates

by Studio Poetics - Quick Prototype & Learning

This directory contains three comprehensive templates for using Google's Teachable Machine with p5.js. Each template is fully documented and ready for students to customize for their own projects.

πŸ“ Available Templates

πŸ–ΌοΈ Image Classification

Classify objects, faces, or scenes from your webcam in real-time.

Perfect for:

  • Object recognition projects
  • Interactive art installations
  • Educational tools
  • Computer vision experiments

Key Features:

  • Real-time webcam classification
  • Customizable confidence thresholds
  • Clean, responsive UI
  • Extensive documentation

Classify sounds, voices, or music from your microphone with stunning visualizations.

Perfect for:

  • Sound-reactive installations
  • Music visualization
  • Voice-controlled interfaces
  • Audio-based games

Key Features:

  • Real-time audio classification
  • Waveform and spectrum visualization
  • Particle effects
  • Volume monitoring

Detect and classify body poses using advanced pose estimation.

Perfect for:

  • Fitness applications
  • Interactive games
  • Gesture control systems
  • Performance art

Key Features:

  • 17-point pose detection
  • Skeleton visualization
  • Real-time pose classification
  • Customizable keypoint display

πŸš€ Quick Start

  1. Choose a template from the folders above
  2. Train your model at Teachable Machine
  3. Update the model URL in the template's script.js file
  4. Customize the response functions for your specific use case
  5. Style the interface to match your project

πŸ“– How to Use

Step 1: Train Your Model

  1. Visit teachablemachine.withgoogle.com
  2. Choose Image, Audio, or Pose project
  3. Create classes and add training data
  4. Train your model
  5. Export and copy the model URL

Step 2: Set Up Template

  1. Copy the appropriate template folder
  2. Open script.js in your editor
  3. Replace YOUR_MODEL_URL_HERE with your actual model URL
  4. Open index.html in a web browser

Step 3: Customize

Each template includes:

  • Detailed code comments explaining every function
  • Customization examples you can uncomment and modify
  • Responsive design that works on desktop and mobile
  • Accessibility features for inclusive design

πŸ› οΈ Technical Requirements

Browser Support

  • Chrome/Edge: Full support
  • Firefox: Full support
  • Safari: Full support (may require user interaction for audio/camera)

Libraries Used

  • p5.js: Creative coding framework
  • TensorFlow.js: Machine learning runtime
  • Teachable Machine: Pre-trained model loader

Hardware Requirements

  • Camera: Required for Image and Pose classification
  • Microphone: Required for Audio classification
  • Modern CPU: For real-time inference

πŸ“š Learning Resources

Teachable Machine

p5.js

Machine Learning

🎨 Project Ideas

Beginner Projects

  • Magic Mirror: Change your appearance based on gestures
  • Sound Garden: Grow plants with different sounds
  • Pose Simon: Memory game using body poses
  • Object Counter: Count and track specific objects

Intermediate Projects

  • Fitness Trainer: AI-powered form correction
  • Music Visualizer: Respond to different music genres
  • Sign Language Translator: Basic gesture recognition
  • Interactive Storytelling: Story changes based on audience

Advanced Projects

  • Multi-modal Installation: Combine all three classification types
  • Real-time Performance: Live performance with AI feedback
  • Accessibility Interface: Computer control through gestures/sounds
  • Educational Assessment: Automated skill evaluation

πŸ”§ Customization Guide

Modifying Responses

Each template includes a respondToClassification() function where you can add your custom logic:

function respondToClassification(prediction) {
    const className = prediction.className;
    const confidence = prediction.probability;
    
    // Add your custom responses here!
    switch(className.toLowerCase()) {
        case 'your_class_name':
            // Your custom code here
            break;
    }
}

Styling

All templates use CSS custom properties for easy theming:

:root {
    --primary-color: #your-color;
    --secondary-color: #your-color;
    /* Customize colors, fonts, spacing, etc. */
}

Adding Features

  • Sound Effects: Use p5.sound library
  • Particle Systems: Create visual effects
  • Data Logging: Track usage and accuracy
  • Multiple Models: Combine different classifications

πŸ› Troubleshooting

Common Issues

Model not loading:

  • Check that the model URL is correct
  • Ensure you've exported your model from Teachable Machine
  • Verify internet connection

Camera/Microphone not working:

  • Check browser permissions
  • Try HTTPS instead of HTTP
  • Ensure hardware is connected and working

Poor classification accuracy:

  • Retrain with more diverse data
  • Check lighting conditions (for image/pose)
  • Reduce background noise (for audio)

Performance issues:

  • Reduce canvas size
  • Increase classification interval
  • Close other browser tabs

Getting Help

  • Check the individual template README files
  • Review browser console for error messages
  • Test with the original Teachable Machine interface
  • Search the p5.js forum for similar issues

🀝 Contributing

These templates are designed to be starting points for learning and creativity. Feel free to:

  • Extend the templates with new features
  • Share your projects and modifications
  • Improve the documentation and examples
  • Report bugs or suggest enhancements

πŸ“„ License

These templates are provided for educational use. Please respect the licenses of the underlying libraries:

  • p5.js: LGPL 2.1
  • TensorFlow.js: Apache 2.0
  • Teachable Machine: Apache 2.0

🌟 Showcase

Created something amazing with these templates? We'd love to see it! These templates have been used to create:

  • Interactive museum installations
  • Accessible computer interfaces
  • AI-powered fitness apps
  • Creative coding workshops
  • Student research projects

πŸ›οΈ About Studio Poetics

Studio Poetics is dedicated to making AI and creative technology accessible through rapid prototyping and hands-on learning. These templates are designed to get you from idea to working prototype as quickly as possible.

Our Philosophy

  • Quick Prototype: Get ideas working fast, iterate rapidly
  • Learning First: Every template is educational and well-documented
  • Creative Focus: Technology serves creativity, not the other way around
  • Open Access: Knowledge should be freely shared and accessible

More Resources

  • Explore more creative coding templates and tutorials
  • Join our community of creative technologists
  • Share your projects and get feedback
  • Learn about emerging AI tools and techniques

Happy coding! πŸŽ‰

Studio Poetics - Where Poetry Meets Technology

Remember: The best way to learn is by experimenting. Don't be afraid to break things, try new ideas, and push the boundaries of what's possible with AI and creative coding.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages