Documentation ¶
Overview ¶
Package classify encapsulates image classification using TensorFlow.
Copyright (c) 2018 - 2024 PhotoPrism UG. All rights reserved.
This program is free software: you can redistribute it and/or modify it under Version 3 of the GNU Affero General Public License (the "AGPL"): <https://docs.photoprism.app/license/agpl> This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. The AGPL is supplemented by our Trademark and Brand Guidelines, which describe how our Brand Assets may be used: <https://www.photoprism.app/trademark>
Feel free to send an email to hello@photoprism.app if you have questions, want to support our work, or just want to say hello.
Additional information can be found in our Developer Guide: <https://docs.photoprism.app/developer-guide/>
Index ¶
Constants ¶
const ( // data sources SrcAuto = "" SrcManual = "manual" SrcLocation = "location" SrcImage = "image" SrcKeyword = "keyword" )
Variables ¶
var Rules = LabelRules{}/* 1075 elements not displayed */
Functions ¶
This section is empty.
Types ¶
type Label ¶
type Label struct { Name string `json:"label"` // Label name Source string `json:"source"` // Where was this label found / detected? Uncertainty int `json:"uncertainty"` // >= 0 Priority int `json:"priority"` // >= 0 Categories []string `json:"categories"` // List of similar labels }
Label represents a MediaFile label (automatically created).
func LocationLabel ¶
LocationLabel returns a new location label.
type LabelRules ¶
LabelRules is a map of rules with label name as index
type Labels ¶
type Labels []Label
Labels is list of MediaFile labels.
func (Labels) AppendLabel ¶
AppendLabel extends append func by not appending empty label
type TensorFlow ¶
type TensorFlow struct {
// contains filtered or unexported fields
}
TensorFlow is a wrapper for tensorflow low-level API.
func New ¶
func New(modelsPath string, disabled bool) *TensorFlow
New returns new TensorFlow instance with Nasnet model.
func (*TensorFlow) File ¶
func (t *TensorFlow) File(filename string) (result Labels, err error)
File returns matching labels for a jpeg media file.
func (*TensorFlow) Init ¶
func (t *TensorFlow) Init() (err error)
Init initialises tensorflow models if not disabled
func (*TensorFlow) Labels ¶
func (t *TensorFlow) Labels(img []byte) (result Labels, err error)
Labels returns matching labels for a jpeg media string.
func (*TensorFlow) ModelLoaded ¶
func (t *TensorFlow) ModelLoaded() bool
ModelLoaded tests if the TensorFlow model is loaded.