Sponsored by
Vmake Labs Video Enhancer
-Vmake Labs Video Enhancer uses AI to improve video quality, restore details, reduce blur, and upscale videos to 8K.
The Table Classification Module is a key component in computer vision systems, responsible for classifying input table images. The performance of this module directly affects the accuracy and efficiency of the entire table recognition process. The Table Classification Module typically receives table images as input and, using deep learning algorithms, classifies them into predefined categories based on the characteristics and content of the images, such as wired and wireless tables. The classification results from the Table Classification Module serve as output for use in table recognition pipelines. The key metrics are as follow:
Model
Top1 Acc(%)
GPU Inference Time (ms)
[Regular Mode / High-Performance Mode]
CPU Inference Time (ms)
[Regular Mode / High-Performance Mode]
Model Storage Size (M)
PP-LCNet_x1_0_table_cls
94.2
2.35 / 0.47
4.03 / 1.35
6.6M
Installation
PaddlePaddle
Please refer to the following commands to install PaddlePaddle using pip:
# for CUDA11.8
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
# for CUDA12.6
python -m pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
# for CPU
python -m pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
You can also integrate the model inference of the table classification module into your project. Before running the following code, please download the sample image to your local machine.
from paddleocr import TableClassification
model = TableClassification(model_name="PP-LCNet_x1_0_table_cls")
output = model.predict("mabagznApI1k9R8qFoTLc.png", batch_size=1)
for res in output:
res.print(json_format=False)
res.save_to_json("./output/res.json")
res.save_to_img("./output/res.png")
For details about usage command and descriptions of parameters, please refer to the
Document
.
Pipeline Usage
The ability of a single model is limited. But the pipeline consists of several models can provide more capacity to resolve difficult problems in real-world scenarios.
General Table Recognition V2 Pipeline
The general table recognition V2 pipeline is used to solve table recognition tasks by extracting information from images and outputting it in HTML or Excel format. And there are 8 modules in the pipeline:
If save_path is specified, the visualization results will be saved under
save_path
. The visualization output is shown below:
The command-line method is for quick experience. For project integration, also only a few codes are needed as well:
from paddleocr import TableRecognitionPipelineV2
pipeline = TableRecognitionPipelineV2(
use_doc_orientation_classify=False, # Use use_doc_orientation_classify to enable/disable document orientation classification model
use_doc_unwarping=False, # Use use_doc_unwarping to enable/disable document unwarping module
)
# pipeline = TableRecognitionPipelineV2(use_doc_orientation_classify=True) # Specify whether to use the document orientation classification model with use_doc_orientation_classify# pipeline = TableRecognitionPipelineV2(use_doc_unwarping=True) # Specify whether to use the text image unwarping module with use_doc_unwarping# pipeline = TableRecognitionPipelineV2(device="gpu") # Specify the device to use GPU for model inference
output = pipeline.predict("https://cdn-uploads.huggingface.co/production/uploads/681c1ecd9539bdde5ae1733c/mabagznApI1k9R8qFoTLc.png")
for res in output:
res.print() ## Print the predicted structured output
res.save_to_img("./output/")
res.save_to_xlsx("./output/")
res.save_to_html("./output/")
res.save_to_json("./output/")
For details about usage command and descriptions of parameters, please refer to the
Document
.
PP-StructureV3
Layout analysis is a technique used to extract structured information from document images. PP-StructureV3 includes the following six modules:
Layout Detection Module
General OCR Pipeline
Document Image Preprocessing Pipeline (Optional)
Table Recognition Pipeline (Optional)
Seal Recognition Pipeline (Optional)
Formula Recognition Pipeline (Optional)
Run a single command to quickly experience the PP-StructureV3 pipeline:
Results would be printed to the terminal. If save_path is specified, the results will be saved under
save_path
.
Just a few lines of code can experience the inference of the pipeline. Taking the PP-StructureV3 pipeline as an example:
from paddleocr import PPStructureV3
pipeline = PPStructureV3(
use_doc_orientation_classify=False, # Use use_doc_orientation_classify to enable/disable document orientation classification model
use_doc_unwarping=False, # Use use_doc_unwarping to enable/disable document unwarping module
use_textline_orientation=False, # Use use_textline_orientation to enable/disable textline orientation classification model
device="gpu:0", # Use device to specify GPU for model inference
)
output = pipeline.predict("mG4tnwfrvECoFMu-S9mxo.png")
for res in output:
res.print() # Print the structured prediction output
res.save_to_json(save_path="output") ## Save the current image's structured result in JSON format
res.save_to_markdown(save_path="output") ## Save the current image's result in Markdown format
For details about usage command and descriptions of parameters, please refer to the
Document
.
PP-LCNet_x1_0_table_cls huggingface.co is an AI model on huggingface.co that provides PP-LCNet_x1_0_table_cls's model effect (), which can be used instantly with this PaddlePaddle PP-LCNet_x1_0_table_cls model. huggingface.co supports a free trial of the PP-LCNet_x1_0_table_cls model, and also provides paid use of the PP-LCNet_x1_0_table_cls. Support call PP-LCNet_x1_0_table_cls model through api, including Node.js, Python, http.
PP-LCNet_x1_0_table_cls huggingface.co is an online trial and call api platform, which integrates PP-LCNet_x1_0_table_cls's modeling effects, including api services, and provides a free online trial of PP-LCNet_x1_0_table_cls, you can try PP-LCNet_x1_0_table_cls online for free by clicking the link below.
PaddlePaddle PP-LCNet_x1_0_table_cls online free url in huggingface.co:
PP-LCNet_x1_0_table_cls is an open source model from GitHub that offers a free installation service, and any user can find PP-LCNet_x1_0_table_cls on GitHub to install. At the same time, huggingface.co provides the effect of PP-LCNet_x1_0_table_cls install, users can directly use PP-LCNet_x1_0_table_cls installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
PP-LCNet_x1_0_table_cls install url in huggingface.co: