repo_id string | cross_repo_split string | commit_index int32 | commit_sha string | in_repo_split string | test_file string | file_split string | split_group string | lineno int32 | col_offset int32 | assertion_type string | test_function string | prefix large_string | target string | assertion_event_type string | assertion_event_id string | assertion_anchor large_string | old_target string | old_lineno int32 | old_col_offset int32 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
xavctn/img2table | train | 4 | 29f3a6f8f82c5485bf044eda687807fd40fe3356 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 34 | 4 | assert | test_load_image | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | img_from_bytes.bytes | modified | 882afae4ddb734c84c19b434bd129d4c1dc48ff9a1da993641ca5648ab7e02b9 | assert|test_load_image|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell... | img_from_bytes.bytes | 33 | 4 |
xavctn/img2table | train | 4 | 29f3a6f8f82c5485bf044eda687807fd40fe3356 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 55 | 4 | assert | test_image_tables | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected | modified | 70a36c694348f3bf5f53feb93c7100e6669b44706fdbce6807cde18578a4b34a | assert|test_image_tables|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCe... | expected | 54 | 4 |
xavctn/img2table | train | 4 | 29f3a6f8f82c5485bf044eda687807fd40fe3356 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 69 | 8 | assert | test_image_excel | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | list(expected.worksheets[idx].values) | added | 61b3ced7005f068c8118bc44157b82ef096acf9bfde1950a512052d3e2e85fea | assert|test_image_excel|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCel... | null | null | null |
xavctn/img2table | train | 4 | 29f3a6f8f82c5485bf044eda687807fd40fe3356 | train | tests/tables/objects/test_extraction.py | train | xavctn/img2table:tests/tables/objects/test_extraction.py | 23 | 8 | assert | test_extracted_table_worksheet | # coding: utf-8
import json
from io import BytesIO
from xlsxwriter import Workbook
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_extracted_table_worksheet():
with open("test_data/expected_tables.json", "r") a... | table.nb_columns | added | ebcbc98640a6c383009b56b1a61e96389227c8126213bb2125200ff2f1de49f2 | assert|test_extracted_table_worksheet|# coding: utf-8 import json from io import BytesIO from xlsxwriter import Workbook from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_extracted_table_worksheet(): with open("test_data... | null | null | null |
xavctn/img2table | train | 4 | 29f3a6f8f82c5485bf044eda687807fd40fe3356 | train | tests/tables/objects/test_extraction.py | train | xavctn/img2table:tests/tables/objects/test_extraction.py | 24 | 8 | assert | test_extracted_table_worksheet | # coding: utf-8
import json
from io import BytesIO
from xlsxwriter import Workbook
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_extracted_table_worksheet():
with open("test_data/expected_tables.json", "r") a... | table.nb_rows | added | 5d83751b44419d20718cde8957320ac7b13239261f68e5410bc677214d3824d5 | assert|test_extracted_table_worksheet|# coding: utf-8 import json from io import BytesIO from xlsxwriter import Workbook from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_extracted_table_worksheet(): with open("test_data... | null | null | null |
xavctn/img2table | train | 4 | 29f3a6f8f82c5485bf044eda687807fd40fe3356 | train | tests/tables/objects/test_extraction.py | train | xavctn/img2table:tests/tables/objects/test_extraction.py | 30 | 8 | assert | test_extracted_table_worksheet | # coding: utf-8
import json
from io import BytesIO
from xlsxwriter import Workbook
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_extracted_table_worksheet():
with open("test_data/expected_tables.json", "r") a... | table_values | added | e8fc595d9fa1ef3772b5a92c3456a9246e48500d73289b81fdc4de3cc5519a57 | assert|test_extracted_table_worksheet|# coding: utf-8 import json from io import BytesIO from xlsxwriter import Workbook from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_extracted_table_worksheet(): with open("test_data... | null | null | null |
xavctn/img2table | train | 5 | 4cee98fa37e45b1249fba85557bcfdb8b8c09b5a | train | tests/document/base/test_rotation.py | train | xavctn/img2table:tests/document/base/test_rotation.py | 28 | 4 | assert | test_upside_down | # coding: utf-8
import cv2
import numpy as np
from sewar import ssim
from img2table.document.base.rotation import straightened_img, rotate_img, upside_down, fix_rotation_image
def test_straightened_img():
img = cv2.imread("test_data/test.png", cv2.IMREAD_GRAYSCALE)
for angle in range(-180, 180, 1):
... | not upside_down(img=img) | added | 2806ff9702eb084d0d0f7e9c691d2502bdd6e3ac641857c23d0d48b813957173 | assert|test_upside_down|# coding: utf-8 import cv2 import numpy as np from sewar import ssim from img2table.document.base.rotation import straightened_img, rotate_img, upside_down, fix_rotation_image def test_straightened_img(): img = cv2.imread("test_data/test.png", cv2.IMREAD_GRAYSCALE) for angle in range(-180, 180, ... | null | null | null |
xavctn/img2table | train | 5 | 4cee98fa37e45b1249fba85557bcfdb8b8c09b5a | train | tests/document/base/test_rotation.py | train | xavctn/img2table:tests/document/base/test_rotation.py | 29 | 4 | assert | test_upside_down | # coding: utf-8
import cv2
import numpy as np
from sewar import ssim
from img2table.document.base.rotation import straightened_img, rotate_img, upside_down, fix_rotation_image
def test_straightened_img():
img = cv2.imread("test_data/test.png", cv2.IMREAD_GRAYSCALE)
for angle in range(-180, 180, 1):
... | upside_down(img=rotate_img(img, 180)) | added | f1d037d4c2fd8c2c69548c9954247b3009b1669598dc19348fbe3daac19fc355 | assert|test_upside_down|# coding: utf-8 import cv2 import numpy as np from sewar import ssim from img2table.document.base.rotation import straightened_img, rotate_img, upside_down, fix_rotation_image def test_straightened_img(): img = cv2.imread("test_data/test.png", cv2.IMREAD_GRAYSCALE) for angle in range(-180, 180, ... | null | null | null |
xavctn/img2table | train | 5 | 4cee98fa37e45b1249fba85557bcfdb8b8c09b5a | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 21 | 9 | pytest.raises | test_validators | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | TypeError) | added | 5b518ba885f3e1283846181a317dfeaec71cb3439ff94ce9b7cf0036869d2a19 | pytest.raises|test_validators|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, Ta... | null | null | null |
xavctn/img2table | train | 5 | 4cee98fa37e45b1249fba85557bcfdb8b8c09b5a | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 39 | 4 | assert | test_load_image | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | (417, 1365) | modified | 295e5456f2df3265dd6efe2974c8d8fc4ae40717c23953977a1f4633fbaaede4 | assert|test_load_image|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell... | (417, 1365) | 36 | 4 |
xavctn/img2table | train | 5 | 4cee98fa37e45b1249fba85557bcfdb8b8c09b5a | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 58 | 4 | assert | test_image_tables | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected | modified | 8b5f603bf4b2af6e1307ca0278e2c1739803f30cf04ed7d398877b7d26079928 | assert|test_image_tables|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCe... | expected | 55 | 4 |
xavctn/img2table | train | 5 | 4cee98fa37e45b1249fba85557bcfdb8b8c09b5a | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 71 | 8 | assert | test_image_excel | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected.worksheets[idx].title | modified | 053512341e9f1849758330e872b22625c905681b1b4a7897fc112163e3a45c99 | assert|test_image_excel|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCel... | expected.worksheets[idx].title | 68 | 8 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/ocr/aws_textract/test_aws_textract.py | train | xavctn/img2table:tests/ocr/aws_textract/test_aws_textract.py | 26 | 4 | assert | test_map_response | # coding: utf-8
import json
import os
import polars as pl
from img2table.document import Image
from img2table.ocr import TextractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_map_response(mock_textract):
img = Image("test_data/test.png")
with open(os.path.join(MOCK_DIR... | expected | modified | e20e3ab170919122f02725b6e7c0122c75f4cbaa3c66119c47b371bcaabe1913 | assert|test_map_response|# coding: utf-8 import json import os import polars as pl from img2table.document import Image from img2table.ocr import TextractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_map_response(mock_textract): img = Image("test_data/test.png") with open(os.path.j... | expected | 26 | 4 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/ocr/data/test_ocr_data.py | train | xavctn/img2table:tests/ocr/data/test_ocr_data.py | 18 | 4 | assert | test_pages | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_pages():
ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr_df.csv", ... | isinstance(ocr_df_page_0, OCRDataframe) | modified | 6e8742eea20069d11bc0b92240fb752aaddae9d22500acedc20fb25b81756c09 | assert|test_pages|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_pages(): ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr... | isinstance(ocr_df_page_0, OCRDataframe) | 18 | 4 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/ocr/google_vision/test_google_vision.py | train | xavctn/img2table:tests/ocr/google_vision/test_google_vision.py | 65 | 9 | pytest.raises | test_vision_ocr | # coding: utf-8
import json
import os
import pickle
import polars as pl
import pytest
from img2table.document import Image
from img2table.ocr.data import OCRDataframe
from img2table.ocr.google_vision import VisionEndpointContent, VisionAPIContent, VisionOCR
from tests import MOCK_DIR
def test_vision_endpoint_conten... | ValueError) | modified | e1652084c7cc0ac171a468434ee409bebef8cd84856b6a03b614982dc97d873a | pytest.raises|test_vision_ocr|# coding: utf-8 import json import os import pickle import polars as pl import pytest from img2table.document import Image from img2table.ocr.data import OCRDataframe from img2table.ocr.google_vision import VisionEndpointContent, VisionAPIContent, VisionOCR from tests import MOCK_DIR def t... | ValueError) | 65 | 9 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/ocr/pdf/test_pdf_ocr.py | train | xavctn/img2table:tests/ocr/pdf/test_pdf_ocr.py | 34 | 4 | assert | test_pdf_ocr_df | # coding: utf-8
import json
import polars as pl
from img2table.document.pdf import PDF
from img2table.ocr.data import OCRDataframe
from img2table.ocr.pdf import PdfOCR
def test_pdf_content(mock_tesseract):
instance = PdfOCR()
doc = PDF(src="test_data/test.pdf", dpi=300)
result = instance.content(docume... | expected | modified | 17be7b206ae2683c6b76823eaf91f003c2d3799981b50550a1c95e1d0524d5e3 | assert|test_pdf_ocr_df|# coding: utf-8 import json import polars as pl from img2table.document.pdf import PDF from img2table.ocr.data import OCRDataframe from img2table.ocr.pdf import PdfOCR def test_pdf_content(mock_tesseract): instance = PdfOCR() doc = PDF(src="test_data/test.pdf", dpi=300) result = instance.content(... | expected | 35 | 4 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 52 | 4 | assert | test_tesseract_ocr_df | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | expected | modified | 2faa094869b16ecf0a37be1c58a4f6f337d90e4db89926297bb831bdf0156d75 | assert|test_tesseract_ocr_df|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_info: ocr... | expected | 52 | 4 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/tables/image/test_image.py | train | xavctn/img2table:tests/tables/image/test_image.py | 29 | 4 | assert | test_table_image | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.image import TableImage
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_table_image():
... | expected | modified | 7f16313e0918f54a62d8b25f8acc976617bb48d7e48d0abda709efe50a0d2a3c | assert|test_table_image|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.image import TableImage from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def te... | expected | 29 | 4 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/tables/processing/tables/test_implicit_rows.py | train | xavctn/img2table:tests/tables/processing/tables/test_implicit_rows.py | 24 | 4 | assert | test_create_word_image | # coding: utf-8
import json
import cv2
import numpy as np
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.tables.implicit_rows i... | np.array_equal(result, expected) | modified | c75c1de7075ff1cfd49b80db065123d4451fb6cff25470b68aaaae3f54f69dbf | assert|test_create_word_image|# coding: utf-8 import json import cv2 import numpy as np import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.proce... | np.array_equal(result, expected) | 24 | 4 |
xavctn/img2table | train | 6 | efc0581f054361f0920b6a0f8ffe5d790358c8ad | train | tests/tables/processing/text/test_titles.py | train | xavctn/img2table:tests/tables/processing/text/test_titles.py | 22 | 4 | assert | test_get_title_tables | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.text.titles import get_title_tables
def... | "10 most populous countries" | modified | 0fbda2a7ef30034cfc043db5dbb1812f7dd8efe5979d459304aad143b1febff8 | assert|test_get_title_tables|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.text.titles im... | "10 most populous countries" | 22 | 4 |
xavctn/img2table | train | 7 | fe05353a77567a203501b86cc1ca4290352263b1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 67 | 4 | assert | test_image_tables | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected | added | 4469e7bc20906a95a9be29f3e26cb2032afdd7f9509a7f5b994be5ec2151554a | assert|test_image_tables|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCe... | null | null | null |
xavctn/img2table | train | 7 | fe05353a77567a203501b86cc1ca4290352263b1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 80 | 8 | assert | test_image_excel | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected.worksheets[idx].title | added | 8c7fe83af3669716b6df46f5a45b8c49f73dcf6aac7ee42a7d548633b73df54d | assert|test_image_excel|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCel... | null | null | null |
xavctn/img2table | train | 7 | fe05353a77567a203501b86cc1ca4290352263b1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 81 | 8 | assert | test_image_excel | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | list(expected.worksheets[idx].values) | added | 500b7fd2597493a5d7b2a989cef9b8fee35df74fc78427503e1079a45d97ba2a | assert|test_image_excel|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCel... | null | null | null |
xavctn/img2table | train | 8 | c421dc120bb6fd4cfc011c29e604877a49fd74aa | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 67 | 4 | assert | test_image_tables | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected | modified | 7996fd58ff228bcde8ccf1ea3ee89a77cd7382196a8f151fc6f323184b76dd94 | assert|test_image_tables|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCe... | expected | 67 | 4 |
xavctn/img2table | train | 8 | c421dc120bb6fd4cfc011c29e604877a49fd74aa | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 80 | 8 | assert | test_image_excel | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | expected.worksheets[idx].title | modified | 1915fd74efa6ec4b077eeea79ee1f75a7306e6ca8fc3ac30bd97c1f89b0b6b53 | assert|test_image_excel|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCel... | expected.worksheets[idx].title | 80 | 8 |
xavctn/img2table | train | 8 | c421dc120bb6fd4cfc011c29e604877a49fd74aa | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 81 | 8 | assert | test_image_excel | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validator... | list(expected.worksheets[idx].values) | modified | 023ea52d295dff10ce3896dc26b78440ad25402e9adf8177f4d8baed17efa063 | assert|test_image_excel|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCel... | list(expected.worksheets[idx].values) | 81 | 8 |
xavctn/img2table | train | 9 | 675723e82ecb3258c6a95d9e38522207187c0757 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 15 | 9 | pytest.raises | test_validators | # coding: utf-8
import json
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import PaddleOCR
from img2table.ocr.data import OCRDataframe
def test_validators():
with pytest.raises( | TypeError) | added | d5dd72864cdab8c3a67c5992b3d36256b4ba444b73b2800914866079151b2c1e | pytest.raises|test_validators|# coding: utf-8 import json import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import PaddleOCR from img2table.ocr.data import OCRDataframe def test_validators(): with pytest.raises( | null | null | null |
xavctn/img2table | train | 9 | 675723e82ecb3258c6a95d9e38522207187c0757 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 28 | 4 | assert | test_paddle_hocr | # coding: utf-8
import json
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import PaddleOCR
from img2table.ocr.data import OCRDataframe
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = PaddleOCR(lang=12)
def test_paddle_... | expected | added | 1576c5e6ff3c8b22e97a4f22466d3f412d9797f41e730a9a2ee81955146d38bc | assert|test_paddle_hocr|# coding: utf-8 import json import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import PaddleOCR from img2table.ocr.data import OCRDataframe def test_validators(): with pytest.raises(TypeError) as e_info: ocr = PaddleOCR(lang=12) def test_pa... | null | null | null |
xavctn/img2table | train | 9 | 675723e82ecb3258c6a95d9e38522207187c0757 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 53 | 4 | assert | test_paddle_ocr_df | # coding: utf-8
import json
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import PaddleOCR
from img2table.ocr.data import OCRDataframe
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = PaddleOCR(lang=12)
def test_paddle_... | expected | added | 415d32a6c69d57836c081b9c280a9982757a017ed349c454dab056dbdb69d551 | assert|test_paddle_ocr_df|# coding: utf-8 import json import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import PaddleOCR from img2table.ocr.data import OCRDataframe def test_validators(): with pytest.raises(TypeError) as e_info: ocr = PaddleOCR(lang=12) def test_... | null | null | null |
xavctn/img2table | train | 9 | 675723e82ecb3258c6a95d9e38522207187c0757 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 64 | 4 | assert | test_paddle_document | # coding: utf-8
import json
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import PaddleOCR
from img2table.ocr.data import OCRDataframe
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = PaddleOCR(lang=12)
def test_paddle_... | expected | added | dfb92b30ac4e090d3a123948e987245b4fcc3b3a21e8e943995d9ffde47d1dfb | assert|test_paddle_document|# coding: utf-8 import json import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import PaddleOCR from img2table.ocr.data import OCRDataframe def test_validators(): with pytest.raises(TypeError) as e_info: ocr = PaddleOCR(lang=12) def tes... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/ocr/data/test_ocr_data.py | train | xavctn/img2table:tests/ocr/data/test_ocr_data.py | 26 | 4 | assert | test_pages | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_text_sizes():
ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr_df.c... | isinstance(ocr_df_page_1, OCRDataframe) | added | 1139cf0eb198ffec6041c971ea5ca2d434f514ff87e0a8831645f7e8c2dde315 | assert|test_pages|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_text_sizes(): ocr_df = OCRDataframe(df=pl.read_csv("test_dat... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/objects/test_table.py | train | xavctn/img2table:tests/tables/objects/test_table.py | 72 | 4 | assert | test_get_table_content | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_remove_rows():
table = Table(rows=[Row(cells=[Cell(x1=0, x2=100, y1=0,... | expected | added | 3c126f407105c192659301b2f78a0da9e8d6a216bfa221c16eea70327d5769f6 | assert|test_get_table_content|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_remove_rows(): table = Table(rows=[Row(cells=[Ce... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/processing/borderless_tables/alignment/test_alignment.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/alignment/test_alignment.py | 33 | 4 | assert | test_center_aligned | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.processing.borderless_tables.alignment import left_aligned, right_aligned, center_aligned, \
vertically_coherent_cluster, cluster_aligned_text
def test_left_aligned():
cell_1 = Cell(x1=10, y1=0, x2=25, y2=10)
cell_2 = Cel... | center_aligned(cell_1=cell_1, cell_2=cell_3) | added | b6b48bc834a55301aa8b038b5f1c8466e537808edaf18cfe58b386f4b44bbe37 | assert|test_center_aligned|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.processing.borderless_tables.alignment import left_aligned, right_aligned, center_aligned, \ vertically_coherent_cluster, cluster_aligned_text def test_left_aligned(): cell_1 = Cell(x1=10, y1=0, x2=25, y2=10)... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/processing/borderless_tables/detect_borderless_tables/test_detect_borderless_tables.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/detect_borderless_tables/test_detect_borderless_tables.py | 38 | 4 | assert | test_detect_borderless_tables | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables import detect_borderle... | expected | added | f38b0d1c4270ee70e0c8c04e029ec360244dda2eaa8575a21604e2c981860a4b | assert|test_detect_borderless_tables|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.border... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/processing/borderless_tables/identify_tables/test_identify_tables.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/identify_tables/test_identify_tables.py | 69 | 4 | assert | test_identify_tables | # coding: utf-8
import json
from img2table.tables.objects.cell import Cell
from img2table.tables.processing.borderless_tables.identify_tables import find_common_rows, dfs, get_maximal_cycles, \
merge_cycle_clusters, identify_tables
def test_find_common_rows():
cluster_1 = [Cell(x1=0, x2=10, y1=0, y2=10),
... | [[set(cl) for cl in tb] for tb in expected] | added | a6ea2856c597a68ae9295d23fe979f6fcf6adc44651d482d19fbd626b1972b74 | assert|test_identify_tables|# coding: utf-8 import json from img2table.tables.objects.cell import Cell from img2table.tables.processing.borderless_tables.identify_tables import find_common_rows, dfs, get_maximal_cycles, \ merge_cycle_clusters, identify_tables def test_find_common_rows(): cluster_1 = [Cell(x1=0, x2=10, ... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/processing/borderless_tables/segment_image/test_segment_image.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/segment_image/test_segment_image.py | 44 | 4 | assert | test_create_word_contours | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.processing.borderless_tables.segment_image import create_image_segments, \
text_countours_from_group, create_word_contours, segment_image_text... | set(expected) | added | 9bc456b1364a46957492ea327515c43a4120c35c20451e699eca78df2eb49ba1 | assert|test_create_word_contours|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.processing.borderless_tables.segment_image import create_image_segments, \ text_countours_from_group, create_word_c... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/processing/prepare_image/test_prepare_image.py | val | xavctn/img2table:tests/tables/processing/prepare_image/test_prepare_image.py | 14 | 4 | assert | test_prepare_image | # coding: utf-8
import cv2
import numpy as np
from img2table.tables.processing.prepare_image import prepare_image
def test_prepare_image():
img = cv2.imread("test_data/test.png", cv2.IMREAD_GRAYSCALE)
result = prepare_image(img=img)
# Check that the average value of a pixel is darker in original image
... | np.mean(result) | added | 0740dff3ce27cbf33ed3a9cfca484d5eb7018a065ac142a3337e38acd0ea3694 | assert|test_prepare_image|# coding: utf-8 import cv2 import numpy as np from img2table.tables.processing.prepare_image import prepare_image def test_prepare_image(): img = cv2.imread("test_data/test.png", cv2.IMREAD_GRAYSCALE) result = prepare_image(img=img) # Check that the average value of a pixel is darker in origin... | null | null | null |
xavctn/img2table | train | 10 | a7322b425a315720cb6c023a054ef56ee60581d2 | train | tests/tables/processing/tables/test_table_creation.py | test | xavctn/img2table:tests/tables/processing/tables/test_table_creation.py | 19 | 4 | assert | test_normalize_table_cells | # coding: utf-8
import json
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.tables.table_creation import normalize_table_cells, cluster_to_table
def test_normalize_table_cells():
with ope... | expected | modified | 46cfa47d451338869fe8082539b239213a758b1d82eb8a8f41930cf2a4dca371 | assert|test_normalize_table_cells|# coding: utf-8 import json from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.tables.table_creation import normalize_table_cells, cluster_to_table def test_normal... | expected | 19 | 4 |
xavctn/img2table | train | 11 | 7692fb7fc8cc6153ff76a251e3134311f8a1cc0a | train | tests/document/pdf/test_pdf.py | train | xavctn/img2table:tests/document/pdf/test_pdf.py | 68 | 4 | assert | test_pdf_tables | # coding: utf-8
import json
from collections import OrderedDict
from io import BytesIO
import pytest
from img2table.document.pdf import PDF
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell
def test_validators():
with pytest.raises(TypeError) ... | expected | modified | 301720e9c669dd3099192e43084c2e9d4a30da0ed26865ac26e812369b7ad951 | assert|test_pdf_tables|# coding: utf-8 import json from collections import OrderedDict from io import BytesIO import pytest from img2table.document.pdf import PDF from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import ExtractedTable, BBox, TableCell def test_validators(): with pytest.rai... | expected | 68 | 4 |
xavctn/img2table | train | 11 | 7692fb7fc8cc6153ff76a251e3134311f8a1cc0a | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 52 | 4 | assert | test_tesseract_ocr_df | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | expected | modified | 98df1d619296188edf7a66abc5cd5ef174b67cf3becb00a3fb61df706a659fed | assert|test_tesseract_ocr_df|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_info: ocr... | expected | 52 | 4 |
xavctn/img2table | train | 11 | 7692fb7fc8cc6153ff76a251e3134311f8a1cc0a | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 63 | 4 | assert | test_tesseract_document | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | expected | modified | 935a38a03f73db5e4d2e4fc331950de8fa5e4f0228a712cdbba99b01701829cd | assert|test_tesseract_document|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_info: o... | expected | 63 | 4 |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/bordered_tables/cells/test_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_cells.py | 24 | 4 | assert | test_get_cells | # coding: utf-8
import json
import polars as pl
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.cells import get_cells
def test_get_cells():
with open("test_data/lines.json", 'r') as f:
data = json.load(f)
... | expected | modified | ab05446a7894cccff5f152abe674c58850b1a512440c32f1aabc6f93f654b2c5 | assert|test_get_cells|# coding: utf-8 import json import polars as pl from img2table.tables.objects.cell import Cell from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.cells import get_cells def test_get_cells(): with open("test_data/lines.json", 'r') as f: data = json.load(... | expected | 24 | 4 |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/bordered_tables/cells/test_deduplication_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_deduplication_cells.py | 33 | 4 | assert | test_deduplicate_cells | # coding: utf-8
import polars as pl
from img2table.tables.processing.bordered_tables.cells.deduplication import deduplicate_cells_vertically, \
deduplicate_nested_cells, \
deduplicate_cells
def test_deduplicate_cells_vertically():
df_cells = pl.read_csv("test_data/expected_ident_cells.csv", sep=";", enco... | result.frame_equal(expected) | modified | 5e1f0db59ae27fdf45762266f0b4fd496995709660de5460e8256d56da4d7514 | assert|test_deduplicate_cells|# coding: utf-8 import polars as pl from img2table.tables.processing.bordered_tables.cells.deduplication import deduplicate_cells_vertically, \ deduplicate_nested_cells, \ deduplicate_cells def test_deduplicate_cells_vertically(): df_cells = pl.read_csv("test_data/expected_ident_cells.csv"... | result.frame_equal(expected) | 32 | 4 |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/bordered_tables/cells/test_identification_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_identification_cells.py | 20 | 4 | assert | test_get_cells_dataframe | # coding: utf-8
import json
import polars as pl
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.cells import get_cells_dataframe
def test_get_cells_dataframe():
with open("test_data/lines.json", 'r') as f:
data = json.load(f)
h_lines = [Line(**el) for ... | result.frame_equal(expected.sort(['x1', 'y1', 'x2', 'y2'])) | modified | 30819b2b0699d2d74c9219ebd22626405d492f0a4dc63002915fc1c3aa05d381 | assert|test_get_cells_dataframe|# coding: utf-8 import json import polars as pl from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.cells import get_cells_dataframe def test_get_cells_dataframe(): with open("test_data/lines.json", 'r') as f: data = json.load(f) h_lines = [Lin... | result.frame_equal(expected.sort(['x1', 'y1', 'x2', 'y2'])) | 20 | 4 |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/bordered_tables/tables/test_tables.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/tables/test_tables.py | 20 | 4 | assert | test_get_tables | # coding: utf-8
import json
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.bordered_tables.tables import get_tables
def test_get_tables():
with open("test_data/cells.json", 'r') as f:
... | expected | modified | 923e2013ad8ee2f645bd19964a01e48d493cb8f3e5bcf5b2e0e8f2030426c299 | assert|test_get_tables|# coding: utf-8 import json from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.bordered_tables.tables import get_tables def test_get_tables(): with open("test_data/cells.json... | expected | 20 | 4 |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/borderless_tables/table_creation/test_coherency.py | val | xavctn/img2table:tests/tables/processing/borderless_tables/table_creation/test_coherency.py | 14 | 4 | assert | test_check_versus_content | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables.table_creation.coherency import check_versus_content
def test_check_versus_content():
table = Table(rows=... | table | added | e01c497b564e8baea3fbbb65e4ce498c94fd020f8aaa0e8f289b7013bf54ff27 | assert|test_check_versus_content|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.borderless_tables.table_creation.coherency import check_versus_content def test_check_versus_cont... | null | null | null |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/borderless_tables/table_creation/test_columns.py | val | xavctn/img2table:tests/tables/processing/borderless_tables/table_creation/test_columns.py | 15 | 4 | assert | test_get_column_delimiters | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.processing.borderless_tables.table_creation.columns import get_column_delimiters
def test_get_column_delimiters():
tb_clusters = [
[Cell(x1=10, x2=20, y1=10, y2=20), Cell(x1=10, x2=20, y1=20, y2=30)],
[Cell(x1=40... | ([5, 30, 70, 105], [[Cell(x1=10, y1=10, x2=20, y2=20), Cell(x1=10, y1=20, x2=20, y2=30)], [Cell(x1=40, y1=10, x2=60, y2=20), Cell(x1=40, y1=20, x2=60, y2=30)], [Cell(x1=80, y1=10, x2=100, y2=20), Cell(x1=80, y1=20, x2=100, y2=30)]]) | added | 2ee151f4749f5a44b2900393b909727b70152fde197fd32d9a7e3917d4e2ae28 | assert|test_get_column_delimiters|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.processing.borderless_tables.table_creation.columns import get_column_delimiters def test_get_column_delimiters(): tb_clusters = [ [Cell(x1=10, x2=20, y1=10, y2=20), Cell(x1=10, x2=20, y1=20, y2=30)], ... | null | null | null |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/borderless_tables/table_creation/test_rows.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/table_creation/test_rows.py | 93 | 4 | assert | test_unify_clusters | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.processing.borderless_tables.table_creation.rows import get_row_delimiters, \
merge_aligned_in_column, cluster_cells_centers, CellsCenter, unify_clusters, row_delimiters_from_borders
def test_merge_aligned_in_column():
tb_cl... | expected | added | 173d66a9125691945ad1e8bdec3d52cfeced9b16d7d6dbaf0cb3f3d31e92b481 | assert|test_unify_clusters|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.processing.borderless_tables.table_creation.rows import get_row_delimiters, \ merge_aligned_in_column, cluster_cells_centers, CellsCenter, unify_clusters, row_delimiters_from_borders def test_merge_aligned_in... | null | null | null |
xavctn/img2table | train | 12 | 3d650a6f11ff8bf4fda29d05708e736f7ce66bf5 | train | tests/tables/processing/borderless_tables/table_creation/test_table_creation.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/table_creation/test_table_creation.py | 36 | 4 | assert | test_create_table_from_clusters | # coding: utf-8
import json
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables.table_creation import create_table_from_clusters
def test_create_table_from_clusters():
with ... | expected | added | 4ce6bd6dc6bb54f22e06d7cc4a6fa069d3b78b7afd38cf6244b7b4934b4e175c | assert|test_create_table_from_clusters|# coding: utf-8 import json from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.borderless_tables.table_creation import create_table_from_clusters def test_cre... | null | null | null |
xavctn/img2table | train | 13 | 4b44669615f894f534359704537d0b7dc91a4094 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 26 | 9 | pytest.raises | test_lang_validators | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | EnvironmentError) | added | 514b0002e984b9d9afbc4b1bacb8dbd184aaaa1a9924e3e5ebd7b7293214e5aa | pytest.raises|test_lang_validators|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_inf... | null | null | null |
xavctn/img2table | train | 13 | 4b44669615f894f534359704537d0b7dc91a4094 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 37 | 8 | assert | test_tesseract_hocr | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | f.read() | added | e17ebc548e22b89b1369de52e7a5d525cfea423bbb531ae871bb3e9b7d61867d | assert|test_tesseract_hocr|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_info: ocr =... | null | null | null |
xavctn/img2table | train | 13 | 4b44669615f894f534359704537d0b7dc91a4094 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 47 | 8 | assert | test_tesseract_content | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | [f.read()] | added | 8e26e95c8924dba2f1523f5678ad6ac258e19dd0bdfcb900c3b91f1701ac9d80 | assert|test_tesseract_content|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_info: oc... | null | null | null |
xavctn/img2table | train | 13 | 4b44669615f894f534359704537d0b7dc91a4094 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 71 | 4 | assert | test_tesseract_document | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR
def test_validators():
with pytest.raises(TypeError) as e_info:
ocr = TesseractO... | expected | added | 3a211c7123e13c7a03f86c17d81b310dc2820b09b2dd8dc6588557b0a15d6882 | assert|test_tesseract_document|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR def test_validators(): with pytest.raises(TypeError) as e_info: o... | null | null | null |
xavctn/img2table | train | 14 | 5c8eaed6be34669c074f544f0ee57683351ae608 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 15 | 9 | pytest.raises | test_validators | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR, TESSERACT_INSTALL
def test_validators():
with pytest.raises( | TypeError) | modified | e0ac820ceff79bbd98dd7725605e18353d1f16841bb7ffd736bbb01c27757a6d | pytest.raises|test_validators|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR, TESSERACT_INSTALL def test_validators(): with pytest.raises( | TypeError) | 15 | 9 |
xavctn/img2table | train | 14 | 5c8eaed6be34669c074f544f0ee57683351ae608 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 24 | 9 | pytest.raises | test_installed | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR, TESSERACT_INSTALL
def test_validators():
with pytest.raises(TypeError) as e_info:
... | EnvironmentError) | added | 5e8e131e7d0f99502f157c41c48034cfd78abfd918fc8dfcbb60045bcebc3231 | pytest.raises|test_installed|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR, TESSERACT_INSTALL def test_validators(): with pytest.raises(TypeEr... | null | null | null |
xavctn/img2table | train | 14 | 5c8eaed6be34669c074f544f0ee57683351ae608 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 40 | 8 | assert | test_tesseract_hocr | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR, TESSERACT_INSTALL
def test_validators():
with pytest.raises(TypeError) as e_info:
... | f.read() | modified | 3278e67dbd97ab62d1202b9526f643323f6e2acab4e860b322ecc88da4c33cf8 | assert|test_tesseract_hocr|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR, TESSERACT_INSTALL def test_validators(): with pytest.raises(TypeErro... | f.read() | 37 | 8 |
xavctn/img2table | train | 14 | 5c8eaed6be34669c074f544f0ee57683351ae608 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 50 | 8 | assert | test_tesseract_content | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR, TESSERACT_INSTALL
def test_validators():
with pytest.raises(TypeError) as e_info:
... | [f.read()] | modified | 73cdc57d56b5e67bf2275bb7410365735f820d538d65ea1b031c73ce9f55b2b7 | assert|test_tesseract_content|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR, TESSERACT_INSTALL def test_validators(): with pytest.raises(TypeE... | [f.read()] | 47 | 8 |
xavctn/img2table | train | 15 | b5d31ae19a94de2421c8bec1da696153c95ae551 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 18 | 9 | pytest.raises | test_validators | # coding: utf-8
import json
import sys
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr.data import OCRDataframe
@pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR")
def test_validators():
from img2table.ocr import PaddleO... | TypeError) | added | b4f8ad3258a7da47d1d1f164f954ea2dc872405a47761fccdce6c18ff6bd5232 | pytest.raises|test_validators|# coding: utf-8 import json import sys import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr.data import OCRDataframe @pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR") def test_validators(): from img2tab... | null | null | null |
xavctn/img2table | train | 15 | b5d31ae19a94de2421c8bec1da696153c95ae551 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 34 | 4 | assert | test_paddle_hocr | # coding: utf-8
import json
import sys
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr.data import OCRDataframe
@pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR")
def test_validators():
from img2table.ocr import PaddleO... | expected | added | 8e941057b115cd4b253ba7e8e07247e38a415badebab5b0bca48c1adcd6e8551 | assert|test_paddle_hocr|# coding: utf-8 import json import sys import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr.data import OCRDataframe @pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR") def test_validators(): from img2table.ocr... | null | null | null |
xavctn/img2table | train | 15 | b5d31ae19a94de2421c8bec1da696153c95ae551 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 49 | 4 | assert | test_paddle_content | # coding: utf-8
import json
import sys
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr.data import OCRDataframe
@pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR")
def test_validators():
from img2table.ocr import PaddleO... | expected | added | a67d4386587a456f95d6a27aab972d423dcc202a49cdad7c12347c7cec75f696 | assert|test_paddle_content|# coding: utf-8 import json import sys import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr.data import OCRDataframe @pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR") def test_validators(): from img2table.... | null | null | null |
xavctn/img2table | train | 15 | b5d31ae19a94de2421c8bec1da696153c95ae551 | train | tests/ocr/paddle/test_paddle.py | train | xavctn/img2table:tests/ocr/paddle/test_paddle.py | 79 | 4 | assert | test_paddle_document | # coding: utf-8
import json
import sys
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr.data import OCRDataframe
@pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR")
def test_validators():
from img2table.ocr import PaddleO... | expected | added | ea6e6aadafe615a868134197a9dace4cba73053a93821ef0dbf1aa2f8c61e32f | assert|test_paddle_document|# coding: utf-8 import json import sys import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr.data import OCRDataframe @pytest.mark.skipif(sys.version_info >= (3, 11), reason="No support for PaddleOCR") def test_validators(): from img2table... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 81 | 8 | assert | test_image_excel | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | expected.worksheets[idx].title | added | e4789a358d551500c0d42b9a1fe79c54503e7d53c5d8ebf03eeb04daadf1c46f | assert|test_image_excel|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Ima... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/document/pdf/test_pdf.py | train | xavctn/img2table:tests/document/pdf/test_pdf.py | 18 | 9 | pytest.raises | test_validators | # coding: utf-8
from io import BytesIO
import pytest
from img2table.document.pdf import PDF
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
pdf = PDF(src=1)
with pytest.raises(TypeError) as e... | TypeError) | modified | 84160e125873347559faa45ab622f262a93b16c49b350e90eacb0301d8f18e87 | pytest.raises|test_validators|# coding: utf-8 from io import BytesIO import pytest from img2table.document.pdf import PDF from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: pdf = PDF(src=1) with pytest.raises(TypeEr... | TypeError) | 20 | 9 |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/document/pdf/test_pdf.py | train | xavctn/img2table:tests/document/pdf/test_pdf.py | 62 | 4 | assert | test_pdf_tables | # coding: utf-8
from io import BytesIO
import pytest
from img2table.document.pdf import PDF
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
pdf = PDF(src=1)
with pytest.raises(TypeError) as e... | BBox(x1=236, y1=249, x2=1442, y2=543) | added | 09e0bc0a70c6d94ed9f65daf3c748c5784b1331eee808f7feb9f3b209c78256a | assert|test_pdf_tables|# coding: utf-8 from io import BytesIO import pytest from img2table.document.pdf import PDF from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: pdf = PDF(src=1) with pytest.raises(TypeError) as... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 21 | 9 | pytest.raises | test_validators | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR, TESSERACT_INSTALL
def test_validators():
with pytest.raises(TypeError) as e_info:
... | TypeError) | added | 07681188a6b4e667e8bd181dec644a4aa5fb259b26519ee1362f6b5c9854f9ce | pytest.raises|test_validators|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR, TESSERACT_INSTALL def test_validators(): with pytest.raises(TypeE... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/tables/processing/bordered_tables/cells/test_deduplication_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_deduplication_cells.py | 14 | 4 | assert | test_deduplicate_nested_cells | # coding: utf-8
import polars as pl
from img2table.tables.processing.bordered_tables.cells.deduplication import deduplicate_nested_cells, \
deduplicate_cells
def test_deduplicate_nested_cells():
df_cells = pl.read_csv("test_data/expected_ident_cells.csv", sep=";", encoding="utf-8").lazy()
result = dedup... | result.frame_equal(expected) | added | f558b02b7d884a0f0d4e4bf8d49f674a266634b5cb86c8aa476ee4387f03be07 | assert|test_deduplicate_nested_cells|# coding: utf-8 import polars as pl from img2table.tables.processing.bordered_tables.cells.deduplication import deduplicate_nested_cells, \ deduplicate_cells def test_deduplicate_nested_cells(): df_cells = pl.read_csv("test_data/expected_ident_cells.csv", sep=";", encoding="utf-8").... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/tables/processing/bordered_tables/cells/test_deduplication_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_deduplication_cells.py | 23 | 4 | assert | test_deduplicate_cells | # coding: utf-8
import polars as pl
from img2table.tables.processing.bordered_tables.cells.deduplication import deduplicate_nested_cells, \
deduplicate_cells
def test_deduplicate_nested_cells():
df_cells = pl.read_csv("test_data/expected_ident_cells.csv", sep=";", encoding="utf-8").lazy()
result = dedup... | result.frame_equal(expected) | added | b61284d462b7a6f1b929648dffe4a4c31f99ade06f4bdb8fdb33ad56215f6059 | assert|test_deduplicate_cells|# coding: utf-8 import polars as pl from img2table.tables.processing.bordered_tables.cells.deduplication import deduplicate_nested_cells, \ deduplicate_cells def test_deduplicate_nested_cells(): df_cells = pl.read_csv("test_data/expected_ident_cells.csv", sep=";", encoding="utf-8").lazy() ... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/tables/processing/bordered_tables/cells/test_identification_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_identification_cells.py | 22 | 4 | assert | test_get_potential_cells_from_h_lines | # coding: utf-8
import json
import polars as pl
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.cells.identification import get_cells_dataframe, \
get_potential_cells_from_h_lines
def test_get_potential_cells_from_h_lines():
with open("test_data/lines.json", '... | result.frame_equal(expected) | added | f2dc36785c1b3e30419bda355d2ba4bf3098c72baf7b06d6685133150f2ad29d | assert|test_get_potential_cells_from_h_lines|# coding: utf-8 import json import polars as pl from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.cells.identification import get_cells_dataframe, \ get_potential_cells_from_h_lines def test_get_potential_cells_from_h_lines(): wi... | null | null | null |
xavctn/img2table | train | 16 | 410bb27db14b4d14d2d8a570f1f953a0d995cd16 | train | tests/tables/processing/bordered_tables/cells/test_identification_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_identification_cells.py | 35 | 4 | assert | test_get_cells_dataframe | # coding: utf-8
import json
import polars as pl
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.cells.identification import get_cells_dataframe, \
get_potential_cells_from_h_lines
def test_get_potential_cells_from_h_lines():
with open("test_data/lines.json", '... | result.frame_equal(expected.sort(['x1', 'y1', 'x2', 'y2'])) | added | af1e051e7a7449d1b6b0328eb698aeaa19e26fd217b7fdfa1f66e5fcefea6677 | assert|test_get_cells_dataframe|# coding: utf-8 import json import polars as pl from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.cells.identification import get_cells_dataframe, \ get_potential_cells_from_h_lines def test_get_potential_cells_from_h_lines(): with open("test... | null | null | null |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/ocr/data/test_ocr_data.py | train | xavctn/img2table:tests/ocr/data/test_ocr_data.py | 40 | 4 | assert | test_get_text_cell | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_text_sizes():
ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr_df.c... | "Use these data to create\nChecklist for a Data Table." | modified | e911adcafeee8392614c08b608254839aa77e11fa51d7e25e57126cd59cc1f56 | assert|test_get_text_cell|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_text_sizes(): ocr_df = OCRDataframe(df=pl.read_csv("... | "Use these data to create\nChecklist for a Data Table." | 40 | 4 |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/objects/test_line.py | test | xavctn/img2table:tests/tables/objects/test_line.py | 22 | 4 | assert | test_reprocess_line | # coding: utf-8
from img2table.tables.objects.line import Line
def test_line():
line = Line(x1=0, y1=20, x2=46, y2=73)
assert round(line.angle) == 49
assert line.width == 46
assert line.height == 53
assert round(line.length) == 70
assert not line.vertical
assert not line.horizontal
def... | reprocessed_line.vertical | modified | c32e78e71813b5047ee6bb32ad38a887f7f46cc562f68d9e075b58fe63801e9f | assert|test_reprocess_line|# coding: utf-8 from img2table.tables.objects.line import Line def test_line(): line = Line(x1=0, y1=20, x2=46, y2=73) assert round(line.angle) == 49 assert line.width == 46 assert line.height == 53 assert round(line.length) == 70 assert not line.vertical assert not line.horizontal def test_r... | reprocessed_line.vertical | 22 | 4 |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/processing/bordered_tables/lines/test_lines.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/lines/test_lines.py | 54 | 4 | assert | test_detect_lines | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.lines import overlapping_filter, detect_lines, remove_word_lines
def test_overlapping_filter():
# Create lines
... | (h_lines_expected, v_lines_expected) | modified | ea68596e1a53088592cf1183b6afb500aa951489e2b83de6856bbe0acaedda8a | assert|test_detect_lines|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.lines import overlapping_filter, detect_lines, remove_word_lines def test_overlapping_filter(): ... | (h_lines_expected, v_lines_expected) | 54 | 4 |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/processing/borderless_tables/lines/test_lines.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/lines/test_lines.py | 66 | 4 | assert | test_vertically_coherent_groups | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.processing.borderless_tables.lines import identify_lines, create_h_pos_groups, \
vertically_coherent_groups, is_text_block, identify_line_groups
from im... | expected | added | 1c6b23541045cda078286d1eebef8d3896a7b016b752a14833432bd96e087101 | assert|test_vertically_coherent_groups|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.processing.borderless_tables.lines import identify_lines, create_h_pos_groups, \ vertically_coherent_groups, is_text_blo... | null | null | null |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/processing/borderless_tables/segment_image/test_segment_image.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/segment_image/test_segment_image.py | 20 | 4 | assert | test_create_image_segments | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.line import Line
from img2table.tables.processing.borderless_tables.model import ImageSegment
from img2table.tables.processing.borderless_tables.segment_image import create_image_segmen... | [ImageSegment(x1=2, y1=0, x2=804, y2=361), ImageSegment(x1=928, y1=0, x2=1188, y2=157)] | added | b69ea03d90c039e8317e00054de1c9ea8b9492a330f55f98bfe0f58098a89c8f | assert|test_create_image_segments|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.line import Line from img2table.tables.processing.borderless_tables.model import ImageSegment from img2table.tables.processing.borderless_tables.segment_... | null | null | null |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/processing/borderless_tables/table/test_headers.py | test | xavctn/img2table:tests/tables/processing/borderless_tables/table/test_headers.py | 122 | 4 | assert | test_identify_table_lines | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.line import Line
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables.table.headers import match_table_elements, check_header_coherency... | [10, 30] | added | 893696183883bed6a81c246d18acdac094900e28486aa4bc15e59ebf9055fc79 | assert|test_identify_table_lines|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.objects.line import Line from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.borderless_tables.table.headers import match_table... | null | null | null |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/processing/borderless_tables/table/test_table.py | val | xavctn/img2table:tests/tables/processing/borderless_tables/table/test_table.py | 47 | 4 | assert | test_identify_table | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.line import Line
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables import identify_table
from img2table.tables.processing.borderless... | expected | added | d1e2ec554864aaf91c0859385e6428187a99a1b10825281461a9d8fa3d158203 | assert|test_identify_table|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.objects.line import Line from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.borderless_tables import identify_table from img2table.t... | null | null | null |
xavctn/img2table | train | 17 | 04801d91d0642c10e6f398fb6e112ec7716f7aa7 | train | tests/tables/processing/borderless_tables/table/test_table_creation.py | train | xavctn/img2table:tests/tables/processing/borderless_tables/table/test_table_creation.py | 23 | 4 | assert | test_reprocess_line_group | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables.model import LineGroup, TableLine
from img2table.tables.processing.borderless_tables.table.table_creation import... | expected | added | 33084745321e1e9b29d98dddb3043e4a7a560a60b46c376745cf66468d4f5e86 | assert|test_reprocess_line_group|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.borderless_tables.model import LineGroup, TableLine from img2table.tables.processing.borderless_t... | null | null | null |
xavctn/img2table | train | 18 | 5da6e5e97fd6546ba35436cb0df0345fc6f5789e | train | tests/tables/processing/borderless_tables/table/test_table.py | val | xavctn/img2table:tests/tables/processing/borderless_tables/table/test_table.py | 47 | 4 | assert | test_identify_table | # coding: utf-8
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.line import Line
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.borderless_tables import identify_table
from img2table.tables.processing.borderless... | expected | added | 19a2f177796821bf1d42dd15a3837033f53ff8037a5ad692dc45b6c1fcd46420 | assert|test_identify_table|# coding: utf-8 from img2table.tables.objects.cell import Cell from img2table.tables.objects.line import Line from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.borderless_tables import identify_table from img2table.t... | null | null | null |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/ocr/data/test_ocr_data.py | train | xavctn/img2table:tests/ocr/data/test_ocr_data.py | 15 | 4 | assert | test_text_sizes | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_text_sizes():
ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr_df.c... | 51.0 | modified | dfb010f1d629f43fde315a709c2c6d02b109e4bf0f0531bb5911be2397696ecc | assert|test_text_sizes|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_text_sizes(): ocr_df = OCRDataframe(df=pl.read_csv("tes... | 51.0 | 15 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/ocr/google_vision/test_google_vision.py | train | xavctn/img2table:tests/ocr/google_vision/test_google_vision.py | 72 | 4 | assert | test_vision_ocr | # coding: utf-8
import json
import os
import pickle
import polars as pl
import pytest
from img2table.document import Image
from img2table.ocr.data import OCRDataframe
from img2table.ocr.google_vision import VisionEndpointContent, VisionAPIContent, VisionOCR
from tests import MOCK_DIR
def test_vision_endpoint_conten... | expected_ocr_df | modified | e5985c99980073a7bf752155fb6e61cf1599cf1f6c810611fcdca759d4e7e453 | assert|test_vision_ocr|# coding: utf-8 import json import os import pickle import polars as pl import pytest from img2table.document import Image from img2table.ocr.data import OCRDataframe from img2table.ocr.google_vision import VisionEndpointContent, VisionAPIContent, VisionOCR from tests import MOCK_DIR def test_vis... | expected_ocr_df | 72 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/ocr/tesseract/test_tesseract.py | train | xavctn/img2table:tests/ocr/tesseract/test_tesseract.py | 77 | 4 | assert | test_tesseract_document | # coding: utf-8
import os
import cv2
import polars as pl
import pytest
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.ocr.data import OCRDataframe
from tests import MOCK_DIR, TESSERACT_INSTALL
def test_validators():
with pytest.raises(TypeError) as e_info:
... | expected | modified | 6eb783c2976af9f2828ad0fdec99d8394eef986490d0435ff0cd22a80bba8396 | assert|test_tesseract_document|# coding: utf-8 import os import cv2 import polars as pl import pytest from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.ocr.data import OCRDataframe from tests import MOCK_DIR, TESSERACT_INSTALL def test_validators(): with pytest.raises(Type... | expected | 77 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/tables/objects/test_table.py | train | xavctn/img2table:tests/tables/objects/test_table.py | 72 | 4 | assert | test_get_table_content | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_remove_rows():
table = Table(rows=[Row(cells=[Cell(x1=0, x2=100, y1=0,... | expected | modified | 010d994b3b13b553b4951710e61c98f218bd7c19c378806ac4426574810c7432 | assert|test_get_table_content|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_remove_rows(): table = Table(rows=[Row(cells=[Ce... | expected | 72 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/tables/processing/bordered_tables/cells/test_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_cells.py | 24 | 4 | assert | test_get_cells | # coding: utf-8
import json
import polars as pl
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.cells import get_cells
def test_get_cells():
with open("test_data/lines.json", 'r') as f:
data = json.load(f)
... | expected | modified | d054678be4e0c9a8f5fe3baf9c2a14048a501d86e527cfd8348657b1f49d4d99 | assert|test_get_cells|# coding: utf-8 import json import polars as pl from img2table.tables.objects.cell import Cell from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.cells import get_cells def test_get_cells(): with open("test_data/lines.json", 'r') as f: data = json.load(... | expected | 24 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/tables/processing/bordered_tables/cells/test_identification_cells.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/cells/test_identification_cells.py | 22 | 4 | assert | test_get_potential_cells_from_h_lines | # coding: utf-8
import json
import polars as pl
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.cells.identification import get_cells_dataframe, \
get_potential_cells_from_h_lines
def test_get_potential_cells_from_h_lines():
with open("test_data/lines.json", '... | result.frame_equal(expected) | modified | 6f75325308aa0b4f8ff6e7d0802b819f521dccd3a9ea8bc40f1ca089269f189f | assert|test_get_potential_cells_from_h_lines|# coding: utf-8 import json import polars as pl from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.cells.identification import get_cells_dataframe, \ get_potential_cells_from_h_lines def test_get_potential_cells_from_h_lines(): wi... | result.frame_equal(expected) | 22 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/tables/processing/bordered_tables/tables/test_implicit_rows.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/tables/test_implicit_rows.py | 49 | 4 | assert | test_handle_implicit_rows | # coding: utf-8
import json
import cv2
import numpy as np
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.bordered_tables.tables... | table.nb_rows + 2 | modified | 47b615f1b6536be12e2dc9e2f7811b751d367f457ac5af8d987cf2bea0ef3865 | assert|test_handle_implicit_rows|# coding: utf-8 import json import cv2 import numpy as np import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.pr... | table.nb_rows + 2 | 49 | 4 |
xavctn/img2table | train | 20 | eb55b9c7b983e022deeb553b81d062fc335c4be5 | train | tests/tables/processing/text/test_titles.py | train | xavctn/img2table:tests/tables/processing/text/test_titles.py | 22 | 4 | assert | test_get_title_tables | # coding: utf-8
import json
import cv2
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
from img2table.tables.processing.text.titles import get_title_tables
def... | "10 most populous countries" | modified | 9ddb6e61cc74084cac56f3fde116be204722fdc57a4e8b9fc1af29590bfadc1a | assert|test_get_title_tables|# coding: utf-8 import json import cv2 import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table from img2table.tables.processing.text.titles im... | "10 most populous countries" | 22 | 4 |
xavctn/img2table | train | 21 | 83741de68609757937f14eb777136763d3c3e2d7 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 76 | 4 | assert | test_image_tables | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | BBox(x1=962, y1=21, x2=1154, y2=123) | added | 550e186b31b4e1f2bf55c5a7d5a6e6951ae833ee3a721e987bd07039cd92ad3f | assert|test_image_tables|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Im... | null | null | null |
xavctn/img2table | train | 21 | 83741de68609757937f14eb777136763d3c3e2d7 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 88 | 4 | assert | test_no_ocr | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | None | added | 420a22feba39a2cf4a10b748ecf262b7563d0c42fc4b75aba7c8434aadd5aacb | assert|test_no_ocr|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Image(sr... | null | null | null |
xavctn/img2table | train | 21 | 83741de68609757937f14eb777136763d3c3e2d7 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 104 | 8 | assert | test_image_excel | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | expected.worksheets[idx].title | added | c4a33f680d13668c7f279309d035c6adb26f9283fb5e6f339557c4ce34f64365 | assert|test_image_excel|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Ima... | null | null | null |
xavctn/img2table | train | 21 | 83741de68609757937f14eb777136763d3c3e2d7 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 105 | 8 | assert | test_image_excel | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | list(expected.worksheets[idx].values) | added | e5100bac45ed9d28fbe4dbf4cd47379245e5b6a4ce9e25069a8e7a8a4fc5fb15 | assert|test_image_excel|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Ima... | null | null | null |
xavctn/img2table | train | 22 | aabfe7c9a3bd542833d76ae196679eb286f02fb1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 73 | 4 | assert | test_image_tables | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | None | modified | a6b946945c50b741286f118e340aaf1a5ff05eae18a2f0af0195ad8c88d0c5e2 | assert|test_image_tables|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Im... | None | 70 | 4 |
xavctn/img2table | train | 22 | aabfe7c9a3bd542833d76ae196679eb286f02fb1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 92 | 4 | assert | test_no_ocr | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | None | modified | 387d331f29b9d53fca010e56fe41af3475750bbec5f29c8eb90f2710a65ac6c4 | assert|test_no_ocr|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Image(sr... | BBox(x1=36, y1=40, x2=840, y2=529) | 89 | 4 |
xavctn/img2table | train | 22 | aabfe7c9a3bd542833d76ae196679eb286f02fb1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 93 | 4 | assert | test_no_ocr | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | BBox(x1=36, y1=40, x2=840, y2=529) | modified | 22449c329d4185c34d0ba356af7b660eac64ef41d29f1b2a238a511e6e693089 | assert|test_no_ocr|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Image(sr... | 19 | 90 | 4 |
xavctn/img2table | train | 22 | aabfe7c9a3bd542833d76ae196679eb286f02fb1 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 109 | 8 | assert | test_image_excel | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | expected.worksheets[idx].title | added | 34fa077266e198d974cf9e972af56cfdc7eec27d9b28926cd20c67e9785f0097 | assert|test_image_excel|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Ima... | null | null | null |
xavctn/img2table | train | 23 | f2a4588dc8c455912e9844e933d8b68aa4f34a38 | train | tests/document/base/test_rotation.py | train | xavctn/img2table:tests/document/base/test_rotation.py | 65 | 4 | assert | test_fix_rotation_image | # coding: utf-8
import cv2
import numpy as np
from sewar import ssim
from img2table.document.base.rotation import rotate_img_with_border, fix_rotation_image, get_connected_components, \
get_relevant_angles, angle_dixon_q_test
def test_get_connected_components():
img = cv2.imread("test_data/test.png", cv2.IMR... | 0.85 | added | 181e3e672f2424f77dbedb1b0bc16b625d245a14e63cf76b7c6dc5c9e9f3ddfb | assert|test_fix_rotation_image|# coding: utf-8 import cv2 import numpy as np from sewar import ssim from img2table.document.base.rotation import rotate_img_with_border, fix_rotation_image, get_connected_components, \ get_relevant_angles, angle_dixon_q_test def test_get_connected_components(): img = cv2.imread("test_dat... | null | null | null |
xavctn/img2table | train | 23 | f2a4588dc8c455912e9844e933d8b68aa4f34a38 | train | tests/document/image/test_image.py | train | xavctn/img2table:tests/document/image/test_image.py | 90 | 4 | assert | test_no_ocr | # coding: utf-8
from io import BytesIO
import pytest
from openpyxl import load_workbook
from img2table.document.image import Image
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
img = Image(src=1... | BBox(x1=36, y1=40, x2=840, y2=529) | modified | aff5dcb863e5512b9653f80154d937d86c4ec64d939da441a7fbe8a282ac4b43 | assert|test_no_ocr|# coding: utf-8 from io import BytesIO import pytest from openpyxl import load_workbook from img2table.document.image import Image from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: img = Image(sr... | BBox(x1=36, y1=40, x2=840, y2=529) | 93 | 4 |
xavctn/img2table | train | 23 | f2a4588dc8c455912e9844e933d8b68aa4f34a38 | train | tests/document/pdf/test_pdf.py | train | xavctn/img2table:tests/document/pdf/test_pdf.py | 63 | 8 | assert | test_pdf_tables | # coding: utf-8
import sys
from io import BytesIO
import pytest
from img2table.document.pdf import PDF
from img2table.ocr import TesseractOCR
from img2table.tables.objects.extraction import BBox
def test_validators():
with pytest.raises(TypeError) as e_info:
pdf = PDF(src=1)
with pytest.raises(Type... | BBox(x1=236, y1=249, x2=1442, y2=543) | added | add85b2a05415481bae7588c2969ce53dce4d47114a1045a796c37aef802dfbe | assert|test_pdf_tables|# coding: utf-8 import sys from io import BytesIO import pytest from img2table.document.pdf import PDF from img2table.ocr import TesseractOCR from img2table.tables.objects.extraction import BBox def test_validators(): with pytest.raises(TypeError) as e_info: pdf = PDF(src=1) with pytest.raises(Ty... | null | null | null |
xavctn/img2table | train | 23 | f2a4588dc8c455912e9844e933d8b68aa4f34a38 | train | tests/ocr/data/test_ocr_data.py | train | xavctn/img2table:tests/ocr/data/test_ocr_data.py | 21 | 4 | assert | test_pages | # coding: utf-8
import json
import polars as pl
from img2table.ocr.data import OCRDataframe
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.row import Row
from img2table.tables.objects.table import Table
def test_pages():
ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr_df.csv", ... | not ocr_df_page_0 == ocr_df_page_1 | added | 418f2ceba7e38f7bef0ef8171bbe95caeef0bfc8bf2d8d4d5329c102364ff304 | assert|test_pages|# coding: utf-8 import json import polars as pl from img2table.ocr.data import OCRDataframe from img2table.tables.objects.cell import Cell from img2table.tables.objects.row import Row from img2table.tables.objects.table import Table def test_pages(): ocr_df = OCRDataframe(df=pl.read_csv("test_data/ocr... | null | null | null |
xavctn/img2table | train | 23 | f2a4588dc8c455912e9844e933d8b68aa4f34a38 | train | tests/ocr/pdf/test_pdf_ocr.py | train | xavctn/img2table:tests/ocr/pdf/test_pdf_ocr.py | 34 | 4 | assert | test_pdf_ocr_df | # coding: utf-8
import json
import polars as pl
from img2table.document.pdf import PDF
from img2table.ocr.data import OCRDataframe
from img2table.ocr.pdf import PdfOCR
def test_pdf_content(mock_tesseract):
instance = PdfOCR()
doc = PDF(src="test_data/test.pdf")
result = instance.content(document=doc)
... | expected | modified | 3ef0bfa9ee2a7af88517c081b676ea91d44402a254ed6f631b38a6f76fd30f15 | assert|test_pdf_ocr_df|# coding: utf-8 import json import polars as pl from img2table.document.pdf import PDF from img2table.ocr.data import OCRDataframe from img2table.ocr.pdf import PdfOCR def test_pdf_content(mock_tesseract): instance = PdfOCR() doc = PDF(src="test_data/test.pdf") result = instance.content(document=... | expected | 34 | 4 |
xavctn/img2table | train | 23 | f2a4588dc8c455912e9844e933d8b68aa4f34a38 | train | tests/tables/processing/bordered_tables/lines/test_lines.py | train | xavctn/img2table:tests/tables/processing/bordered_tables/lines/test_lines.py | 24 | 4 | assert | test_overlapping_filter | # coding: utf-8
import json
import cv2
from img2table.tables.objects.cell import Cell
from img2table.tables.objects.line import Line
from img2table.tables.processing.bordered_tables.lines import overlapping_filter, detect_lines, remove_word_lines
def test_overlapping_filter():
# Create lines
lines = [Line(x... | expected | modified | 2fdd6e47f2b5f4433a78a28704722b08a6e27b01e2851be2abc4796754a7ea85 | assert|test_overlapping_filter|# coding: utf-8 import json import cv2 from img2table.tables.objects.cell import Cell from img2table.tables.objects.line import Line from img2table.tables.processing.bordered_tables.lines import overlapping_filter, detect_lines, remove_word_lines def test_overlapping_filter(): # Create li... | expected | 25 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.