首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >查找Google Vision API TypeScript定义文件

查找Google Vision API TypeScript定义文件
EN

Stack Overflow用户
提问于 2019-02-15 08:03:30
回答 1查看 649关注 0票数 0

我正在寻找一个Google Vision API TypeScript定义文件,但没有找到任何文件。它们是存在的,还是我必须创建自己的?

EN

回答 1

Stack Overflow用户

发布于 2019-02-19 05:43:46

我已经开始为Google Vision API开发我自己的TypeScript interfaces

这就是我到目前为止所知道的:

代码语言:javascript
运行
复制
/**
 * Interfaces used in Google Vision API results
 */
export interface IPoint2D {
    x: number;
    y: number;
}

export interface IPoint3D {
    x: number;
    y: number;
    z: number;
}

export interface IFaceFeature {
    type: string;
    position: IPoint3D;
}

export interface IVertex2Array {
    vertices: IPoint2D[];
    normalizedVertices?: any;
}

/**
 * Not sure if this is complete
 */
type StringLikelihood = "VERY_UNLIKELY" | "UNLIKELY" | "POSSIBLE" | "LIKELY" | "VERY_LIKELY";

export interface IFaceAnnotation {
    landmark: IFaceFeature[];
    boundingPoly: any[];
    fdBoundingPoly: any[];
    rollAngle: number;
    panAngle: number;
    tiltAngle: number;
    detectionConfidence: number;
    landmarkingConfidence: number;
    joyLikelihood: StringLikelihood;
    sorrowLikelihood: StringLikelihood;
    angerLikelihood: StringLikelihood;
    surpriseLikelihood: StringLikelihood;
    underExposedLikelihood: StringLikelihood;
    blurredLikelihood: StringLikelihood;
    headwearLikelihood: StringLikelihood;
}

export interface ILabelAnnotations {
    locations: any[];
    properties: any[];
    mid: string;
    locale: string;
    description: string;
    score: number;
    confidence: number;
    topicality: number;
    boundingPoly: any;
  }

export interface IApiVisionResponse {
    faceAnnotations: IFaceAnnotation[];
    landmarkAnnotations: any[];
    logoAnnotations: any[];
    labelAnnotations: ILabelAnnotations[];
    textAnnotations: any[];
    localizedObjectAnnotations: any[];
    safeSearchAnnotation: any;
    imagePropertiesAnnotation: any;
    error: any;
    cropHintsAnnotation: any;
    fullTextAnnotation: any;
    webDetection: any;
    productSearchResults: any;
    context: any;
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54700930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档