阿里云工业视觉智能平台使用Quick Start

Step By Step

1、新建工作区

参考链接1

2、创建数据集

参考链接2
测试数据集(Tomato&Cucumber),注意:修改图片名称为英文。

3、数据标注

参考链接3

4、模型训练

参考链接4

5、模型部署
阿里云工业视觉智能平台使用Quick Start

阿里云工业视觉智能平台使用Quick Start

阿里云工业视觉智能平台使用Quick Start

6、模型调用
6.1 pom.xml

  <dependencies>
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-core</artifactId>
      <optional>true</optional>
      <version>[4.3.2,5.0.0)</version>
    </dependency>
    <dependency>
      <groupId>com.google.code.gson</groupId>
      <artifactId>gson</artifactId>
      <version>2.8.5</version>
    </dependency>
    <dependency>
      <groupId>com.aliyun</groupId>
      <artifactId>aliyun-java-sdk-indvi</artifactId>
      <version>1.0.0</version>
    </dependency>
  </dependencies>

6.2 Code Sample

import com.aliyuncs.DefaultAcsClient;
import com.aliyuncs.IAcsClient;
import com.aliyuncs.exceptions.ClientException;
import com.aliyuncs.indvi.model.v20190701.GetDetectionResultRequest;
import com.aliyuncs.indvi.model.v20190701.GetDetectionResultResponse;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.profile.IClientProfile;

public class demo1 {
    private static String detectUrl = "vegetables";
    private static String imageUrl = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1594299310969&di=3e8fb67c14b88ff556a0b6b99f22d2de&imgtype=0&src=http%3A%2F%2Fimg4.imgtn.bdimg.com%2Fit%2Fu%3D321323004%2C3243292509%26fm%3D214%26gp%3D0.jpg";

    public static void main(String[] args) throws ClientException {

        // access_key_id, access_key_secret  获取参考链接:https://yq.aliyun.com/articles/693979?spm=a2c4e.11155435.0.0.319326a2bKJ90g
        String accessKeyID = "LTAIRAcw********";
        String accessKeySecret = "cSyIdKppC2NptI****************";
        String regionId = "cn-hangzhou";
        DefaultProfile.addEndpoint(regionId, regionId, "indvi", "indvi.cn-hangzhou.aliyuncs.com");
        IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyID, accessKeySecret);
        //初始化client
        IAcsClient client = new DefaultAcsClient(profile);

        GetDetectionResultRequest request = new GetDetectionResultRequest();
        request.setDetectPath(detectUrl);
        request.setImageUrl(imageUrl);
        try {
            GetDetectionResultResponse response = client.getAcsResponse(request);
            if (null == response) {
                return;
            }
            if (response.getSuccess() == false) {
                System.out.print(response.toString());
                return;
            }
            String result = response.getResult();
            System.out.print(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

6.3 Result

cucumber

更多参考

模型调用参考
PAI-AutoLearning 图像分类使用教程

上一篇:信息通信大数据产业联盟在京正式成立


下一篇:新一代信息技术产业加速变革 大数据产业迎发展机遇