标准模型测试失败

比赛 ml10815 ⋅ 于 3个月前 ⋅ 最后回复由 xjohnny 3个月前 ⋅ 356 阅读

https://cvmart.net/storage/test_terminal_log/3687.html
用的Demo 只把行人改成了 mask

回复数量: 6
  • process image接口返回的内容必须是json格式的字符串,需要更改一下

    3个月前
    • @Allen
      @Allen file:///F:/360MoveData/Users/Administrator/Desktop/IZU59O%6095_2~U%7BOEZ1SR7)D.png 您好,改成这样还是一样报错了[图片]

      3个月前
    • @Allen detect_objs = []
      for k, score in enumerate(scores):
      label = np.int(classes[k])
      if label not in label_id_map:
      log.warning(f'{label} does not in {label_id_map}')
      continue
      ymin, xmin, ymax, xmax = boxes[k]
      detect_objs.append('{"objects": [{"name": label_id_map[label], "xmin": int(xmin),"ymin": int(ymin), "xmax": int(xmax),"ymax": int(ymax)}]}')
      return json.dumps(detect_objs)

      3个月前
      • @ml10815 格式错了:

        detect_objs.append('{"objects": [{"name": label_id_map[label], "xmin": int(xmin),"ymin": int(ymin), "xmax": int(xmax),"ymax": int(ymax)}]}')

        用这个:

        detect_objs.append({"name": label_id_map[label], "xmin": int(xmin),"ymin": int(ymin), "xmax": int(xmax),"ymax": int(ymax)}')
        return json.dumps({"objects": detect_objs})
        3个月前
        • @Allen 2020-06-10 05:09:25,530 - root - INFO - {
          "data": {
          "json_params_filename": "/test-tmp/3687-1591765735N5jf.json",
          "original_data": {}
          },
          "code": 1048576,
          "msg": "list indices must be integers or slices, not str"
          }
          2020-06-10 05:09:25,589 - requests.packages.urllib3.connectionpool - INFO - Starting new HTTP connection (1): eagle-nest-backend-service.default.svc.cluster.local
          改了。后面还是有这个报错

          3个月前 1
  • 上面官方的回答最后多打了个引号,去掉就行了,append后面接{}不是字符串,具体如下
    detect_objs.append({"name": label_id_map[label], "xmin": int(xmin),"ymin": int(ymin), "xmax": int(xmax),"ymax": int(ymax)})
    return json.dumps({"objects": detect_objs})

    3个月前
您需要登陆以后才能留下评论!