GithubHelp home page GithubHelp logo

productai-java-sdk's Introduction

productai-java-sdk

ProductAI SDK for Java http://productai.cn/

安装

mvn test

快速入门

use image URL to search

    Map<String, String> form = new HashMap<String, String>();
    form.put("request_method", "post");                 // 默认 的请求方法 post
    form.put("service_type", "your_service_type");      // require: 你的服务类型 可在 我的服务-测试服务 页面中查看
    form.put("access_key_id", "your_access_key_id");    // require: 你的用户配置 access_key_id
    form.put("secret_key", "your_secret_key");          // require: 你的用户配置 secret_key
    form.put("service_id", "your_service_id");          // require: 你的服务ID
    form.put("image_url", "your_image_url");            // require: 你的测试图片链接地址
    //form.put("loc", "0-0-1-1");                         // option: (选填)图片标框的位置信息
    
    String response_content = submit_form_to_search(form);
    System.out.println(response_content);

upload image to search

        Map<String, String> form = new HashMap<String, String>();
        Map<String, String> files = new HashMap<String, String>();
        form.put("request_method", "post");                 // 默认 的请求方法 post
        form.put("service_type", "your_service_type");      // require: 你的服务类型 可在 我的服务-测试服务 页面中查看
        form.put("access_key_id", "your_access_key_id");    // require: 你的用户配置 access_key_id
        form.put("secret_key", "your_secret_key");          // require: 你的用户配置 secret_key
        form.put("service_id", "your_service_id");          // require: 你的服务ID
        files.put("search", "some_paths/your_image.jpg");   // require: 你的本地图片的路径
        //form.put("loc", "0-0-1-1");                       // option: (选填)图片标框的位置信息
        //form.put("count", "1");                           // option: (选填) 设置总数限制
        String response_content = submit_file_to_search(form, files);
        System.out.println(response_content);

add a new image to image_set for search

        Map<String, String> form = new HashMap<String, String>();
        form.put("request_method", "post");                 // 默认 的请求方法 post
        form.put("access_key_id", "your_access_key_id");    // require: 你的用户配置 access_key_id
        form.put("secret_key", "your_secret_key");          // require: 你的用户配置 secret_key
        form.put("pai_user_id", "your_user_id");            // require: 你的用户ID
        form.put("image_set_id", "your_image_set_id");      // require: 你的数据集ID
        form.put("image_url", "your_image_url");            // require: 你的测试图片链接
        //form.put("meta", "your_message");                 // option: (选填)附加信息

        String response_content = add_image_to_image_set(form);
        System.out.println(response_content);

delete some images

        Map<String, String> form = new HashMap<String, String>();
        form.put("access_key_id", "your_access_key_id");        // require: 你的用户配置 access_key_id
        form.put("secret_key", "your_secret_key");              // require: 你的用户配置 secret_key
        form.put("pai_user_id", "your_user_id");                // require: 你的用户ID
        form.put("image_set_id", "your_image_set_id");          // require: 你的数据集ID
        form.put("file_path", "some_paths/your_csv_file.csv");  // require: 你的CSV文件的路径
        
        String response_content = delete_image_by_file(form);
        System.out.println(response_content);

add some images

        Map<String, String> form = new HashMap<String, String>();
        form.put("access_key_id", "your_access_key_id");        // require: 你的用户配置 access_key_id
        form.put("secret_key", "your_secret_key");              // require: 你的用户配置 secret_key
        form.put("pai_user_id", "your_user_id");                // require: 你的用户ID
        form.put("image_set_id", "your_image_set_id");          // require: 你的数据集ID
        form.put("file_path", "some_paths/your_csv_file.csv");  // require: 你的CSV文件的路径
        
        String response_content = add_image_by_file(form);
        System.out.println(response_content);

productai-java-sdk's People

Contributors

x-hw avatar wrenchzc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.