xocrbaidu

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: BSD-3-Clause-Clear Imports: 7 Imported by: 0

Documentation

Overview

百度OCR识图功能SDK

Index

Constants

View Source
const (
	SizeGeneralBasic           = iota // 通用文字识别(标准版)
	SizeGeneral                       // 通用文字识别(标准含位置版)
	SizeAccurateBasic                 // 通用文字识别(高精度版)
	SizeAccurate                      // 通用文字识别(高精度含位置版)
	SizeWebimage                      // 网络图片文字识别
	SizeIdcard                        // 身份证识别
	SizeDrivingLicense                // 驾驶证识别
	SizeVehicleLicense                // 行驶证识别
	SizeBusinessLicense               // 营业执照识别
	SizeLicensePlate                  // 车牌识别
	SizeRequest                       // 表格文字识别-提交请求
	SizeReceipt                       // 通用票据识别
	SizeQrcode                        // 二维码识别【总量,无每天清零】
	SizeHandwriting                   // 手写文字识别
	SizePassport                      // 护照识别【总量,无每天清零】
	SizeVatInvoice                    // 增值税发票识别
	SizeNumbers                       // 数字识别
	SizeBusinessCard                  // 名片识别
	SizeTrainTicket                   // 火车票识别
	SizeTaxiReceipt                   // 出租车票识别
	SizeVinCode                       // VIN码识别
	SizeQuotaInvoice                  // 定额发票识别
	SizeBirthCertificate              // 出生证明识别
	SizeHouseholdRegister             // 户口本识别
	SizeHKMacauExitentrypermit        // 港澳通行证识别
	SizeTaiwanExitentrypermit         // 台湾通行证识别
)

Variables

This section is empty.

Functions

func GetToken

func GetToken() string

获取百度AI中心的token标识

func Regedit

func Regedit(c *Config)

配置项注入

Types

type Config

type Config struct {
	Domain    string               // 百度翻译的域名前缀
	AppId     string               // 百度开发者平台的AppId
	AppKey    string               // 百度开发者平台的AK
	SecretKey string               // 百度开发者平台的密钥信息
	Size      map[int]FreeSizeInfo // 免费次数配置/已使用次数限制
}

百度识图配置项

type FreeSizeInfo

type FreeSizeInfo struct {
	FreeSize   uint64                  // 免费次数
	NowSize    uint64                  // 当前已用次数【每天清零】
	BeyondSize uint64                  // 超出次数
	ExceedStop bool                    // 超出免费翻译字符量以后是否停止翻译
	Func       func(int, FreeSizeInfo) // 次数调整后的回调
}

次数配置、次数回调配置

Jump to

Keyboard shortcuts

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