A small wrapper library to help test systems using STAR
Project description
MOdel Test Harness (Moth)
Simple way to interrogate your AI model from a separate testing application
Quickstart
moth server <folder path>
moth client
Simplest possible classification model client
from moth import Moth
from moth.message import ImagePromptMsg, ClassificationResultMsg, HandshakeTaskTypes
moth = Moth("my-ai", task_type=HandshakeTaskTypes.CLASSIFICATION)
@moth.prompt
def on_prompt(prompt: ImagePromptMsg):
# TODO: Do smart AI here
return ClassificationResultMsg(prompt_id=prompt.id, class_name="cat") # Most pictures are cat pictures
moth.run()
Simplest possible object detection model client
from moth import Moth
from moth.message import ImagePromptMsg, ObjectDetectionResultMsg, ObjectDetectionResult, HandshakeTaskTypes
moth = Moth("my-ai", task_type=HandshakeTaskTypes.OBJECT_DETECTION)
@moth.prompt
def on_prompt(prompt: ImagePromptMsg):
# TODO: Do smart AI here
# Make a list of ObjectDetectionResults
l = []
l.append(ObjectDetectionResult(0, 0, 50, 50, class_name="cat", class_index=0, confidence=0.9))
l.append(ObjectDetectionResult(10, 10, 50, 35, class_name="dog", class_index=1, confidence=0.1))
return ObjectDetectionResultMsg(prompt_id=prompt.id, object_detection_results=l)
moth.run()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
starmoth-0.4.1.tar.gz
(7.9 kB
view details)
Built Distribution
File details
Details for the file starmoth-0.4.1.tar.gz
.
File metadata
- Download URL: starmoth-0.4.1.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0bec4cce8ce45436ed7017228aaa216942f5528cfe46a793329fb40847b9a03 |
|
MD5 | 9674847151b5111d50d98b45cb96af96 |
|
BLAKE2b-256 | 3f80e0fa98a511b6e3b5bd6665f944ef70175c0ab571122db9179e0f481aab33 |
Provenance
File details
Details for the file starmoth-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: starmoth-0.4.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96144599574e477df18ae20ef8b362ab72005556535089f2d4a593aa6bcad220 |
|
MD5 | 3bcef2c8607069db7229f5462ad54990 |
|
BLAKE2b-256 | 6ac4562f15a9cc29c9857651791b891797859c16631b493002d88689bb025c26 |