From afdeae1fee30ff7df3719c3f44d2fcddf57d9f5a Mon Sep 17 00:00:00 2001 From: "512song@sina.com" Date: Thu, 9 Feb 2023 07:38:10 +0800 Subject: [PATCH] 20230209 --- 百度OCR.ipynb | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/百度OCR.ipynb b/百度OCR.ipynb index 1e724db..6a9d584 100644 --- a/百度OCR.ipynb +++ b/百度OCR.ipynb @@ -100,11 +100,32 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { + "execution": { + "iopub.execute_input": "2023-01-31T07:25:58.845092Z", + "iopub.status.busy": "2023-01-31T07:25:58.844564Z", + "iopub.status.idle": "2023-01-31T07:26:05.074689Z", + "shell.execute_reply": "2023-01-31T07:26:05.072976Z", + "shell.execute_reply.started": "2023-01-31T07:25:58.845044Z" + }, "tags": [] }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "2 扫描全能王 2023-01-31 15.17_1.jpg\n", + "3 扫描全能王 2023-01-31 15.17_2.jpg\n", + "4 扫描全能王 2023-01-31 15.17_3.jpg\n", + "5 扫描全能王 2023-01-31 15.17_4.jpg\n", + "6 扫描全能王 2023-01-31 15.17_5.jpg\n", + "7 扫描全能王 2023-01-31 15.17_6.jpg\n", + "8 扫描全能王 2023-01-31 15.17_7.jpg\n" + ] + } + ], "source": [ "import os,sys\n", "from aip import AipOcr\n", @@ -137,7 +158,7 @@ "options[\"detect_language\"] = \"true\"\n", "options[\"probability\"] = \"true\"\n", "dict1 = {}\n", - "fi_path = os.getcwd()+'/pic'\n", + "fi_path = os.getcwd()+'/data/pic'\n", "fl = os.listdir(fi_path)\n", "fl.sort()\n", "i = 1\n", @@ -153,7 +174,7 @@ " print(i,fl1)\n", " #print('\\n'.join([w['words'] for w in result['words_result']]))\n", " #print('\\n')\n", - "with open('中华药膳全书学做药膳不生病.json','w') as fl2:\n", + "with open('合同.json','w') as fl2:\n", " json.dump(dict1,fl2,ensure_ascii=False) " ] },