mirror of
https://github.com/photoprism/photoprism.git
synced 2025-12-12 00:34:13 +01:00
Related issues: #5233 (reset command), #5234 (schedule for models) Signed-off-by: Michael Mayer <michael@photoprism.app>
17 lines
552 B
Go
17 lines
552 B
Go
package schema
|
|
|
|
// LabelsDefault provides the minimal JSON schema for label responses used across engines.
|
|
const (
|
|
LabelsDefault = "{\n \"labels\": [{\n \"name\": \"\",\n \"confidence\": 0,\n \"topicality\": 0 }]\n}"
|
|
LabelsNSFW = "{\n \"labels\": [{\n \"name\": \"\",\n \"confidence\": 0,\n \"topicality\": 0,\n \"nsfw\": false,\n \"nsfw_confidence\": 0\n }]\n}"
|
|
)
|
|
|
|
// Labels returns the canonical label schema string.
|
|
func Labels(nsfw bool) string {
|
|
if nsfw {
|
|
return LabelsNSFW
|
|
} else {
|
|
return LabelsDefault
|
|
}
|
|
}
|