Skip to main content

No project description provided

Project description

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

[!WARNING] The demos require wget to be installed on your system.

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)

[!TIP] You can also slice your dataset and use a slice for the check instead of the whole dataset.

[!TIP] Class/category based checking is not yet supported, but will be part of the next iteration.

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! 🌚

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

moonwatcher-0.1.0a1.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

moonwatcher-0.1.0a1-py3-none-any.whl (32.4 kB view details)

Uploaded Python 3

File details

Details for the file moonwatcher-0.1.0a1.tar.gz.

File metadata

  • Download URL: moonwatcher-0.1.0a1.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for moonwatcher-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 bfeab9916704d9c7a5e37fb14115a4a3369ca6617fe39ba17f697492c74177b2
MD5 9d902f6df564e68fd5acc6a04fc3a773
BLAKE2b-256 f4a6265bcf8c0c1bfdf83fa1c6a7035c9d1fa5f3969e6c644f7ba752c032bcab

See more details on using hashes here.

File details

Details for the file moonwatcher-0.1.0a1-py3-none-any.whl.

File metadata

  • Download URL: moonwatcher-0.1.0a1-py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.4

File hashes

Hashes for moonwatcher-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff57ad222efda80da1ce6e54085f61d8e1249aa1e559222206e57c81d08a1367
MD5 fddfb883a8cf80aad681c722753cfec8
BLAKE2b-256 e20581dec5b9a95baf91617726489629676318b81e71dfd72f15e8fa729a1163

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page