由图AI智能餐饮识别服务
快速入门接口文档
快速入门接口文档
gRPC协议
  • gRPC协议
  • HTTP协议
v1.7.0v1.3.0v1.2.0
v1.7.0v1.3.0v1.2.0
  1. v1.3.0
  • YoYoFoodAi
  1. v1.3.0

YoYoFoodAi

YoYoAiFood 由由AI餐饮识别服务#

Method NameRequest TypeResponse TypeDescription
ExitEmptyParamsPublicReplyExit 应用程序退出
注意事项:
1. 该接口不管是否激活均可调用。
2. 该接口无论在任何场景下务必调用
使用场景:
1. 用于处理SDK的关联资源回收。
2. 应用程序退出前以阻塞方式调用该接口,并等待该接口返回响应结果。
GetVersionEmptyParamsGetVersionReplyGetVersion 获取版本信息
注意事项:
1. 该接口不管是否激活均可调用。
使用场景:
1. 用于检查gRPC的服务状态是否正常。
2. 使用自有服务器管控SDK的升级时,可用于判断版本是否需要升级。
3. 将该信息上传到自有云服务器,可跟踪每台设备使用的SDK版本信息。
4. 返回其他异常状态码时请按需处理业务逻辑。
GetActivateStateEmptyParamsPublicReplyGetActivateState 获取SDK激活状态
注意事项:
1. 该接口不管是否激活均可调用。
使用场景:
1. 使用SDK前先调用该接口检查激活状态。
2. 返回未激活状态码时请调用Activate接口激活SDK。
3. 返回其他异常状态码时请按需处理业务逻辑。
ActivateActivateParamsPublicReplyActivate 激活设备
注意事项:
1. 该接口不管是否激活均可调用。
2. 允许重复激活。
使用场景:
1. 使用SDK前先调用GetActivateState接口检查激活状态。
2. 未激活时请调用该接口激活SDK。
3. 返回其他异常状态码时请按需处理业务逻辑。
GetDeviceInfoEmptyParamsGetDeviceInfoReplyGetDeviceInfo 获取设备信息
注意事项:
1. 该接口不管是否激活均可调用。
使用场景:
1. 获取设备SN、获取设备相关配置信息。
ListenAiMatchResultEmptyParamsListenAiMatchResultReply streamListenAiMatchResult 监听AI识别结果
注意事项:
1. 该接口仅激活后可调用。
2. 该接口类似WebSocket,但只允许调用接口时发送一次数据,服务端会返回多次数据。
使用场景:
1. 程序启动后调用该接口进行长连接,监听SDK返回的识别结果。
RegisterHttpServerRegisterHttpServerParamsPublicReplyRegisterHttpServer 注册客户端实现的HTTP服务
注意事项:
1. 该接口仅激活后可调用。
2. 该接口仅在HTTP对接方式下使用,实现SDK主动向客户端推送数据的功能,免除长连接烦恼。
3. 全局调用一次即可,SDK内部会缓存在内存中。
使用场景:
1. 无法对接ListenAiMatchResult接口,请实现接口:http://winfoodsdk.doc.yoyo.link/api-117803985
AiMatchControlAiMatchControlParamsPublicReplyAiMatchControl AI识别启动(停止)控制
注意事项:
1. 该接口仅激活后可调用。
2. 通过该接口每次启动识别时将会进行一次强制识别。
使用场景:
1. 未检测到目标时可通过传入启动标识执行一次强制识别。
2. 收银时可通过传入停止标识以停止目标检测识别。
3. 收银结束后可通过传入启动标识以启动目标检测识别。
AiMarkAiMarkParamsPublicReplyAiMark AI标记学习
注意事项:
1. 该接口仅激活后可调用。
2. 不可对未框选的目标进行学习。
3. 该接口依赖于ListenAiMatchResult的识别结果
使用场景:
1. 每日菜品做好后售卖前对菜品进行统一学习。
2. 框选的目标无识别结果时,使用该接口对目标进行标记。
3. 标记后的菜品将会自动上架,锁定状态不会变更。
LearnDataFlushEmptyParamsPublicReplyLearnDataFlush 学习数据保存
注意事项:
1. 该接口仅激活后可调用。
2. 将缓存在内存中的学习数据写入到硬盘中,可能会造成磁盘IO瞬时流量大。
使用场景:
1. 所有菜品完成统一学习后,退出学习页面时调用该接口保存学习数据。
LearnDataExportLearnDataExportParamsLearnDataExportReplyLearnDataExport 学习数据导出
注意事项:
1. 该接口仅激活后可调用。
2. 学习数据为空时将会导出失败。
3. 该接口导出的学习数据为ZIP压缩包,学习数据过大时可能会占用较多资源。
使用场景:
1. 需要备份学习数据时可通过该接口导出。
2. 需要分享学习数据时可通过该接口导出。
LearnDataImportLearnDataImportParamsPublicReplyLearnDataImport 学习数据导入
注意事项:
1. 该接口仅激活后可调用。
2. 学习数据为空时将会导入失败。
3. 该接口导入的学习数据为ZIP压缩包,学习数据过大时可能会占用较多资源。
使用场景:
1. 备份学习数据还原时可通过该接口导入。
2. 分享的学习数据可通过该接口导入。
LearnDataClearEmptyParamsPublicReplyLearnDataClear 学习数据清除
注意事项:
1. 该接口仅激活后可调用。
使用场景:
1. 需要重新学习全部菜品时,可调用该接口清除已有的学习数据。
PluDataDeletePluDataDeleteParamsPublicReplyPluDataDelete 商品数据删除
注意事项:
1. 该接口仅激活后可调用。
2. 删除商品数据的同时,关联的学习数据也会一起删除。
3. 该接口为批量接口,无数量限制,建议每次数量控制在1万单品以内。
使用场景:
1. 某些菜品识别效果不好,需要重新学习时,可调用该接口删除指定商品的数据。
PluDataUpdatePluDataUpdateParamsPublicReplyPluDataUpdate 商品数据更新
注意事项:
1. 该接口仅激活后可调用。
2. 该接口为批量接口,无数量限制,建议每次数量控制在1万单品以内。
使用场景:
1. 商品在近期不再销售时,可以下架该商品,以防止误识别输出。
2. 商品为促销品时,可以锁定该商品,以防止误识别输出,锁定商品将无法学习。
PluFeatQueryPluFeatQueryParamsPluFeatQueryReplyPluFeatQuery 商品特征查询
注意事项:
1. 该接口仅激活后可调用。
2. 该接口为批量接口,无数量限制,建议每次数量控制在1万单品以内。
3. 返回的图片数量和特征数量不一定一致,图片仅供有限条件下的学习记录参考。
使用场景:
1. 可查询商品的历史学习图片和特征数量,对每一个商品的学习情况有一个直观的了解。
GetMatchAreaEmptyParamsGetMatchAreaReplyGetMatchArea 获取识别区域
注意事项:
1. 该接口仅激活后可调用。
使用场景:
1. 对有强制要求的场景,如相机拍摄到了超出托盘的区域,可以调用该接口来回显识别区域参数。
SetMatchAreaSetMatchAreaRequestPublicReplySetMatchArea 配置识别区域
注意事项:
1. 该接口仅激活后可调用。
使用场景:
1. 对有强制要求的场景,如相机拍摄到了超出托盘的区域,可以调用该接口来配置识别区域。
GetCameraListEmptyParamsGetCameraListReplyGetCameraList 获取相机列表
【已弃用】:
1. 目前仅支持AI相机,故不再需要调用该接口
注意事项:
1. 该接口不管是否激活均可调用。
2. 可能存在无法获取的相机。
使用场景:
1. 主机存在多个摄像头时,可通过该接口获取相机列表。
2. 打开指定相机时需要通过该接口获取相机ID。
OpenCameraOpenCameraParamsPublicReplyOpenCamera 打开指定相机
【已弃用】:
1. 目前仅支持AI相机,故不再需要调用该接口
注意事项:
1. 该接口不管是否激活均可调用。
2. 可能存在无法打开的相机。
使用场景:
1. 主机存在多个摄像头时,可通过该接口打开指定相机。
Top

YuTooAiFoodDefine.proto#

ActivateParams#

ActivateParams 设备激活【请求体】
FieldTypeLabelDescription
cdKeystring激活码(必填)
shopInfoShopBaseInfo门店信息(选填)

AiMarkParams#

AiMarkParams AI标记学习【请求体】
FieldTypeLabelDescription
aiMatchIDint64识别记录ID(必填,ListenAiMatchResultReply中的ID)
targetIDint64目标ID(必填,TargetInfo中的ID)
pluPluBaseInfo商品信息(必填,将指定目标标记为该商品)
modeAiMarkModeAI标记学习模式

AiMatchControlParams#

AiMatchControlParams AI识别控制【请求体】
FieldTypeLabelDescription
modeAiMatchControlModeAI识别控制模式
disableForceMatchbool启动时是否禁止强制识别

CameraInfo#

CameraInfo 相机信息
FieldTypeLabelDescription
idstring相机ID
namestring相机名称

EmptyParams#

EmptyParams 空请求【请求体】

GetCameraListReply#

GetCameraListReply 获取相机列表【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
cameraIDstring当前正在使用的相机ID
cameraListCameraInforepeated相机列表

GetDeviceInfoReply#

GetDeviceInfoReply 获取设备信息【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
snstring设备SN
shopCodestring门店编码
activateInfoActivateParams激活信息
activateExpireDateuint64激活过期时间(为0时表示不会过期)
diyLogostring自定义LOGO

GetMatchAreaReply#

GetMatchAreaReply 获取识别区域【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
areaMatchAreaInfo区域信息

GetVersionReply#

GetVersionReply 获取版本信息【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
sdkVerstringSDK版本号
identifyModelVerstring识别模型版本号
learningModelVerstring学习模型版本号
cameraLibVerstring相机库版本号

LearnDataExportParams#

LearnDataExportParams 学习数据导出【请求体】
FieldTypeLabelDescription
modeLearnDataExporMode学习数据导出模式(必填)
lastExportTimeint64上一次导出毫秒时间戳(选填,仅模式为NewFeat、NewPlu时需要)

LearnDataExportReply#

LearnDataExportReply 学习数据导出【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
databytes学习数据(zip压缩包) 注意:使用HTTP方式对接时,该字段表现为Base64字符串,eg. Base64(zip)
currExportTimeint64当前导出毫秒时间戳

LearnDataImportParams#

LearnDataImportParams 学习数据导入【请求体】
FieldTypeLabelDescription
modeLearnDataImportMode学习数据导入模式(必填)
databytes学习数据(必填,zip压缩包) 注意:使用HTTP方式对接时,该字段表现为Base64字符串,eg. Base64(zip)

ListenAiMatchResultReply#

ListenAiMatchResultReply 监听识别结果【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
idint64识别记录ID
imagebytes识别图片(JPEG格式) 注意:使用HTTP方式对接时,该字段表现为Base64字符串,eg. Base64(JPEG)
targetListTargetInforepeated目标检测列表

MatchAreaInfo#

MatchAreaInfo 识别区域信息
FieldTypeLabelDescription
takePhotoIntervaluint32拍照间隔毫秒(30 ~1000)(必填)
targetDiffTpruint32目标检测检测灵敏度(10 ~1000)(必填)
topuint32识别区域顶部距离(必填)
bottomuint32识别区域底部距离(必填)
leftuint32识别区域左部距离(必填)
rightuint32识别区域右部距离(必填)
cropbool是否需要裁剪识别区域(必填)

OpenCameraParams#

OpenCameraParams 打开指定相机【请求体】
FieldTypeLabelDescription
cameraIDstring相机ID(必填,CameraInfo中的ID)

PluBaseInfo#

PluBaseInfo 商品基础信息
FieldTypeLabelDescription
codestring商品唯一编码(必填,最大128个字符)
namestring商品名称(必填,最大128个字符)

PluDataDeleteParams#

PluDataDeleteParams 商品数据删除【请求体】
FieldTypeLabelDescription
pluCodeListstringrepeated商品唯一编码列表(必填)

PluDataUpdateParams#

PluDataDeleteParams 商品数据更新【请求体】
FieldTypeLabelDescription
pluStatusListPluStatusInforepeated商品状态信息列表

PluFeatInfo#

PluFeatInfo 商品特征信息
FieldTypeLabelDescription
featNumuint64已学习的特征数量
imagePathListstringrepeated仅供参考的历史学习图片

PluFeatQueryParams#

PluFeatQueryParams 查询商品特征【请求体】
FieldTypeLabelDescription
pluCodeListstringrepeated商品唯一编码列表(必填)

PluFeatQueryReply#

PluFeatQueryReply 查询商品特征【响应体】
FieldTypeLabelDescription
statusPublicReply响应状态
dataPluFeatQueryReply.DataEntryrepeated商品 特征信息映射表

PluFeatQueryReply.DataEntry#

FieldTypeLabelDescription
keystring
valuePluFeatInfo

PluStatusInfo#

PluStatusInfo 商品状态信息
FieldTypeLabelDescription
pluPluBaseInfo商品基础信息
isSalebool商品上下架状态
isLockbool商品锁定状态

PublicReply#

PublicReply 公共响应【响应体】
FieldTypeLabelDescription
codeStatusCode状态码
msgstring状态描述

RegisterHttpServerParams#

RegisterHttpServerParams 注册客户端实现的HTTP服务【请求体】
FieldTypeLabelDescription
hoststringHTTP服务监听IP(选填,默认127.0.0.1)
portuint32HTTP服务监听端口(必填,1~60000)
authSchemestring客户端需要的HTTP服务鉴权类型,Header示例Authorization: authScheme{authToken}(选填)
authTokenstring客户端需要的HTTP服务鉴权Token,Header示例Authorization: authScheme{authToken}(选填)
apiPrefixstring全局API前缀,将会拼接在实际请求接口前,示例:"/yutooai/api"(选填)

SetMatchAreaRequest#

SetMatchAreaRequest 设置识别区域【请求体】
FieldTypeLabelDescription
areaMatchAreaInfo区域信息(必填)

ShopBaseInfo#

ShopBaseInfo 门店基础信息
FieldTypeLabelDescription
namestring门店名称(选填)
contactstring门店联系人(选填)
phonestring联系人电话(选填)

TargetInfo#

TargetInfo 目标信息
FieldTypeLabelDescription
idint64目标ID
xint32相对于识别图片左上角的X坐标
yint32相对于识别图片左上角的Y坐标
widthint32目标检测框宽度
heightint32目标检测框高度
pluListPluBaseInforepeated目标检测推理结果

AiMarkMode#

AiMarkMode AI标记学习模式
NameNumberDescription
Output0Output 在输出结果中选中(默认)
Search1Search 在搜索结果中选中
Fast2Fast 在快捷结果中选中
Study3Study 学习模式专用(该模式会保存图片到本地)

AiMatchControlMode#

AiMatchControlMode AI识别控制模式
NameNumberDescription
Stop0停止识别
Start1启动识别

LearnDataExporMode#

LearnDataExporMode 学习数据导出模式
NameNumberDescription
AllExport0全量导出
NewFeatExport1导出指定时间后的新特征
NewPluExport2导出指定时间后的新商品

LearnDataImportMode#

LearnDataImportMode 学习数据导入模式
NameNumberDescription
AllImport0全量导入(历史数据将会全部被删除)
NewPluImport1新商品导入(商品存在:忽略;商品不存在:新增商品并导入全部特征)
NewFeatImport2新特征合并(商品存在:追加新特征;商品不存在:新增商品并导入全部特征)

StatusCode#

StatusCode 状态码枚举
NameNumberDescription
ErrUnknown0未知异常
Success1正常
ErrParams2参数异常
ErrNotSupport3不支持的操作
ErrNetwork4网络异常
ErrSystemTime5系统时间异常
ErrCamera6相机异常
ErrSetMatchArea7配置识别区域异常
ErrMachineCodeNotFound1000机器码异常
ErrMachinePCINotFound1001PCI网卡被禁用
ErrMachineGetVersion1002机器库版本信息异常
ErrNotActivate1500激活状态异常-未激活
ErrActivateFailed1501激活状态异常-激活失败
ErrActivateExpired1502激活状态异常-激活码已过期
ErrActivateFrozen1503激活状态异常-激活码已冻结
ErrActivateUnknown1504激活状态异常-未知异常
ErrIdentifyModelNotLoad2000识别模型未加载
ErrIdentifyModelNotInit2001识别模型未初始化
ErrIdentifyModelProcess2002识别模型识别出错
ErrIdentifyModelParams2003识别模型传入参数错误
ErrIdentifyModelMemory2004识别模型内存错误
ErrIdentifyModelData2005识别模型数据错误
ErrIdentifyModelCallLogic2006识别模型调用流程错误
ErrIdentifyModelFile2007识别模型文件错误
ErrIdentifyModelKeyEmpty2008识别模型键不存在错误
ErrLearnModelNotLoad2500学习模型未加载
ErrLearnModelNotInit2501学习模型未初始化
ErrLearnModelParams2502学习模型传入参数错误
ErrLearnModelMemory2503学习模型内存错误
ErrLearnModelData2504学习模型数据错误
ErrLearnModelFile2505学习模型文件错误
ErrLearnModelFileEmpty2506学习模型文件为空错误
ErrLearnModeDataExportNotSupport2507学习模型数据导出模式不支持
ErrLearnModeDataImportNotSupport2508学习模型数据导入模式不支持
ErrAiMatchRecordNotFound3000AI识别-记录不存在
ErrAiMatchTargetNotFound3001AI识别-目标不存在

Scalar Value Types#

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)

扫码添加《由图AI智能餐饮识别SDK》微信技术支持

联系技术支持,您获得《由图AI智能餐饮识别SDK》使用上的任何帮助,快速上手让你的研测效率得到大幅提升

扫码加好友
修改于 2023-11-24 06:01:03
Built with