Tencent AI SDK in golang

Time:2020-2-27

Tencent AI SDK

Tencent AI Development Platform SDK

Open source address: https://github.com/shiguanghu

Tencent AI interface call is relatively simple, the call process can be simplified through this library, and the return value is the structure for easy use.
Developers can call interfaces like local functions without considering signature and data request

Example

package main

import (
    "encoding/json"
    "log"

    "GitHub. COM / shiguanghuxian / txai" // introduction of SDK
)

func main() {
    //System log display file and line number
    log.SetFlags(log.Lshortfile | log.LstdFlags)
    //Create SDK operation object
    txAi := txai.New("appid", "appkey", true)
    //Call the corresponding function of Tencent AI interface
    val, err := txAi.ImageFoodForPath("../../img/image_terrorism.jpg")
    //Print results
    log.Println(err)
    js, _ := json.Marshal(val)
    log.Println(string(js))
}

Remarks

Because some interfaces of Tencent AI use GBK format, this SDK has automatically converted the format, so it is unnecessary to consider the coding problem when using it.

Recommended Today

Go carbon version 1.2.0 has been released to improve and optimize the multi scenario support for orm

Carbon is a lightweight, semantic and developer friendly golang time processing library, which supports chain call, lunar calendar, Gorm, xorm and other mainstream orm If you think it’s good, please give it to a star github:github.com/golang-module/carbon gitee:gitee.com/go-package/carbon Installation and use //Using GitHub Library go get -u github.com/golang-module/carbon import ( “github.com/golang-module/carbon”) //Using gitee Library go get […]