Logo
    立即注册
    提交OCR任务
    最近更新时间:2023-01-13 09:27:31
    • 请求示例,以HDFS为例子

      curl -XPOST -H 'Content-Type: application/json' \
      -H 'Authorization: your token here' \
      -d '{
        "inputFileSystemInfo": {
          "fileSystemType": "HDFS"
          "port": "your_hdfs_namenode_httpserver_port",
          "userName": "your_hdfs_userName",
          "host": "your_hdfs_namenode_httpserver_host",
          "spareHost": "your_hdfs_SecondaryNameNode_host",
          "inputPath": "your_input_file_path"
      },
        "outputFileSystemInfo": {
          "fileSystemType": "HDFS"
          "port": "your_hdfs_namenode_httpserver_port",
          "userName": "your_hdfs_userName",
          "host": "your_hdfs_SecondaryNameNode_host",
          "spareHost": "your_hdfs_SecondaryNameNode_host",
          "outputPath": "your_output_path_here"
      },
      "mailAddress": "your email here"
      }' https://open.datastory.com.cn/api/algorithm/ocr/add
    • 请求说明

      • 请求头Authorization的token请联系算法平台同事提供
      • inputFileSystemInfo、outputFileSystemInfo为输入输出文件的信息,详见【使用说明

      • 输入文件是一个csv,id为业务Id,url为需要识别的图片地址,示例文件地址
      • 返回结果:算法任务id,凭此id查询任务状态
      • 结果文件是一个【img2text.json】文件,示例如下:
        {"id": "./test_temp\\7064483669997538597.jpg", "result": "{\"result_detail\": \"[{\\\"text_region\\\": [[66.0, 185.0], [1006.0, 188.0], [1006.0, 284.0], [66.0, 281.0]], \\\"text\\\": \\\"乔欣分享长睫毛的秘密\\\", \\\"confidence\\\": \\\"0.97398806\\\"}, {\\\"text_region\\\": [[259.0, 327.0], [814.0, 327.0], [814.0, 423.0], [259.0, 423.0]], \\\"text\\\": \\\"众人秒被种草\\\", \\\"confidence\\\": \\\"0.9937902\\\"}, {\\\"text_region\\\": [[180.0, 1307.0], [895.0, 1307.0], [895.0, 1352.0], [180.0, 1352.0]], \\\"text\\\": \\\"基本上你用个半个月就差不多\\\", \\\"confidence\\\": \\\"0.99844354\\\"}]\", \"ocr_text\": \"乔欣分享长睫毛的秘密\\r众人秒被种草\\r基本上你用个半个月就差不多\"}"}
        {"id": "./test_temp\\7064492386868645150.jpg", "result": "{\"result_detail\": \"[{\\\"text_region\\\": [[463.0, 255.0], [621.0, 255.0], [621.0, 272.0], [463.0, 272.0]], \\\"text\\\": \\\"JINGJING\\\", \\\"confidence\\\": \\\"0.9358868\\\"}, {\\\"text_region\\\": [[86.0, 287.0], [1019.0, 301.0], [1016.0, 540.0], [82.0, 526.0]], \\\"text\\\": \\\"洗面 奶\\\", \\\"confidence\\\": \\\"0.9720673\\\"}, {\\\"text_region\\\": [[90.0, 1049.0], [377.0, 1049.0], [377.0, 1173.0], [90.0, 1173.0]], \\\"text\\\": \\\"KKV\\\", \\\"confidence\\\": \\\"0.99834824\\\"}, {\\\"text_region\\\": [[54.0, 1304.0], [1012.0, 1301.0], [1013.0, 1545.0], [55.0, 1548.0]], \\\"text\\\": \\\"红黑榜\\\", \\\"confidence\\\": \\\"0.8237774\\\"}]\", \"ocr_text\": \"JINGJING\\r洗面 奶\\rKKV\\r红黑榜\"}"}
        {"id": "./test_temp\\7064474543536065827.jpeg", "result": "{\"result_detail\": \"[{\\\"text_region\\\": [[98.0, 253.0], [121.0, 257.0], [118.0, 273.0], [95.0, 268.0]], \\\"text\\\": \\\"0\\\", \\\"confidence\\\": \\\"0.75386256\\\"}, {\\\"text_region\\\": [[1014.0, 531.0], [1054.0, 531.0], [1054.0, 557.0], [1014.0, 557.0]], \\\"text\\\": \\\"26\\\", \\\"confidence\\\": \\\"0.9963546\\\"}, {\\\"text_region\\\": [[186.0, 952.0], [909.0, 952.0], [909.0, 1125.0], [186.0, 1125.0]], \\\"text\\\": \\\"猫价手膜\\\", \\\"confidence\\\": \\\"0.7826501\\\"}, {\\\"text_region\\\": [[144.0, 1873.0], [173.0, 1873.0], [173.0, 1888.0], [144.0, 1888.0]], \\\"text\\\": \\\"3:05\\\", \\\"confidence\\\": \\\"0.8856176\\\"}]\", \"ocr_text\": \"0\\r26\\r猫价手膜\\r3:05\"}"}
      • 结果文件说明:
        • 每一行为一个图片文本内容的json
        • result为该图片的文本信息,其中result_detail中保存了所有文本行在图片中的坐标位置、该行文本的识别置信度;ocr_text则遵循从上到下、从左到右的顺序对文本进行拼接,以\n为分隔符。

    微信扫描二维码在线咨询