首页 > 其他分享 >植物识别

植物识别

时间:2022-10-28 17:22:30浏览次数:30  
标签:AipImageClassify String 植物 client static KEY 识别 public

package gouzao1;

import java.util.*;
import org.json.JSONObject;
import com.baidu.aip.imageclassify.AipImageClassify;

public class Sample {
    //设置APPID/AK/SK
    public static final String APP_ID = "";
    public static final String API_KEY = "";
    public static final String SECRET_KEY = "";

    public static void main(String[] args) {
        // 初始化一个AipImageClassify
        AipImageClassify client = new AipImageClassify(APP_ID, API_KEY, SECRET_KEY);

        

        // 调用接口
        Sample.sample_plant(client);
        
    }
    
    public static void sample_plant(AipImageClassify client)
    {


    // 传入可选参数调用接口
    HashMap<String, String> options = new HashMap<String, String>();
    options.put("baike_num", "5");
    options.put("top_num", "3");
        
    // 参数为本地路径,在项目中建文件夹
    String image = "img/1.png";
    JSONObject res = client.advancedGeneral(image, options);
    System.out.println(res.toString(2));
    }
}

 

标签:AipImageClassify,String,植物,client,static,KEY,识别,public
From: https://www.cnblogs.com/qiuyutingyyds/p/16836762.html

相关文章