Model Deployment
Testing a model in the Model Playground
Drop in a model file you downloaded from Deployment and try it on your own images, sounds or sensor data, without changing any project.
Try it in StudioOn this page
Goal
By the end of this page you will know how to test an exported model on new data in the Model Playground, read its result, and test a whole folder of images at once.
The Playground works with any model file you have, from any of your projects. It never changes a project: the model stays in a private session for 2 hours and is then deleted.
Open the Playground
- From the Dashboard, select Open Playground on the Model Playground card.
- From Deployment, after a build finishes, select Test in Playground next to Download Latest Build.
Load a model
- Drop the model file on Drop a Petal Edge model to test it, or click it to choose the file.
- Use the Linux (.pe) or PXE (.pxe) file from Deployment. These packages contain the model, its labels and its processing settings, so the Playground knows exactly how to run it.
- The Model card shows what the file is: the kind of data (Image, Audio, Motion), the task, the input size, the labels, and a Verified package badge when the file's checksum matches.
A file can be up to 250 MB, which includes face recognition packages. If yours is bigger, build it again with Quantized (int8) precision (see Choosing Float32 or INT8). Large models need a lot of memory on the server, so if the server is busy loading another one, or short of memory, you see a message to try again in a few minutes.
Choose a source and see the result
The Source row shows every kind of input. The ones your model can use are active; the others say Not for this model.
| Model | Sources you can use |
|---|---|
| Image (classification, object detection, regression, visual anomaly) | Image (drop or choose a file), Paste (from the clipboard), Webcam (a snapshot or live) |
| Audio | Audio (a WAV file, a recording, or live from the microphone) |
| Motion | Motion (a CSV or JSON file of sensor values) or Paste (sensor values as CSV) |
| Motion with camera landmarks | Webcam (your hand or body is tracked in the browser; only the landmark numbers are sent) |
The result appears in the Result area as soon as the input arrives: the top label and its score, boxes drawn on the picture for detection models, or a heat map for visual anomaly models. Each run is kept under Recent, so you can go back to it.
Open Details under the result to:
- change the Confidence threshold of a detection model, or the Anomaly threshold of a visual anomaly model, then select Re-run (or press Ctrl+Enter, ⌘+Enter on a Mac),
- see the raw scores, the time each step took, and the input size the model uses.
The Playground runs your model on Petal Edge servers with the same processing as Live classification, so timings differ from those on your device.
Test a folder of images
For image models, you can test many pictures at once and get an accuracy score.
- Select the Image source, then Folder.
- Put each picture in a folder named after the label it should get. For example,
test/cat/1.jpgandtest/dog/7.jpgfor a model with the labelscatanddog. A file name that starts with the label works too, such asdog.42.jpg. - Select Choose folder (or Choose images), or drop the folder on the panel. Up to 500 images are tested, two at a time. Select Stop to pause and Continue to go on.
- Read the results:
- Accuracy: the share of pictures that got the label of their folder.
- Batch metrics: precision, recall and F1 score, overall and for each label (see Evaluation metrics).
- The table lists every picture with its expected and predicted label. Select a row, or choose it under Show a tested image, to see that picture and its result in the Result area.
- Select Export CSV to save the results as a spreadsheet.
For a visual anomaly model, name the folders normal and anomaly (or good and defect). For object detection and regression models, each picture's result is listed without an accuracy score.
Test a raw .tflite file (basic mode)
A .tflite file on its own has no labels or image settings. The Playground can still test it if it is an image classifier:
- Drop the
.tflitefile. The Basic mode card shows the image size the model takes and how many scores it outputs. - Under Labels, type one label per line, in the order the model outputs its scores. You need exactly as many labels as scores.
- Choose how images are resized (Crop, Fit or Squash), which Pixel values the model expects (Petal Edge models use 0 to 1), and the Colour order.
- Select Test in basic mode. All image sources now work, and you can change these settings later with Edit settings.
Results in basic mode use the settings you typed, not the ones the model was trained with. When you have the package from Deployment, test that instead.
Good to know
- Replace model loads another file and runs your current input again on it. Remove ends the session at once.
- After 2 hours without use the session ends; drop the file again to continue.
- Your model, pictures and recordings are never added to a project or saved.
- Arduino, ESP32 and C++ library zips contain source code, not a runnable model, so they can't be tested here. Use the Linux (.pe) or PXE package instead.
- A face recognition package (the file you download for a face model) loads as one model: choose an image source, and the result shows a box and a name for each enrolled person it recognises. Use the Match threshold under Details to make matching stricter or looser.