【问题标题】:Cant Convert Clarifai response to Json无法将 Clarifai 响应转换为 Json
【发布时间】:2018-04-30 08:50:12
【问题描述】:

我刚刚开始使用 clarifai 进行图像分析,但实际上我无法将作为列表获得的输出转换为 Json。 该列表不是普通列表, 我已经尝试过正常的 Gson().toJson 但没有任何效果。 我的请求代码是:

 final PredictRequest<Concept> predictionResults = client.getDefaultModels().generalModel().predict().withInputs(ClarifaiInput.forImage("image url here"));

        List<ClarifaiOutput<Concept>> result = predictionResults.executeSync().get();
        result.get(0);

谁能给点建议....

【问题讨论】:

    标签: java android json clarifai


    【解决方案1】:

    这里是来自 Clarifai 的 Eddie。

    您可以使用response.rawBody() (source) 将原始 JSON 作为字符串获取,但应该能够从列表中的对象中获取所需的一切。还有其他需要支持的吗?

    【讨论】:

      猜你喜欢
      • 2021-09-03
      • 1970-01-01
      • 2019-07-27
      • 1970-01-01
      • 1970-01-01
      • 2011-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多