API Usage
Overview
This page is Option 2 in the full repository workflow.
It explains the local API path in the full repository context.
If you want the package-only API explanation, use the companion repository:
planktonclas: https://github.com/woutdecrop/planktonclas
When to use this option
Choose Option 2 when you want:
a browser UI for training or prediction
a local DEEPaaS service for integration
the same project assets and outputs as the CLI path, but through HTTP
The DEEPaaS entry point is defined in pyproject.toml:
[project.entry-points."deepaas.v2.model"]
planktonclas = "planktonclas.api"
The simplest way to start the API is:
planktonclas api --config ./my_project/config.yaml
Then open:
http://127.0.0.1:5000/uihttp://127.0.0.1:5000/api#/
Use 127.0.0.1 in the browser. 0.0.0.0 is only the bind address.
Direct DEEPaaS startup
After a repository install, you can also start the API directly:
$env:PLANKTONCLAS_CONFIG = (Resolve-Path .\my_project\config.yaml)
$env:DEEPAAS_V2_MODEL = "planktonclas"
deepaas-run --listen-ip 0.0.0.0
Main API functions
The main public API functions are:
get_metadata()get_train_args()train(**args)get_predict_args()predict(**args)
Training through the API
Typical browser flow:
start
planktonclas api --config ./my_project/config.yamlopen
/uior/api#/find the
TRAINoperationedit the parameters you want
execute the request
The most important training parameters are:
images_directorymodelnameimage_sizebatch_sizeepochsuse_validationuse_testuse_best_model
Important limitation:
images_directoryis a path field, not a browser folder pickerthe API cannot open a server-side folder chooser through Swagger UI
for local use, it is usually better to set the path in
config.yamlbefore starting the API
Prediction through the API
The prediction endpoint accepts:
image: a single uploaded imagezip: a ZIP archive containing one or more images
Typical browser flow:
start the API
open
/uior/api#/find the
PREDICTPOSTmethodclick
Try it outprovide either
imageorzipclick
Execute
Prediction response
The response contains:
filenamespred_labpred_probaphia_idswhen available
Runtime behavior
prediction writes a JSON artifact to the configured predictions directory
ZIP prediction extracts the archive to a temporary directory and scans recursively for images
training validates
images_directorybefore startingif there are no models yet, the API can still be used for training, but not for inference
What comes next
After using Option 2, continue with:
Reference to understand outputs and project structure
planktonclasdocs if you want package-level API detail