Skip to content

Commit

Permalink
Merge pull request #53 from breezedeus/dev
Browse files Browse the repository at this point in the history
remove useless param
breezedeus authored Jan 10, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 6285d4d + b23c1d7 commit 14df65e
Showing 3 changed files with 3 additions and 19 deletions.
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -462,11 +462,7 @@ Usage: p2t predict [OPTIONS]
Use Pix2Text (P2T) to predict the text information in an image
Options:
--use-analyzer / --no-use-analyzer
Whether to use MFD (Mathematical Formula
Detection) or Layout Analysis [default:
use-analyzer]
-l, --languages TEXT Languages for Text-OCR to recognize,
-l, --languages TEXT Language Codes for Text-OCR to recognize,
separated by commas [default: en,ch_sim]
-a, --analyzer-name [mfd|layout]
Which Analyzer to use, either MFD or Layout
3 changes: 0 additions & 3 deletions README_cn.md
Original file line number Diff line number Diff line change
@@ -497,9 +497,6 @@ $ p2t predict -h
使用 Pix2Text (P2T) 来预测图像中的文本信息

选项:
--use-analyzer / --no-use-analyzer
是否使用 MFD (数学公式检测) 或版面分析 [默认:
use-analyzer]
-l, --languages TEXT Text-OCR 识别的语言代码序列,以逗号分隔 [默认: en,ch_sim]
-a, --analyzer-name [mfd|layout]
使用哪个分析器,MFD 或版面分析 [默认: mfd]
13 changes: 2 additions & 11 deletions pix2text/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# coding: utf-8
# Copyright (C) 2022-2023, [Breezedeus](https://www.breezedeus.com).
# Copyright (C) 2022-2024, [Breezedeus](https://www.breezedeus.com).

import os
import logging
@@ -12,7 +12,6 @@
import click

from pix2text import set_logger, Pix2Text, merge_line_texts
from pix2text.consts import LATEX_CONFIG_FP

_CONTEXT_SETTINGS = {"help_option_names": ['-h', '--help']}
logger = set_logger(log_level=logging.INFO)
@@ -24,18 +23,12 @@ def cli():


@cli.command('predict')
@click.option(
"--use-analyzer/--no-use-analyzer",
default=True,
help="Whether to use MFD (Mathematical Formula Detection) or Layout Analysis",
show_default=True,
)
@click.option(
"-l",
"--languages",
type=str,
default='en,ch_sim',
help="Languages for Text-OCR to recognize, separated by commas",
help="Language Codes for Text-OCR to recognize, separated by commas",
show_default=True,
)
@click.option(
@@ -124,7 +117,6 @@ def cli():
show_default=True,
)
def predict(
use_analyzer,
analyzer_name,
analyzer_type,
analyzer_model_fp,
@@ -178,7 +170,6 @@ def predict(
analysis_res = save_analysis_res[idx] if save_analysis_res is not None else None
out = p2t.recognize(
fp,
use_analyzer=use_analyzer,
resized_shape=resized_shape,
save_analysis_res=analysis_res,
**rec_kwargs,

0 comments on commit 14df65e

Please sign in to comment.