图普科技-图像识别云服务 Java API https://www.tuputech.com/
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings add uid Jul 13, 2017
examples update CID Jan 9, 2018
libs add tuputech api Sep 2, 2016
src/com/tuputech/api update CID Jan 9, 2018
.classpath add profile Jul 13, 2017
.gitignore add uid Jul 13, 2017
.project add profile Jul 13, 2017
README.md fix Jul 13, 2017

README.md

图普科技 # Tuputech SDK For Java 图普科技-图像识别云服务 Java API https://www.tuputech.com/

#使用方法

###账户申请,证书下载

  • 请联系图普售前/客户支持,明确需求,以便申请账户、申请开通secretId;
  • 登录后,参考此说明生成并上传公钥;

###目录介绍

examples/  				 
		libs/tupuApi.jar   //图普 API SDK ,已集成json 解析 jar
        src/com/soap/api/APITest.java  //调用示例
        
libs/					 //json 解析jar
	commons-beanutils-1.8.0.jar
	commons-collections-3.2.1.jar
	commons-lang-2.5.jar
	commons-logging-1.2.jar
	ezmorph-1.0.6.jar
	json-lib-2.4-jdk15.jar
    
src/					
	com/tuputech/api				     // SDK 源码
	open_tuputech_com_public_key.pem	//图普公钥,验证返回结果

###API调用示例

public class APITest {

	public static void main(String[] args) {
		// secret id
		String secretId = "";
		// private KEY path
		String privateKey = "";
		// request Url
		String requestUrl = "http://api.open.tuputech.com/v3/recognition/";
		// fileList imageFile or url
		ArrayList<String> fileLists = new ArrayList<String>();
		// tags
		String tags[] = { "tag1", "tag2" };
		fileLists.add("../test1.jpg");
		fileLists.add("../test2.jpg");
		// options
		Options options = new Options();
		options.setTags(tags);
		// options.setUid("your_uid"); // 第三方客户标识
      /**
    	 * @param secretId
    	 *            用户secretId
    	 * @param privateKey
    	 *            用户私钥路径
	 * @param requestUrl
	 *            请求接口地址
  	 */
		Api api = new Api(secretId, privateKey, requestUrl);
      /**
    	 * @param fileType
    	 *            传入的数据类型,ConfigUtil.UPLOAD_TYPE.UPLOAD_IMAGE_TYPE为本地文件
    	 *            ConfigUtil.UPLOAD_TYPE.UPLOAD_URI_TYPE 为图片 Url
    	 * @param fileLists
    	 *            文件集合(本地文件路径或者 Url)
    	 * @param options
    	 *            可选参数
    	 *            tags: 用于给图片附加额外信息(比如:直播客户可能传房间号,或者主播ID信息)。方便后续根据tag搜索到相关的图片
	 	 *            uid: 作为第三方客户标识
    	 * @return
    	 */
		JSONObject result = api.doApiTest(ConfigUtil.UPLOAD_TYPE.UPLOAD_IMAGE_TYPE, fileLists, options);
	}
}

#API说明 ###construct a TUPU API instance

Api api = new Api(secretId, privateKey, requestUrl);
JSONObject result = api.doApiTest(fileType,fileList,options)
  • fileType Type:String, ConfigUtil.UPLOAD_TYPE.UPLOAD_IMAGE_TYPE or ConfigUtil.UPLOAD_TYPE.UPLOAD_URI_TYPE
  • fileList Type:ArrayList,images path or urls list
  • options Type:Object, optional param. tags: [ 'tag1', 'tag2' ] tag of image (optional); string value as general tag for all files; if count of tags is less than count of files, the last tag will be used for the rest. uid: as third party customer identification.