SYMBOL INDEX (433 symbols across 35 files) FILE: benchmarks/test_benchmark_yolox.py class _FakeInput (line 14) | class _FakeInput: method __init__ (line 15) | def __init__(self) -> None: class _FakeSession (line 19) | class _FakeSession: method get_inputs (line 22) | def get_inputs(self): method run (line 25) | def run(self, _names, _inputs): function make_model (line 31) | def make_model() -> UnstructuredYoloXModel: function make_letter_200dpi (line 52) | def make_letter_200dpi() -> PILImage.Image: function run_image_processing (line 56) | def run_image_processing(): function test_benchmark_yolox_image_processing (line 62) | def test_benchmark_yolox_image_processing(benchmark): FILE: examples/ocr/engine.py function remove_non_printable (line 15) | def remove_non_printable(s): function run_ocr_with_layout_detection (line 20) | def run_ocr_with_layout_detection( function run_ocr (line 134) | def run_ocr( FILE: examples/ocr/validate_ocr_performance.py function validate_performance (line 20) | def validate_performance( function compare_processed_text (line 129) | def compare_processed_text(individual_mode_full_text, entire_mode_full_t... function write_report (line 176) | def write_report(report, now_str, validation_mode): function run (line 183) | def run(): FILE: test_unstructured_inference/conftest.py function mock_pil_image (line 14) | def mock_pil_image(): function mock_numpy_image (line 19) | def mock_numpy_image(): function mock_rectangle (line 24) | def mock_rectangle(): function mock_text_region (line 29) | def mock_text_region(): function mock_layout_element (line 34) | def mock_layout_element(): function mock_embedded_text_regions (line 47) | def mock_embedded_text_regions(): function mock_layout (line 124) | def mock_layout(mock_embedded_text_regions): function example_table_cells (line 132) | def example_table_cells(): FILE: test_unstructured_inference/inference/test_layout.py function mock_image (line 26) | def mock_image(): function mock_initial_layout (line 31) | def mock_initial_layout(): function mock_final_layout (line 54) | def mock_final_layout(): function test_pdf_page_converts_images_to_array (line 78) | def test_pdf_page_converts_images_to_array(mock_image): class MockLayoutModel (line 97) | class MockLayoutModel: method __init__ (line 98) | def __init__(self, layout): method __call__ (line 101) | def __call__(self, *args): method initialize (line 104) | def initialize(self, *args, **kwargs): method deduplicate_detected_elements (line 107) | def deduplicate_detected_elements(self, elements, *args, **kwargs): function test_get_page_elements (line 111) | def test_get_page_elements(monkeypatch, mock_final_layout): class MockPool (line 125) | class MockPool: method map (line 126) | def map(self, f, xs): method close (line 129) | def close(self): method join (line 132) | def join(self): function test_process_data_with_model (line 137) | def test_process_data_with_model(monkeypatch, mock_final_layout, model_n... function test_process_data_with_model_raises_on_invalid_model_name (line 162) | def test_process_data_with_model_raises_on_invalid_model_name(): function test_process_file_with_model (line 174) | def test_process_file_with_model(monkeypatch, mock_final_layout, model_n... function test_process_file_no_warnings (line 188) | def test_process_file_no_warnings(monkeypatch, mock_final_layout, recwarn): function test_process_file_with_model_raises_on_invalid_model_name (line 206) | def test_process_file_with_model_raises_on_invalid_model_name(): class MockPoints (line 211) | class MockPoints: method tolist (line 212) | def tolist(self): class MockEmbeddedTextRegion (line 216) | class MockEmbeddedTextRegion(EmbeddedTextRegion): method __init__ (line 217) | def __init__(self, type=None, text=None): method points (line 222) | def points(self): class MockPageLayout (line 226) | class MockPageLayout(layout.PageLayout): method __init__ (line 227) | def __init__( class MockLayout (line 241) | class MockLayout: method __init__ (line 242) | def __init__(self, *elements): method __len__ (line 245) | def __len__(self): method sort (line 248) | def sort(self, key, inplace): method __iter__ (line 251) | def __iter__(self): method get_texts (line 254) | def get_texts(self): method filter_by (line 257) | def filter_by(self, *args, **kwargs): function test_from_image_file (line 263) | def test_from_image_file(monkeypatch, mock_final_layout, filetype, eleme... function test_from_file (line 289) | def test_from_file(monkeypatch, mock_final_layout): function test_from_file_rotated_pdf_stores_rotation_in_metadata (line 318) | def test_from_file_rotated_pdf_stores_rotation_in_metadata(monkeypatch, ... function test_from_file_with_password (line 333) | def test_from_file_with_password(monkeypatch, mock_final_layout): function test_from_image_file_raises_with_empty_fn (line 350) | def test_from_image_file_raises_with_empty_fn(): function test_from_image_file_raises_isadirectoryerror_with_dir (line 355) | def test_from_image_file_raises_isadirectoryerror_with_dir(): function test_page_numbers_in_page_objects (line 360) | def test_page_numbers_in_page_objects(): function test_annotate (line 381) | def test_annotate(colors, add_details, threshold): class MockDetectionModel (line 421) | class MockDetectionModel(layout.UnstructuredObjectDetectionModel): method initialize (line 422) | def initialize(self, *args, **kwargs): method predict (line 425) | def predict(self, x): function test_layout_order (line 463) | def test_layout_order(mock_image): function test_page_layout_raises_when_multiple_models_passed (line 481) | def test_page_layout_raises_when_multiple_models_passed(mock_image, mock... class MockElementExtractionModel (line 492) | class MockElementExtractionModel: method __call__ (line 493) | def __call__(self, x): function test_get_elements_using_image_extraction (line 498) | def test_get_elements_using_image_extraction(mock_image, inplace, expect... function test_get_elements_using_image_extraction_raises_with_no_extraction_model (line 508) | def test_get_elements_using_image_extraction_raises_with_no_extraction_m... function test_get_elements_with_detection_model_raises_with_wrong_default_model (line 516) | def test_get_elements_with_detection_model_raises_with_wrong_default_mod... function test_from_image (line 532) | def test_from_image( class MockUnstructuredElementExtractionModel (line 559) | class MockUnstructuredElementExtractionModel(UnstructuredElementExtracti... method initialize (line 560) | def initialize(self, *args, **kwargs): method predict (line 563) | def predict(self, x: Image): class MockUnstructuredDetectionModel (line 567) | class MockUnstructuredDetectionModel(UnstructuredObjectDetectionModel): method initialize (line 568) | def initialize(self, *args, **kwargs): method predict (line 571) | def predict(self, x: Image): function test_process_file_with_model_routing (line 582) | def test_process_file_with_model_routing(monkeypatch, model_type, is_det... function test_exposed_pdf_image_dpi (line 605) | def test_exposed_pdf_image_dpi(pdf_image_dpi, expected, monkeypatch): function test_convert_pdf_to_image_no_output_folder (line 611) | def test_convert_pdf_to_image_no_output_folder(): function _install_mock_pdfium (line 617) | def _install_mock_pdfium(monkeypatch, *, width=720, height=720): function test_convert_pdf_to_image_rejects_oversized_page_before_render (line 632) | def test_convert_pdf_to_image_rejects_oversized_page_before_render(monke... function test_convert_pdf_to_image_allows_render_guard_to_be_disabled (line 645) | def test_convert_pdf_to_image_allows_render_guard_to_be_disabled(monkeyp... function test_page_hotload_preserves_render_max_pixels_per_page (line 659) | def test_page_hotload_preserves_render_max_pixels_per_page(monkeypatch, ... function test_convert_pdf_to_image_output_folder_returns_images (line 683) | def test_convert_pdf_to_image_output_folder_returns_images(tmp_path): function test_convert_pdf_to_image_path_only (line 696) | def test_convert_pdf_to_image_path_only(tmp_path): function test_convert_pdf_to_image_applies_rotation_path_only (line 712) | def test_convert_pdf_to_image_applies_rotation_path_only(tmp_path): function test_convert_pdf_to_image_no_rotation_on_normal_pdf (line 725) | def test_convert_pdf_to_image_no_rotation_on_normal_pdf(): function test_convert_pdf_to_image_save_not_under_pdfium_lock (line 734) | def test_convert_pdf_to_image_save_not_under_pdfium_lock(tmp_path): function test_convert_pdf_to_image_concurrent_saves_not_serialized (line 754) | def test_convert_pdf_to_image_concurrent_saves_not_serialized(tmp_path): function test_render_can_proceed_while_other_thread_saves (line 810) | def test_render_can_proceed_while_other_thread_saves(tmp_path): function test_multi_page_concurrent_output_complete (line 867) | def test_multi_page_concurrent_output_complete(tmp_path): function test_error_in_one_thread_does_not_block_other (line 906) | def test_error_in_one_thread_does_not_block_other(tmp_path): function test_get_image (line 971) | def test_get_image(filename, img_num, should_complete): FILE: test_unstructured_inference/inference/test_layout_element.py function test_layout_element_to_dict (line 5) | def test_layout_element_to_dict(mock_layout_element): function test_layout_element_from_region (line 18) | def test_layout_element_from_region(mock_rectangle): function test_layoutelement_inheritance_works_correctly (line 25) | def test_layoutelement_inheritance_works_correctly(): FILE: test_unstructured_inference/inference/test_layout_rotation.py function test_convert_pdf_to_image_applies_rotation (line 8) | def test_convert_pdf_to_image_applies_rotation(): FILE: test_unstructured_inference/models/test_detectron2onnx.py class MockDetectron2ONNXLayoutModel (line 11) | class MockDetectron2ONNXLayoutModel: method __init__ (line 12) | def __init__(self, *args, **kwargs): method run (line 16) | def run(self, *args): method get_inputs (line 19) | def get_inputs(self): function test_load_default_model (line 26) | def test_load_default_model(monkeypatch): function test_load_model (line 39) | def test_load_model(model_path, label_map): function test_unstructured_detectron_model (line 48) | def test_unstructured_detectron_model(): function test_inference (line 57) | def test_inference(): FILE: test_unstructured_inference/models/test_eval.py function actual_cells (line 8) | def actual_cells(): function pred_cells (line 85) | def pred_cells(): function actual_df (line 162) | def actual_df(actual_cells): function pred_df (line 167) | def pred_df(pred_cells): function test_compare_content_as_df (line 182) | def test_compare_content_as_df(actual_df, pred_df, eval_func, processor): function test_compare_content_as_df_with_invalid_input (line 187) | def test_compare_content_as_df_with_invalid_input(actual_df, pred_df): FILE: test_unstructured_inference/models/test_model.py class MockModel (line 18) | class MockModel(UnstructuredObjectDetectionModel): method __init__ (line 21) | def __init__(self): method initialize (line 25) | def initialize(self, *args, **kwargs): method predict (line 28) | def predict(self, x: Any) -> Any: function test_get_model (line 39) | def test_get_model(monkeypatch): function test_get_model_threaded (line 45) | def test_get_model_threaded(monkeypatch): function test_get_model_concurrent_different_models (line 88) | def test_get_model_concurrent_different_models(monkeypatch): function test_register_new_model (line 169) | def test_register_new_model(): function test_get_model_with_lazydict_config (line 185) | def test_get_model_with_lazydict_config(monkeypatch): function test_raises_invalid_model (line 220) | def test_raises_invalid_model(): function test_raises_uninitialized (line 225) | def test_raises_uninitialized(): function test_model_initializes_once (line 230) | def test_model_initializes_once(): function test_deduplicate_detected_elements (line 245) | def test_deduplicate_detected_elements(): function test_enhance_regions (line 268) | def test_enhance_regions(): function test_clean_type (line 301) | def test_clean_type(): function test_env_variables_override_default_model (line 332) | def test_env_variables_override_default_model(monkeypatch): function test_env_variables_override_initialization_params (line 347) | def test_env_variables_override_initialization_params(monkeypatch): FILE: test_unstructured_inference/models/test_tables.py function table_transformer (line 24) | def table_transformer(): function test_load_agent (line 29) | def test_load_agent(table_transformer): function example_image (line 34) | def example_image(): function mocked_ocr_tokens (line 39) | def mocked_ocr_tokens(): function test_load_table_model_raises_when_not_available (line 569) | def test_load_table_model_raises_when_not_available(model_path): function test_iob (line 582) | def test_iob(bbox1, bbox2, expected_result): function test_load_donut_model (line 593) | def test_load_donut_model(model_path): function test_nms (line 641) | def test_nms(input_test, output_test): function test_remove_supercell_overlap (line 772) | def test_remove_supercell_overlap(supercell1, supercell2): function test_align_supercells (line 882) | def test_align_supercells(supercells, rows, columns, output_test): function test_align_rows (line 887) | def test_align_rows(rows, bbox, output): function test_table_prediction_output_format (line 908) | def test_table_prediction_output_format( function test_table_prediction_output_format_when_wrong_type_then_value_error (line 943) | def test_table_prediction_output_format_when_wrong_type_then_value_error( function test_table_prediction_runs_with_empty_recognize (line 964) | def test_table_prediction_runs_with_empty_recognize( function test_table_prediction_with_ocr_tokens (line 979) | def test_table_prediction_with_ocr_tokens(table_transformer, example_ima... function test_table_prediction_with_no_ocr_tokens (line 985) | def test_table_prediction_with_no_ocr_tokens(table_transformer, example_... function test_objects_are_filtered_based_on_class_thresholds_when_correct_prediction_and_threshold (line 998) | def test_objects_are_filtered_based_on_class_thresholds_when_correct_pre... function test_objects_are_filtered_based_on_class_thresholds_when_two_classes (line 1018) | def test_objects_are_filtered_based_on_class_thresholds_when_two_classes( function test_objects_filtering_when_missing_threshold (line 1033) | def test_objects_filtering_when_missing_threshold(): function test_intersect (line 1041) | def test_intersect(): function test_include_rect (line 1047) | def test_include_rect(): function test_extract_text_from_spans (line 1151) | def test_extract_text_from_spans(spans, join_with_space, expected): function test_header_supercell_tree (line 1224) | def test_header_supercell_tree(supercells, expected_len): function test_zoom_image (line 1230) | def test_zoom_image(example_image, zoom): function test_cells_to_html (line 1511) | def test_cells_to_html(input_cells, expected_html): function test_fill_cells (line 1761) | def test_fill_cells(input_cells, expected_cells): function test_padded_results_has_right_dimensions (line 1768) | def test_padded_results_has_right_dimensions(table_transformer, example_... function test_compute_confidence_score_zero_division_error_handling (line 1805) | def test_compute_confidence_score_zero_division_error_handling(): function test_subcells_filtering_when_overlapping_spanning_cells (line 1836) | def test_subcells_filtering_when_overlapping_spanning_cells( function test_model_init_is_thread_safe (line 1908) | def test_model_init_is_thread_safe(): FILE: test_unstructured_inference/models/test_yolox.py function test_layout_yolox_local_parsing_image (line 9) | def test_layout_yolox_local_parsing_image(): function test_layout_yolox_local_parsing_pdf (line 32) | def test_layout_yolox_local_parsing_pdf(): function test_layout_yolox_local_parsing_empty_pdf (line 50) | def test_layout_yolox_local_parsing_empty_pdf(): function test_layout_yolox_local_parsing_image_soft (line 63) | def test_layout_yolox_local_parsing_image_soft(): function test_layout_yolox_local_parsing_pdf_soft (line 82) | def test_layout_yolox_local_parsing_pdf_soft(): function test_layout_yolox_local_parsing_empty_pdf_soft (line 94) | def test_layout_yolox_local_parsing_empty_pdf_soft(): FILE: test_unstructured_inference/test_config.py function test_default_config (line 1) | def test_default_config(): function test_env_override (line 7) | def test_env_override(monkeypatch): FILE: test_unstructured_inference/test_elements.py function intersect_brute (line 26) | def intersect_brute(rect1, rect2): function rand_rect (line 34) | def rand_rect(size=10): function test_layoutelements (line 41) | def test_layoutelements(): function test_unhappy_intersection (line 72) | def test_unhappy_intersection(rect1, rect2, expected): function test_intersects (line 78) | def test_intersects(second_size): function test_intersection_of_lots_of_rects (line 100) | def test_intersection_of_lots_of_rects(): function test_rectangle_width_height (line 114) | def test_rectangle_width_height(): function test_minimal_containing_rect (line 125) | def test_minimal_containing_rect(): function test_partition_groups_from_regions (line 145) | def test_partition_groups_from_regions(mock_embedded_text_regions, coord... function test_rectangle_padding (line 157) | def test_rectangle_padding(): function test_rectangle_area (line 164) | def test_rectangle_area(monkeypatch): function test_rectangle_iou (line 184) | def test_rectangle_iou(): function test_midpoints (line 204) | def test_midpoints(): function test_is_disjoint (line 218) | def test_is_disjoint(): function test_intersection_over_min (line 247) | def test_intersection_over_min( function test_grow_region_to_match_region (line 257) | def test_grow_region_to_match_region(): function test_is_almost_subregion_of (line 277) | def test_is_almost_subregion_of(rect1, rect2, expected): function test_separate (line 294) | def test_separate(rect1, rect2): function test_clean_layoutelements (line 300) | def test_clean_layoutelements(test_layoutelements): function test_clean_layoutelements_cases (line 336) | def test_clean_layoutelements_cases( function test_clean_layoutelements_for_class (line 380) | def test_clean_layoutelements_for_class( function test_layoutelements_to_list_and_back (line 396) | def test_layoutelements_to_list_and_back(test_layoutelements): function test_layoutelements_from_list_no_elements (line 407) | def test_layoutelements_from_list_no_elements(): function test_textregions_from_list_no_elements (line 414) | def test_textregions_from_list_no_elements(): function test_layoutelements_concatenate (line 421) | def test_layoutelements_concatenate(): function test_textregions_support_numpy_slicing (line 484) | def test_textregions_support_numpy_slicing(test_elements): function test_textregions_from_list_collects_sources (line 496) | def test_textregions_from_list_collects_sources(): function test_textregions_has_sources_field (line 523) | def test_textregions_has_sources_field(): function test_textregions_iter_elements_preserves_source (line 532) | def test_textregions_iter_elements_preserves_source(): function test_textregions_slice_preserves_sources (line 549) | def test_textregions_slice_preserves_sources(): function test_textregions_post_init_handles_sources (line 577) | def test_textregions_post_init_handles_sources(): function test_textregions_from_coords_accepts_source (line 590) | def test_textregions_from_coords_accepts_source(): function test_textregions_allows_for_single_element_access_and_returns_textregion_with_correct_values (line 602) | def test_textregions_allows_for_single_element_access_and_returns_textre... FILE: test_unstructured_inference/test_logger.py function test_translate_log_level (line 9) | def test_translate_log_level(level): FILE: test_unstructured_inference/test_math.py function test_safe_division (line 11) | def test_safe_division(a, b, expected): FILE: test_unstructured_inference/test_utils.py class MockPageLayout (line 14) | class MockPageLayout: method annotate (line 15) | def annotate(self, annotation_data): class MockDocumentLayout (line 19) | class MockDocumentLayout(DocumentLayout): method pages (line 21) | def pages(self): function test_dict_same (line 25) | def test_dict_same(): function test_lazy_evaluate (line 33) | def test_lazy_evaluate(): function test_caches (line 50) | def test_caches(cache, expected): function test_pad_image_with_background_color (line 67) | def test_pad_image_with_background_color(mock_pil_image): function test_pad_image_with_invalid_input (line 79) | def test_pad_image_with_invalid_input(mock_pil_image): function test_strip_tags (line 94) | def test_strip_tags(html, text): FILE: test_unstructured_inference/test_visualization.py function test_draw_bbox (line 11) | def test_draw_bbox(): function test_show_plot_with_pil_image (line 30) | def test_show_plot_with_pil_image(mock_pil_image): function test_show_plot_with_numpy_image (line 52) | def test_show_plot_with_numpy_image(mock_numpy_image): function test_show_plot_with_unsupported_image_type (line 74) | def test_show_plot_with_unsupported_image_type(): FILE: unstructured_inference/config.py class InferenceConfig (line 14) | class InferenceConfig: method _get_string (line 17) | def _get_string(self, var: str, default_value: str = "") -> str: method _get_int (line 22) | def _get_int(self, var: str, default_value: int) -> int: method _get_float (line 27) | def _get_float(self, var: str, default_value: float) -> float: method TABLE_IMAGE_BACKGROUND_PAD (line 33) | def TABLE_IMAGE_BACKGROUND_PAD(self) -> int: method TT_TABLE_CONF (line 42) | def TT_TABLE_CONF(self) -> float: method TABLE_COLUMN_CONF (line 47) | def TABLE_COLUMN_CONF(self) -> float: method TABLE_ROW_CONF (line 52) | def TABLE_ROW_CONF(self) -> float: method TABLE_COLUMN_HEADER_CONF (line 57) | def TABLE_COLUMN_HEADER_CONF(self) -> float: method TABLE_PROJECTED_ROW_HEADER_CONF (line 62) | def TABLE_PROJECTED_ROW_HEADER_CONF(self) -> float: method TABLE_SPANNING_CELL_CONF (line 67) | def TABLE_SPANNING_CELL_CONF(self) -> float: method TABLE_IOB_THRESHOLD (line 72) | def TABLE_IOB_THRESHOLD(self) -> float: method LAYOUT_SAME_REGION_THRESHOLD (line 78) | def LAYOUT_SAME_REGION_THRESHOLD(self) -> float: method LAYOUT_SUBREGION_THRESHOLD (line 87) | def LAYOUT_SUBREGION_THRESHOLD(self) -> float: method ELEMENTS_H_PADDING_COEF (line 96) | def ELEMENTS_H_PADDING_COEF(self) -> float: method ELEMENTS_V_PADDING_COEF (line 105) | def ELEMENTS_V_PADDING_COEF(self) -> float: method IMG_PROCESSOR_LONGEST_EDGE (line 110) | def IMG_PROCESSOR_LONGEST_EDGE(self) -> int: method IMG_PROCESSOR_SHORTEST_EDGE (line 115) | def IMG_PROCESSOR_SHORTEST_EDGE(self) -> int: method PDF_RENDER_MAX_PIXELS_PER_PAGE (line 120) | def PDF_RENDER_MAX_PIXELS_PER_PAGE(self) -> int: FILE: unstructured_inference/constants.py class Source (line 4) | class Source(Enum): class IsExtracted (line 10) | class IsExtracted(Enum): class ElementType (line 16) | class ElementType: FILE: unstructured_inference/inference/elements.py class Rectangle (line 15) | class Rectangle: method pad (line 21) | def pad(self, padding: Union[int, float]): method hpad (line 27) | def hpad(self, padding: Union[int, float]): method vpad (line 35) | def vpad(self, padding: Union[int, float]): method width (line 44) | def width(self) -> Union[int, float]: method height (line 49) | def height(self) -> Union[int, float]: method x_midpoint (line 54) | def x_midpoint(self) -> Union[int, float]: method y_midpoint (line 59) | def y_midpoint(self) -> Union[int, float]: method is_disjoint (line 63) | def is_disjoint(self, other: Rectangle) -> bool: method intersects (line 67) | def intersects(self, other: Rectangle) -> bool: method is_in (line 73) | def is_in(self, other: Rectangle, error_margin: Optional[Union[int, fl... method _has_none (line 85) | def _has_none(self) -> bool: method coordinates (line 90) | def coordinates(self): method intersection (line 94) | def intersection(self, other: Rectangle) -> Optional[Rectangle]: method area (line 108) | def area(self) -> float: method intersection_over_union (line 112) | def intersection_over_union(self, other: Rectangle) -> float: method intersection_over_minimum (line 121) | def intersection_over_minimum(self, other: Rectangle) -> float: method is_almost_subregion_of (line 130) | def is_almost_subregion_of(self, other: Rectangle, subregion_threshold... function minimal_containing_region (line 141) | def minimal_containing_region(*regions: Rectangle) -> Rectangle: function intersections (line 151) | def intersections(*rects: Rectangle): function coords_intersections (line 160) | def coords_intersections(coords: np.ndarray) -> np.ndarray: class TextRegion (line 184) | class TextRegion: method __str__ (line 190) | def __str__(self) -> str: method from_coords (line 194) | def from_coords( class TextRegions (line 212) | class TextRegions: method __post_init__ (line 230) | def __post_init__(self): method __getitem__ (line 248) | def __getitem__(self, indices) -> TextRegions: method slice (line 251) | def slice(self, indices) -> TextRegions: method iter_elements (line 266) | def iter_elements(self): method as_list (line 277) | def as_list(self): method from_list (line 282) | def from_list(cls, regions: list): method __len__ (line 298) | def __len__(self): method x1 (line 302) | def x1(self): method y1 (line 307) | def y1(self): method x2 (line 312) | def x2(self): method y2 (line 317) | def y2(self): method areas (line 322) | def areas(self) -> np.ndarray: class EmbeddedTextRegion (line 327) | class EmbeddedTextRegion(TextRegion): class ImageTextRegion (line 331) | class ImageTextRegion(TextRegion): function region_bounding_boxes_are_almost_the_same (line 335) | def region_bounding_boxes_are_almost_the_same( function grow_region_to_match_region (line 345) | def grow_region_to_match_region(region_to_grow: Rectangle, region_to_mat... FILE: unstructured_inference/inference/layout.py class DocumentLayout (line 29) | class DocumentLayout: method __init__ (line 34) | def __init__(self, pages=None): method __str__ (line 37) | def __str__(self) -> str: method pages (line 41) | def pages(self) -> List[PageLayout]: method from_pages (line 46) | def from_pages(cls, pages: List[PageLayout]) -> DocumentLayout: method from_file (line 53) | def from_file( method from_image_file (line 95) | def from_image_file( class PageLayout (line 133) | class PageLayout: method __init__ (line 136) | def __init__( method __str__ (line 167) | def __str__(self) -> str: method elements (line 171) | def elements(self) -> Collection[LayoutElement]: method get_elements_using_image_extraction (line 178) | def get_elements_using_image_extraction( method get_elements_with_detection_model (line 194) | def get_elements_with_detection_model( method _get_image_array (line 224) | def _get_image_array(self) -> Union[np.ndarray[Any, Any], None]: method annotate (line 234) | def annotate( method _get_image (line 286) | def _get_image(self, filename, page_number, pdf_image_dpi: int = 200) ... method from_image (line 307) | def from_image( function process_data_with_model (line 350) | def process_data_with_model( function process_file_with_model (line 378) | def process_file_with_model( FILE: unstructured_inference/inference/layoutelement.py class LayoutElements (line 23) | class LayoutElements(TextRegions): method __post_init__ (line 53) | def __post_init__(self): method __eq__ (line 57) | def __eq__(self, other: object) -> bool: method __getitem__ (line 81) | def __getitem__(self, indices): method slice (line 84) | def slice(self, indices) -> LayoutElements: method concatenate (line 100) | def concatenate(cls, groups: Iterable[LayoutElements]) -> LayoutElements: method iter_elements (line 139) | def iter_elements(self): method from_list (line 183) | def from_list(cls, elements: list): class LayoutElement (line 238) | class LayoutElement(TextRegion): method to_dict (line 247) | def to_dict(self) -> dict: method from_region (line 260) | def from_region(cls, region: TextRegion): method from_coords (line 277) | def from_coords( function separate (line 309) | def separate(region_a: Rectangle, region_b: Rectangle): function table_cells_to_dataframe (line 349) | def table_cells_to_dataframe( function partition_groups_from_regions (line 370) | def partition_groups_from_regions(regions: TextRegions) -> List[TextRegi... function intersection_areas_between_coords (line 393) | def intersection_areas_between_coords( function clean_layoutelements (line 410) | def clean_layoutelements(elements: LayoutElements, subregion_threshold: ... function clean_layoutelements_for_class (line 474) | def clean_layoutelements_for_class( FILE: unstructured_inference/inference/pdf_image.py class PdfRenderTooLargeError (line 19) | class PdfRenderTooLargeError(ValueError): function _check_pdf_render_max_pixels (line 23) | def _check_pdf_render_max_pixels(page, page_number: int, scale: float, m... function _get_pdfium_module (line 40) | def _get_pdfium_module(): function convert_pdf_to_image (line 46) | def convert_pdf_to_image( FILE: unstructured_inference/logger.py function translate_log_level (line 4) | def translate_log_level(level: int) -> int: FILE: unstructured_inference/math.py function safe_division (line 8) | def safe_division(a, b) -> float: FILE: unstructured_inference/models/base.py class Models (line 20) | class Models(object): method __new__ (line 35) | def __new__(cls): method __contains__ (line 44) | def __contains__(self, key): method __getitem__ (line 48) | def __getitem__(self, key: str): method __setitem__ (line 52) | def __setitem__(self, key: str, value: UnstructuredModel): function get_default_model_mappings (line 68) | def get_default_model_mappings() -> Tuple[ function register_new_model (line 82) | def register_new_model(model_config: dict, model_class: UnstructuredModel): function get_model (line 91) | def get_model(model_name: Optional[str] = None) -> UnstructuredModel: class UnknownModelException (line 151) | class UnknownModelException(Exception): FILE: unstructured_inference/models/detectron2onnx.py class UnstructuredDetectronONNXModel (line 68) | class UnstructuredDetectronONNXModel(UnstructuredObjectDetectionModel): method predict (line 75) | def predict(self, image: Image.Image) -> List[LayoutElement]: method initialize (line 97) | def initialize( method preprocess (line 128) | def preprocess(self, image: Image.Image) -> Dict[str, np.ndarray]: method postprocess (line 147) | def postprocess( FILE: unstructured_inference/models/eval.py function _join_df_content (line 15) | def _join_df_content(df, tab_token="\t", row_break_token="\n") -> str: function default_tokenizer (line 20) | def default_tokenizer(text: str) -> List[str]: function compare_contents_as_df (line 25) | def compare_contents_as_df( FILE: unstructured_inference/models/table_postprocess.py class Rect (line 9) | class Rect: method __init__ (line 10) | def __init__(self, bbox=None): method get_area (line 22) | def get_area(self): method intersect (line 27) | def intersect(self, other): method include_rect (line 48) | def include_rect(self, bbox): method get_bbox (line 72) | def get_bbox(self): function apply_threshold (line 77) | def apply_threshold(objects, threshold): function refine_rows (line 84) | def refine_rows(rows, tokens, score_threshold): function refine_columns (line 101) | def refine_columns(columns, tokens, score_threshold): function nms_by_containment (line 123) | def nms_by_containment(container_objects, package_objects, overlap_thres... function slot_into_containers (line 152) | def slot_into_containers( function sort_objects_by_score (line 202) | def sort_objects_by_score(objects, reverse=True): function remove_objects_without_content (line 209) | def remove_objects_without_content(page_spans, objects): function extract_text_inside_bbox (line 220) | def extract_text_inside_bbox(spans, bbox): function get_bbox_span_subset (line 230) | def get_bbox_span_subset(spans, bbox, threshold=0.5): function overlaps (line 243) | def overlaps(bbox1, bbox2, threshold=0.5): function extract_text_from_spans (line 254) | def extract_text_from_spans(spans, join_with_space=True, remove_integer_... function sort_objects_left_to_right (line 304) | def sort_objects_left_to_right(objs): function sort_objects_top_to_bottom (line 311) | def sort_objects_top_to_bottom(objs): function align_columns (line 318) | def align_columns(columns, bbox): function align_rows (line 334) | def align_rows(rows, bbox): function nms (line 350) | def nms(objects, match_criteria="object2_overlap", match_threshold=0.05,... function align_supercells (line 395) | def align_supercells(supercells, rows, columns): function nms_supercells (line 509) | def nms_supercells(supercells): function header_supercell_tree (line 536) | def header_supercell_tree(supercells): function remove_supercell_overlap (line 564) | def remove_supercell_overlap(supercell1, supercell2): FILE: unstructured_inference/models/tables.py class UnstructuredTableTransformerModel (line 30) | class UnstructuredTableTransformerModel(UnstructuredModel): method __new__ (line 36) | def __new__(cls): method predict (line 44) | def predict( method initialize (line 68) | def initialize( method get_structure (line 123) | def get_structure( method run_prediction (line 139) | def run_prediction( function load_agent (line 177) | def load_agent(): function get_class_map (line 189) | def get_class_map(data_type: str): function recognize (line 218) | def recognize(outputs: TableTransformerObjectDetectionOutput, img: PILIm... function outputs_to_objects (line 233) | def outputs_to_objects( function apply_thresholds_on_objects (line 268) | def apply_thresholds_on_objects( function box_cxcywh_to_xyxy (line 296) | def box_cxcywh_to_xyxy(x): function rescale_bboxes (line 304) | def rescale_bboxes(out_bbox, size): function iob (line 312) | def iob(bbox1, bbox2): function objects_to_structures (line 325) | def objects_to_structures(objects, tokens, class_thresholds): function refine_table_structure (line 409) | def refine_table_structure(table_structure, class_thresholds): function align_headers (line 458) | def align_headers(headers, rows): function compute_confidence_score (line 508) | def compute_confidence_score(cell_match_scores): function structure_to_cells (line 522) | def structure_to_cells(table_structure, tokens): function fill_cells (line 697) | def fill_cells(cells: List[dict]) -> List[dict]: function cells_to_html (line 746) | def cells_to_html(cells: List[dict]) -> str: function zoom_image (line 799) | def zoom_image(image: PILImage.Image, zoom: float) -> PILImage.Image: FILE: unstructured_inference/models/unstructuredmodel.py class UnstructuredModel (line 23) | class UnstructuredModel(ABC): method __init__ (line 26) | def __init__(self): method predict (line 34) | def predict(self, x: Any) -> Any: method __call__ (line 43) | def __call__(self, x: Any) -> Any: method initialize (line 48) | def initialize(self, *args, **kwargs): class UnstructuredObjectDetectionModel (line 53) | class UnstructuredObjectDetectionModel(UnstructuredModel): method predict (line 57) | def predict(self, x: Image) -> LayoutElements | list[LayoutElement]: method __call__ (line 62) | def __call__(self, x: Image) -> LayoutElements: method enhance_regions (line 67) | def enhance_regions( method clean_type (line 130) | def clean_type( method deduplicate_detected_elements (line 168) | def deduplicate_detected_elements( class UnstructuredElementExtractionModel (line 188) | class UnstructuredElementExtractionModel(UnstructuredModel): method predict (line 192) | def predict(self, x: Image) -> List[LayoutElement]: method __call__ (line 197) | def __call__(self, x: Image) -> List[LayoutElement]: class ModelNotInitializedError (line 202) | class ModelNotInitializedError(Exception): FILE: unstructured_inference/models/yolox.py class UnstructuredYoloXModel (line 65) | class UnstructuredYoloXModel(UnstructuredObjectDetectionModel): method predict (line 66) | def predict(self, x: PILImage.Image): method initialize (line 71) | def initialize(self, model_path: str, label_map: dict): method image_processing (line 90) | def image_processing( function preprocess (line 154) | def preprocess(img, input_size, swap=(2, 0, 1)): function demo_postprocess (line 174) | def demo_postprocess(outputs, img_size, p6=False): function multiclass_nms (line 199) | def multiclass_nms(boxes, scores, nms_thr, score_thr, class_agnostic=True): function multiclass_nms_class_agnostic (line 209) | def multiclass_nms_class_agnostic(boxes, scores, nms_thr, score_thr): function nms (line 226) | def nms(boxes, scores, nms_thr): FILE: unstructured_inference/utils.py class LazyEvaluateInfo (line 13) | class LazyEvaluateInfo: method __init__ (line 18) | def __init__(self, evaluate: Callable, *args, **kwargs): class LazyDict (line 23) | class LazyDict(Mapping): method __init__ (line 31) | def __init__(self, *args, cache=True, **kwargs): method __getitem__ (line 35) | def __getitem__(self, key: Hashable) -> Union[LazyEvaluateInfo, Any]: method __iter__ (line 45) | def __iter__(self) -> Iterator: method __len__ (line 48) | def __len__(self) -> int: function tag (line 52) | def tag(elements: Iterable[LayoutElement]): function pad_image_with_background_color (line 63) | def pad_image_with_background_color( class MLStripper (line 82) | class MLStripper(HTMLParser): method __init__ (line 85) | def __init__(self): method handle_data (line 92) | def handle_data(self, d): method get_data (line 96) | def get_data(self): function strip_tags (line 101) | def strip_tags(html: str) -> str: function download_if_needed_and_get_local_path (line 108) | def download_if_needed_and_get_local_path(path_or_repo: str, filename: s... FILE: unstructured_inference/visualize.py function draw_bbox (line 17) | def draw_bbox( function show_plot (line 44) | def show_plot(