Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Logo Moonwatcher

The Evaluation & Testing framework for Computer vision models

Control performance risks, bias and security issues in AI models

License Moonwatcher on Discord

Install Moonwatcher 🌝

pip install moonwatcher

Try the demos

In the demo the performance of a model on unusual values for brightness, contrast and saturation of the underlying dataset are checked. To see how to create your own specific test scenarios check out Quickstart.

Object detection (the demo will download the val2017 set of COCO and use a subset of it):

python -m moonwatcher.demo_detection

Classification (the demo will download STL-10 as a dataset):

python -m moonwatcher.demo_classification

Contents

🏃‍♀️ Quickstart

1. 🧑‍🏫 Slices, Checks and Checksuites

There are three core concepts (apart from models and datasets) to this framework. These concepts are called Checks, Checksuites and Slices.

Slices

A slice is a subset of a dataset. There are different methods in the framework to create those subsets for sophisticated evaluation and testing setups.

Checks

A check is defining one specific evaluation and/or testing setups. It defines the metric used, the dataset or slice to evaluate/test on and optionally the test comparison. When a check is applied on a specific model it returns the evaluation calculated and optionally the testing result (True/False).

Checksuites

A checksuite combines multiple checks into one. It is a suite of checks as the name suggests.

2. 🤖 Run automated checks

Look into the relevant demo (demo_classification.py or demo_detection.py) to see how to create the MoonwatcherModel and MoonwatcherDataset from your data.

from moonwatcher.check import automated_checking
from moonwatcher.model.model import MoonwatcherModel
from moonwatcher.dataset.dataset import MoonwatcherDataset

# Your model (your_model) and dataset (your_dataset) loading somewhere

# Look into the relevant demo (demo_classification.py or demo_detection.py)
# to see how to create the MoonwatcherModel and MoonwatcherDataset from your data.
mw_model = MoonwatcherModel(
  model=your_model,
  ...
)
mw_dataset = MoonwatcherDataset(
  dataset=your_dataset,
  ...
)

automated_checking(model=mw_model, dataset=mw_dataset)  

3. 👨‍💻 Write custom checks and checksuites

Writing a custom check works like this.

from moonwatcher.check import Check

accuracy_check = Check(
    name="AccuracyCheck",
    dataset_or_slice=mw_dataset,
    metric="Accuracy",
    operator=">",
    value=0.8,
)

# and run it on your model:
check_result = accuracy_check(mw_model)

Now adding another check and combining both into a checksuite

from moonwatcher.check import Check, CheckSuite

precision_check = Check(
    name="PrecisionCheck",
    dataset_or_slice=mw_dataset,
    metric="Precision",
    operator=">",
    value=0.8,
)

# Combine them into a checksuite
first_checksuite = CheckSuite(
    name="AllChecks", checks=[accuracy_check, precision_check]
)

# and run it on your model:
checksuite_result = first_checksuite(mw_model)

🖥️ Web app

The package can be used on its own, is open-source and will always be. We additionally developed a web app you can use to visualize results in a nice way. To try it out, check out

Web app instructions.

⭐️ Don’t forget to star the project if you want to support open source testing of ML models.

That's it. Have fun! 🌚

Metadata

Release files for moonwatcher 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for moonwatcher 0.1.0a1
File Size Uploaded
moonwatcher-0.1.0a1.tar.gz 27.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for moonwatcher 0.1.0a1
File Interpreter ABI Platform
moonwatcher-0.1.0a1-py3-none-any.whl Python 3 none any Details

Total release size: 59.4 kB

Release files / moonwatcher-0.1.0a1.tar.gz

Download URL moonwatcher-0.1.0a1.tar.gz
Size 27.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bfeab9916704d9c7a5e37fb14115a4a3369ca6617fe39ba17f697492c74177b2
BLAKE2b-256 checksum
How to use checksums
f4a6265bcf8c0c1bfdf83fa1c6a7035c9d1fa5f3969e6c644f7ba752c032bcab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release files / moonwatcher-0.1.0a1-py3-none-any.whl

Download URL moonwatcher-0.1.0a1-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ff57ad222efda80da1ce6e54085f61d8e1249aa1e559222206e57c81d08a1367
BLAKE2b-256 checksum
How to use checksums
e20581dec5b9a95baf91617726489629676318b81e71dfd72f15e8fa729a1163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.4

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page