This repository contains a Jupyter notebook based tool for interactive, human-in-the-loop classification of geospatial data using the Tessera foundation model embeddings.
The tool allows a user to define an area of interest, visualize the high-dimensional embedding data with PCA, and iteratively train a machine learning model by simply clicking on the map to label.
- Interactive Map Interface: Pan and zoom on a satellite or terrain basemap.
- Data-Driven Visualization: Uses PCA to create a false-color visualization of Tessera embeddings.
- Point-and-Click Training: Simply click on the map to add labeled training points.
- Custom Classes & Colors: Dynamically add new classes and customize their colors with a color picker.
- Live Classification: Train a k-Nearest Neighbors model and classify the map with a click.
- Iterative Refinement: Add more pins to correct mistakes and re-run the classification for immediate (relatively) feedback.
Before installing and running the tool, make sure you have:
- Python – install from python.org (v13 tested)
- Git – Install from git-scm.com
-
Clone the Repository:
git clone https://github.com/ucam-eo/tessera-interactive-map.git cd tessera-interactive-map -
Create and Activate a Virtual Environment:
python -m venv venv source venv/bin/activate -
Install Dependencies: The required packages are listed in
requirements.txt.pip install -r requirements.txt
For jupyter lab, also run
python -m ipykernel install --user --name=venvto register the kernel
Open the cloned repository folder in VS Code or Jupyter Notebook, or whatever else that runs ipynb files.
Using the file browser on the left, find and open the app.ipynb file.
Once the notebook opens, you're ready to begin. Run the top cell to load the required packages and set up the environment.
Run the ROI selector cell. Define your bounding box with the tool by dragging a square.
Click Run to execute the cell below the ROI selector in the notebook. This may take a couple of minutes.
Once processing completes, a map will appear in the notebook.
Use the class selector to pick an existing class or create a new one. You can customize the color using the color palette.
Click directly on the map to place pins for each class. Clicking a pin again will remove it.
Once you’ve added pins from at least two classes, click the Classify button to begin the classification.
After processing, a classification map based on your input will appear. You may iterate on this by adding or removing labels or classes and reclassifying.








