Welcome to our collection of example notebooks for the tlc
Python package! This repository contains various Jupyter
notebooks that demonstrate how to use the tlc
Python package across different scenarios and use cases.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You will need the following tools installed on your system:
- A suitable version of Python (See documentation for supported versions)
- Access to the
tlc
Python package
Clone this repository to your local machine:
# Copy code
git clone https://github.com/3lc-ai/notebook-examples.git
# Navigate to the cloned directory:
cd notebook-examples
# Activate your Python environment (if applicable)
# Open the Jupyter notebook interface:
jupyter notebook
#From the Jupyter interface, open any notebook from the list to get started.
Here's a brief overview of the example notebooks included in this repository:
- MNIST: Train a simple model on the MNIST dataset and collect classification metrics.
- CIFAR-10: Train a model on the CIFAR10 dataset and collect classification metrics.
- Hugging Face IMDB Reviews: Use our Hugging Face
Trainer
integration to train a language model on the IMDB Reviews dataset. - Hugging Face Fine-tuning with BERT: Use our Hugging Face
Trainer
integration to train BERT model on the glue/mrpc dataset. - Hugging Face CIFAR-100: Loads the CIFAR-100 dataset from Hugging Face dataset and computes dimensionality reduced 2D image embeddings.
- Detectron2 Balloons: Trains an object detection model and gathers bounding box metrics with detectron2.
- Detectron2 COCO128: Executes inference and gathers bounding box metrics using detectron2.
- Per Bounding Box Metrics: Describes metric collection for individual bounding boxes in images.
- Per Bounding Box Embeddings: Covers embedding collection for bounding boxes and uses UMAP for dimensionality reduction.
- Bounding Box Classifier: Details an advanced workflow where a model is trained to classify bounding boxes in an image, which can be used in conjunction with an object detection model to find bounding boxes of special interest.
- PyTorch Lightning SegFormer: Demonstrates how to use a custom metrics collector for collecting predicted masks from a semantic segmentation model.
Each notebook is self-contained and declares and installs its required dependencies.
All required data for running the notebooks is either contained in the ./data
folder, or is downloaded from the internet during the notebook execution.
We welcome contributions to this repository! If you have a suggestion for an additional example or improvement, please open an issue or create a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
We use two versions of the Balloons dataset:
Title: Balloons Dataset
Author: Paul Guerrie
Publisher: Roboflow
Year: 2024
URL: Balloons Dataset on Roboflow Universe
Note: Visited on 2024-03-15
Title: Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Author: Waleed Abdulla
Year: 2017
Publisher: Github
URL: Releases
Repository: GitHub repository
We also use the first 128 images from the COCO dataset.