baidu

package
v1.8.101 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: Zlib Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ApiPrefixUrl = "https://aip.baidubce.com"

Variables

This section is empty.

Functions

func GetAccessToken

func GetAccessToken(tk token.Token, d data.D) (access.Token, error)

func GetService added in v1.0.28

func GetService() token.Service

func NewToken

func NewToken(app token.App) token.Token

Types

type AccessToken

type AccessToken struct {
	AcsToken    string `json:"access_token"`
	RefToken    string `json:"refresh_token"`
	AcsExpireIn int64  `json:"expires_in"`
}

func (AccessToken) GetAccessToken

func (a AccessToken) GetAccessToken() access.Value

func (AccessToken) GetRefAccessToken

func (a AccessToken) GetRefAccessToken() access.Value

type PersonInfo

type PersonInfo struct {
	Height float64 `json:"height"`
	Width  float64 `json:"width"`
	Left   float64 `json:"left"`
	Top    float64 `json:"top"`
	Score  float64 `json:"score"`
}

type PersonResult

type PersonResult struct {
	LabelMap   string       `json:"labelmap"`
	ScoreMap   string       `json:"scoremap"`
	ForeGround string       `json:"foreground"`
	PersonNum  int          `json:"person_num"`
	PersonInfo []PersonInfo `json:"person_info"`
}

type Response

type Response struct {
	Code int32  `json:"error"`
	Msg  string `json:"error_description"`
}

func (Response) ErrorIf added in v1.2.8

func (r Response) ErrorIf() error

func (Response) ReturnIf

func (r Response) ReturnIf(api *token.Api) error

type Response2

type Response2 struct {
	Code int32  `json:"error_code"`
	Msg  string `json:"error_msg"`
}

func (Response2) ErrorIf added in v1.2.8

func (r Response2) ErrorIf() error

func (Response2) ReturnIf

func (r Response2) ReturnIf(api *token.Api) error

type Words

type Words struct {
	Words string `json:"words"`
}

type WordsResult

type WordsResult struct {
	Words    []Words `json:"words_result"`
	WordsLen int     `json:"words_result_num"`
}

func AccurateBasic

func AccurateBasic(api *token.Api, d data.D) (*WordsResult, error)

AccurateBasic 通用文字识别(高精度版) https://ai.baidu.com/ai-doc/OCR/1k3h7y3db

func GeneralBasic

func GeneralBasic(api *token.Api, d data.D) (*WordsResult, error)

GeneralBasic 通用文字识别(标准版) https://ai.baidu.com/ai-doc/OCR/zk3h7xz52

Jump to

Keyboard shortcuts

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