修改页面布局

调整执行命令
This commit is contained in:
William Jin 2024-09-26 17:03:11 +08:00
parent ab2446b3e7
commit 31ba144974

View File

@ -178,7 +178,7 @@ def run_ocr(image):
"/home/tmfc/miniconda3/envs/got/bin/python3", "/home/tmfc/apps/got-ocr/GOT/demo/run_ocr_2.0_crop.py", "/home/tmfc/miniconda3/envs/got/bin/python3", "/home/tmfc/apps/got-ocr/GOT/demo/run_ocr_2.0_crop.py",
"--model-name", "/home/tmfc/apps/got-ocr/models/", "--model-name", "/home/tmfc/apps/got-ocr/models/",
"--image-file", image_path, "--image-file", image_path,
">", "/home/tmfc/apps/got-ocr/img.txt" "> /home/tmfc/apps/got-ocr/img.txt"
] ]
try: try:
@ -256,8 +256,8 @@ with gr.Blocks() as iface:
with gr.Row(): with gr.Row():
with gr.Column(): with gr.Column():
image_input = gr.Image(type="pil", label="上传图片") image_input = gr.Image(type="pil", label="上传图片")
btn_recognize = gr.Button("识别")
with gr.Column(): with gr.Column():
btn_recognize = gr.Button("识别")
text_output = gr.Textbox(label="OCR 识别结果") text_output = gr.Textbox(label="OCR 识别结果")
btn_recognize.click(fn=run_ocr, inputs=image_input, outputs=text_output) btn_recognize.click(fn=run_ocr, inputs=image_input, outputs=text_output)