Remove unused OCR code

This commit is contained in:
2023-11-17 04:13:54 +08:00
parent 65689e3df5
commit 61aea5c20e
2 changed files with 21 additions and 11 deletions

21
demo.py Normal file
View File

@@ -0,0 +1,21 @@
import pymysql
import pymysql.cursors
from dotenv import dotenv_values
from pprint import pprint
config = dotenv_values(".env")
conn = pymysql.connect(host=config['MYSQL_HOST'], user=config['MYSQL_USER'], password=config['MYSQL_PASSWORD'], database=config['MYSQL_NAME'], cursorclass=pymysql.cursors.DictCursor)
cursor = conn.cursor()
cursor.execute("SELECT * FROM web_images WHERE id=1436682 LIMIT 5")
# 获取查询结果
rows = cursor.fetchall()
for row in rows:
# 格式化打印
pprint(row)
# 关闭游标和连接
cursor.close()
conn.close()

11
main.py
View File

@@ -55,14 +55,3 @@ for row in rows:
# 关闭游标和连接
cursor.close()
conn.close()
'''
from cnocr import CnOcr
img_fp = './x.jpg'
ocr = CnOcr(rec_model_name='ch_PP-OCRv3') # 所有参数都使用默认值
out = ocr.ocr(img_fp)
print(out)
'''