Description
Object detection model trained to detect tables leverages one of the foremost architectures in the state-of-the-art, meticulously selected through benchmark evaluations and comparative analyses. Trained on an extensive and diverse dataset, this model has been finely tuned for precise table detection within documents. Its efficacy has been verified through rigorous testing, demonstrating exceptional performance in table detection across a spectrum of document formats.
Predicted Entities
Live Demo Open in Colab Copy S3 URI
How to use
binary_to_image = BinaryToImage()
cell_detector = ImageDocumentRegionDetector() \
.pretrained("table_detection_v3", "en", "clinical/ocr") \
.setInputCol("image") \
.setOutputCol("regions") \
.setScoreThreshold(0.8)
draw_regions = ImageDrawRegions() \
.setInputCol("image") \
.setInputRegionsCol("regions") \
.setOutputCol("image_with_regions") \
.setRectColor(Color.red)
pipeline = PipelineModel(stages=[
binary_to_image,
cell_detector,
draw_regions,
])
imagePath = 'document.jpg'
image_df = spark.read.format("binaryFile").load(imagePath).sort("path")
result = pipeline.transform(image_df)
val binary_to_image = BinaryToImage()
val cell_detector = ImageDocumentRegionDetector()
.pretrained("table_detection_v3", "en", "clinical/ocr")
.setInputCol("image")
.setOutputCol("regions")
.setScoreThreshold(0.8)
val draw_regions = ImageDrawRegions()
.setInputCol("image")
.setInputRegionsCol("regions")
.setOutputCol("image_with_regions")
.setRectColor(Color.red)
val pipeline = new PipelineModel().setStages(Array(
binary_to_image,
cell_detector,
draw_regions))
val imagePath = "document.jpg"
val image_df = spark.read.format("binaryFile").load(imagePath).sort("path")
val result = pipeline.transform(image_df)
Example
Input:
Output:
Model Information
Model Name: | table_detection_v3 |
Type: | ocr |
Compatibility: | Visual NLP 5.2.0+ |
License: | Licensed |
Edition: | Official |
Language: | en |