u
This commit is contained in:
1 parent
6ab34e30b4
commit
3b70d0da3b
10 files changed
+106
-3214
No files matched your search
@@ -1,21 +1,12 @@
|
||||
# from paddleocr import PaddleOCR
|
||||
# # 初始化 PaddleOCR 实例
|
||||
# ocr = PaddleOCR(
|
||||
# use_doc_orientation_classify=False,
|
||||
# use_doc_unwarping=False,
|
||||
# use_textline_orientation=False)
|
||||
# # 对示例图像执行 OCR 推理
|
||||
# result = ocr.predict(
|
||||
# input="test1.png")
|
||||
# # 可视化结果并保存 json 结果
|
||||
# for res in result:
|
||||
# res.print()
|
||||
# res.save_to_img("output")
|
||||
# res.save_to_json("output")
|
||||
|
||||
|
||||
|
||||
from paddleocr import PPChatOCRv4Doc
|
||||
import paddle
|
||||
# 检查 PaddlePaddle 是否安装成功
|
||||
# 打印是否支持 GPU
|
||||
print("是否支持 GPU:", paddle.is_compiled_with_cuda())
|
||||
|
||||
# 如果支持,再看看当前是否在使用 GPU
|
||||
if paddle.is_compiled_with_cuda():
|
||||
print("当前是否使用 GPU:", paddle.device.get_device())
|
||||
|
||||
chat_bot_config = {
|
||||
"module_name": "chat_bot",
|
||||
@@ -59,7 +50,7 @@ if use_mllm:
|
||||
|
||||
mllm_predict_res = pipeline.mllm_pred(
|
||||
input="test1.png",
|
||||
key_list=["Gross Weight"],
|
||||
key_list=["Shipper"],
|
||||
mllm_chat_bot_config=mllm_chat_bot_config,
|
||||
)
|
||||
mllm_predict_info = mllm_predict_res["mllm_res"]
|
||||
@@ -73,7 +64,7 @@ vector_info = pipeline.build_vector(
|
||||
visual_info_list, flag_save_bytes_vector=True, retriever_config=retriever_config
|
||||
)
|
||||
chat_result = pipeline.chat(
|
||||
key_list=["Gross Weight"],
|
||||
key_list=["Shipper"],
|
||||
visual_info=visual_info_list,
|
||||
vector_info=vector_info,
|
||||
mllm_predict_info=mllm_predict_info,
|
||||
|
||||
Reference in new issue
Block a user