tagger

package
v0.0.0-...-35b844d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseUrl string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseUrl string) *Client

func (*Client) GetInfo

func (c *Client) GetInfo() (*ServiceInfo, error)

func (*Client) GetTaggerState

func (c *Client) GetTaggerState() (*TaggerState, error)

func (*Client) SwitchModel

func (c *Client) SwitchModel(name string) error

func (*Client) TagImage

func (c *Client) TagImage(reader io.Reader, taggerModel string) ([]ImageTag, error)

type ImageTag

type ImageTag struct {
	Tag  string  `json:"tag"`
	Rank float64 `json:"rank"`
}

type ImageTaggerPlugin

type ImageTaggerPlugin struct {
	Client *Client
	Enable bool
}

func NewImageTaggerPlugin

func NewImageTaggerPlugin() *ImageTaggerPlugin

func (*ImageTaggerPlugin) IsEnable

func (i *ImageTaggerPlugin) IsEnable() bool

func (*ImageTaggerPlugin) OnInit

type ResponseWrap

type ResponseWrap[T interface{}] struct {
	Success bool   `json:"success"`
	Error   string `json:"error"`
	Data    T      `json:"data"`
}

type ServiceInfo

type ServiceInfo struct {
	Name    string `json:"name"`
	Success bool   `json:"success"`
}

type TaggerState

type TaggerState struct {
	ModelName string   `json:"modelName"`
	ModelList []string `json:"modelList"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL