Project Overview

Tea Pot or Not is a fun Flask API project that uses machine learning to detect whether an uploaded image contains a teapot, coffee machine, or neither. The project was inspired by the HTTP 418 "I'm a teapot" status code and the Save 418 Movement, celebrating one of the internet's most beloved easter eggs.

Rather than building a grand machine learning project from scratch, I focused on creating something enjoyable that implements the Hyper Text Coffee Pot Control Protocol (HTCPCP/1.0) in a practical way. The API returns appropriate HTTP status codes based on what it detects in your image.

How It Works

Upload an image to the API, and it will respond with one of three messages:

  • 418 I'm a teapot - When a teapot is detected
  • 200 Here's your coffee - When a coffee machine is detected
  • 200 I'm not a teapot - When neither is detected

The HTTP 418 Legacy

This project was born from discovering that some developers wanted to remove the HTTP 418 status code to make space for "more useful" codes. After finding the Save 418 Movement and seeing that even Google implements it, I knew I had to contribute to preserving this piece of internet history.

Technical Implementation

The project leverages a pre-trained YOLO (You Only Look Once) model from Ultralytics, which was trained on the Open Images V7 dataset containing millions of annotated images.

Architecture

  • Backend: Flask API for handling image uploads and processing
  • Machine Learning: Ultralytics YOLO model for object detection
  • Dataset: Pre-trained on Open Images V7 public domain dataset
  • Protocol: Implements HTCPCP/1.0 with proper 418 status codes

API Endpoints

The API accepts BREW/POST requests with image files and returns JSON responses with appropriate HTTP status codes based on the detected objects.

Machine Learning Approach

Instead of training a custom model, I opted to use a state-of-the-art pre-trained YOLO model. This approach allowed for rapid development while still achieving excellent object detection accuracy for teapots and coffee machines.

Learning & Impact

While this project may seem simple at under 100 lines of code, it provided valuable learning experiences and sparked deeper interests in machine learning.

Key Learnings

  • Machine Learning Basics: Hands-on experience with pre-trained models and object detection
  • API Design: Creating RESTful endpoints that follow HTTP protocol standards
  • Internet History: Deep dive into HTCPCP/1.0 and the significance of HTTP 418
  • Rapid Prototyping: Building functional applications quickly with existing tools
  • Community Engagement: Contributing to internet culture preservation movements

Future Inspiration

This project served as a gateway to machine learning concepts and sparked interest in building more sophisticated ML applications in the future. It demonstrated that learning doesn't always require massive, complex projects - sometimes small, focused implementations can be just as valuable.

Save 418 Movement

By implementing a practical use case for the HTTP 418 status code, this project contributes to the preservation of internet culture and the whimsical aspects of web protocols that make development more enjoyable.

Code & Repository

The complete source code is available on GitHub, showcasing a clean and simple implementation that prioritizes clarity and functionality over complexity.

Repository Features

  • Clean Codebase: Under 100 lines of well-documented Python code
  • Easy Setup: Simple installation and deployment instructions
  • API Documentation: Clear examples of request/response formats
  • Dependencies: Minimal external dependencies for easy maintenance

The project demonstrates that effective solutions don't always require complex architectures - sometimes the best approach is to leverage existing tools creatively to solve interesting problems.