MCPcopy Create free account

hub / github.com/JonasSchatz/DepixHMM / functions

Functions93 in github.com/JonasSchatz/DepixHMM

↓ 7 callersFunctioncreate_training_data
Generates the data required for training the HMM.
text_depixelizer/training_pipeline/training_pipeline.py:15
↓ 6 callersFunctionget_overlap
(reconstructed_data: List[str], new_characters: Tuple[str, ...])
text_depixelizer/HMM/hmm_result_reconstructor.py:38
↓ 5 callersFunctiondepix_hmm
(picture_parameters: PictureParameters, training_parameters: TrainingParameters, l
text_depixelizer/depix_hmm.py:20
↓ 5 callersFunctiongenerate_image_from_text
(text: str, options: ImageCreationOptions)
text_depixelizer/training_pipeline/original_image.py:42
↓ 5 callersFunctionpixelize_image
(original_image: OriginalImage, pixelization_options: PixelizationOptions)
text_depixelizer/training_pipeline/pixelized_image.py:43
↓ 5 callersMethodtrain
(self)
text_depixelizer/HMM/depix_hmm.py:30
↓ 4 callersFunctiondetermine_number_of_tiles
(text_width, font_metrics, offset: Tuple[int, int], block_size: int)
text_depixelizer/training_pipeline/pixelized_image.py:25
↓ 4 callersMethodtest_image
Takes a pixelized image and reconstructs the hidden string
text_depixelizer/HMM/depix_hmm.py:80
↓ 3 callersFunctiondetermine_origin
(padding: Tuple[int, int], font_metrics: Tuple[int, int], offset: Tuple[int, int], block_size: int)
text_depixelizer/training_pipeline/pixelized_image.py:32
↓ 3 callersMethodevaluate
Generates test data and checks it with the already trained model. Returns two values: - Accuracy: Percentage of correctly reconstruct
text_depixelizer/HMM/depix_hmm.py:119
↓ 3 callersMethodlog_viterbi
(self, sequence: List[Any])
text_depixelizer/HMM/hmm.py:70
↓ 3 callersFunctionreconstruct_string_from_window_characters
Reconstruct the string from the HMM results, e.g. [('a', 'b'), ('b', 'c')] -> 'abc'
text_depixelizer/HMM/hmm_result_reconstructor.py:6
↓ 3 callersMethodviterbi
(self, sequence: List[Any])
text_depixelizer/HMM/hmm.py:49
↓ 2 callersMethodcalculate_hmm_properties
Takes a flattened list of windows to determine the probability matrices of the hidden markov model Note that the windows have to be c
text_depixelizer/HMM/depix_hmm.py:59
↓ 2 callersMethodcreate_random_hmm
Returns a HMM object with random probabilities
test/HMM/test_hmm.py:11
↓ 2 callersFunctioncreate_windows_from_image
(original_image: OriginalImage, pixelized_image: PixelizedImage, window_options: WindowOptions)
text_depixelizer/training_pipeline/windows.py:32
↓ 2 callersFunctiondepix_hmm_grid_search
(picture_parameters_grid_search: PictureParametersGridSearch, training_parameters_gr
text_depixelizer/depix_hmm.py:43
↓ 2 callersFunctiongenerate_character_bounding_boxes
Calculate the bounding boxes for every character. Source: https://github.com/python-pillow/Pillow/issues/3921
text_depixelizer/training_pipeline/original_image.py:56
↓ 2 callersMethodgenerate_text
(self)
text_depixelizer/training_pipeline/text_generator.py:19
↓ 2 callersFunctioninit_logging
(logging_parameters: LoggingParameters)
text_depixelizer/depix_hmm.py:14
↓ 2 callersFunctioninterval_overlap
Calculate the overlap between two intervals Example: a=(10, 30) and b=(20, 40) gives an overlap of 10
text_depixelizer/training_pipeline/windows.py:24
↓ 2 callersFunctionpixelize_area
Pixelize an area of an image, given the parameters
text_depixelizer/training_pipeline/pixelized_image.py:73
↓ 2 callersMethodtest_cluster_indices
(self, indices: List[int])
text_depixelizer/HMM/depix_hmm.py:113
↓ 1 callersFunctioncreate_random_mosaic
Create an image of size img_size that consists of blocks of size block_size. It is assured that all blocks have a different color
test/utils.py:11
↓ 1 callersFunctiondraw_character_bounding_boxes
Return a copy of an original image with the character bounding boxes drawn onto it for visualization
text_depixelizer/training_pipeline/original_image.py:76
↓ 1 callersFunctiongenerate_original_images
Given a list of texts and a font, generate images with that text and font Padding will be added around the text to allow space for pixelizati
text_depixelizer/training_pipeline/training_pipeline.py:56
↓ 1 callersFunctiongenerate_pixelized_images
Pixelizes the original images with the given block_size. By default, the pixelization is in line with the baseline of the text and the right
text_depixelizer/training_pipeline/training_pipeline.py:84
↓ 1 callersMethodgenerate_text
(self)
text_depixelizer/training_pipeline/text_generator.py:28
↓ 1 callersFunctiongenerate_texts
Generates n_img strings that follow the given regex pattern
text_depixelizer/training_pipeline/training_pipeline.py:40
↓ 1 callersFunctiongenerate_windows
Generates the windows from the pixelized images. Note: The information from the original images is also needed, since we need to infer the ch
text_depixelizer/training_pipeline/training_pipeline.py:112
↓ 1 callersFunctionget_average_color
(img: Image)
text_depixelizer/training_pipeline/pixelized_image.py:39
↓ 1 callersMethodget_emission_probabilities
Calculate the probability that state X emits symbol Y and save the (row-wise) normalized sum in emission_probabilities[X, Y]
text_depixelizer/HMM/depix_hmm.py:189
↓ 1 callersMethodget_starting_probabilities
Calculate the probability of starting in state X
text_depixelizer/HMM/depix_hmm.py:151
↓ 1 callersMethodget_transition_probabilities
From the given windows, count how many times state X follows state Y and save the (row-wise) normalized sum in transition_probabiliti
text_depixelizer/HMM/depix_hmm.py:162
↓ 1 callersFunctionlevenshteinDistance
https://stackoverflow.com/questions/2460177/edit-distance-in-python
text_depixelizer/HMM/hmm_result_reconstructor.py:54
↓ 1 callersMethodmap_values_to_cluster
(self, values: List[np.array])
text_depixelizer/HMM/clusterer.py:18
↓ 1 callersMethodmap_values_to_cluster
(self, values: List[np.array])
text_depixelizer/HMM/clusterer.py:36
↓ 1 callersMethodmap_windows_to_cluster
(self, windows: List[Window])
text_depixelizer/HMM/clusterer.py:14
↓ 1 callersMethodmap_windows_to_cluster
(self, windows: List[Window])
text_depixelizer/HMM/clusterer.py:30
↓ 1 callersMethodprint_states
(self)
text_depixelizer/HMM/depix_hmm.py:206
↓ 1 callersFunctionstring_similarity
Modified edit distance, normalizing the Levenshtein distance between 0 and 1, where 1 indicates a perfect match of the recovered string to th
text_depixelizer/HMM/hmm_result_reconstructor.py:46
↓ 1 callersMethodtest_windows
Takes a list of clustered windows and returns the most likely sequence of characters
text_depixelizer/HMM/depix_hmm.py:106
Method__init__
(self, picture_parameters: PictureParameters, training_parameters: TrainingParameters)
text_depixelizer/HMM/depix_hmm.py:26
Method__init__
(self, windows: List[Window], k: int)
text_depixelizer/HMM/clusterer.py:24
Method__init__
(self, pattern: str)
text_depixelizer/training_pipeline/text_generator.py:16
Method__init__
(self, text_length: int)
text_depixelizer/training_pipeline/text_generator.py:25
Functioncreate_image
(text: str, padding: Tuple[int, int] = (30, 30), font_size: int = 50)
test/utils.py:36
Methodfont_metrics
(self)
text_depixelizer/training_pipeline/original_image.py:37
Methodgenerate_text
(self)
text_depixelizer/training_pipeline/text_generator.py:10
Methodlog_emission_probabilities
(self)
text_depixelizer/HMM/hmm.py:30
Methodlog_starting_probabilities
(self)
text_depixelizer/HMM/hmm.py:22
Methodlog_transition_probabilities
(self)
text_depixelizer/HMM/hmm.py:26
Functionshow_font_metrics
(picture_parameters: PictureParameters)
text_depixelizer/preprocessing.py:11
Methodtest_bank_account_experiment_original
Repeating the experiments from Ch. 3.3 of the original publication. It is one of the simplest tasks: Redacted text consists of exactl
experiments/experiment_bank_account_numbers.py:13
Methodtest_check_overlap_complete
(self)
test/HMM/test_hmm_result_reconstructor.py:47
Methodtest_check_overlap_empty_reconstructed_data
(self)
test/HMM/test_hmm_result_reconstructor.py:83
Methodtest_check_overlap_no_overlap
(self)
test/HMM/test_hmm_result_reconstructor.py:71
Methodtest_check_overlap_partial
(self)
test/HMM/test_hmm_result_reconstructor.py:59
Methodtest_check_overlap_partially_empty_reconstructed_data
(self)
test/HMM/test_hmm_result_reconstructor.py:95
Methodtest_compare_viterbi_and_log
Regular viterbi and log-viterbi should return the same values (for shorter sequences)
test/HMM/test_hmm.py:81
Methodtest_create_image
(self)
test/training_pipeline/test_original_image.py:18
Methodtest_create_training_data
(self)
test/training_pipeline/test_training_pipeline.py:11
Methodtest_create_training_data_random_offset
(self)
test/training_pipeline/test_training_pipeline.py:33
Methodtest_depix_hmm_grid_search
(self)
test/test_depix_hmm.py:14
Methodtest_determine_number_of_tiles_no_offset
(self)
test/training_pipeline/test_pixelize_image.py:20
Methodtest_determine_number_of_tiles_y_offset_large
(self)
test/training_pipeline/test_pixelize_image.py:46
Methodtest_determine_number_of_tiles_y_offset_small
(self)
test/training_pipeline/test_pixelize_image.py:33
Methodtest_determine_origin_no_offset
(self)
test/training_pipeline/test_pixelize_image.py:59
Methodtest_determine_origin_y_offset_small
(self)
test/training_pipeline/test_pixelize_image.py:72
Methodtest_draw_character_bounding_boxes
(self)
test/training_pipeline/test_original_image.py:47
Methodtest_evaluate
(self)
test/HMM/test_depix_hmm.py:36
Methodtest_generate_character_bounding_boxes
(self)
test/training_pipeline/test_original_image.py:31
Methodtest_generate_sample_images
(self)
experiments/experiment_generate_sample_images.py:14
Methodtest_get_starting_probabilities
(self)
test/HMM/test_depix_hmm.py:50
Methodtest_increasing_sample_images
(self)
experiments/experiment_accuracy.py:13
Methodtest_interval_overlap
(self)
test/training_pipeline/test_windows.py:12
Methodtest_issue_001
(self)
experiments/issue_001/experiment_issue_001.py:15
Methodtest_kmeans_fit
(self)
test/HMM/test_clusterer.py:10
Methodtest_number_text_generator
(self)
test/training_pipeline/test_text_generator.py:22
Methodtest_pixelize_image
(self)
test/training_pipeline/test_pixelize_image.py:85
Methodtest_pixelize_image_correct_offset
(self)
test/training_pipeline/test_pixelize_image.py:101
Methodtest_randomize_offset_x
(self)
test/training_pipeline/test_pixelize_image.py:119
Methodtest_randomize_offset_y
(self)
test/training_pipeline/test_pixelize_image.py:137
Methodtest_reconstruct_string_from_window_characters_seven_duplicates
(self)
test/HMM/test_hmm_result_reconstructor.py:29
Methodtest_reconstruct_string_from_window_characters_two_duplicates
(self)
test/HMM/test_hmm_result_reconstructor.py:11
Methodtest_regex_text_generator_digits
(self)
test/training_pipeline/test_text_generator.py:8
Methodtest_test_image
(self)
test/HMM/test_depix_hmm.py:86
Methodtest_train
(self)
test/HMM/test_depix_hmm.py:23
Methodtest_viterbi
(self)
test/HMM/test_hmm.py:38
Methodtest_viterbi_fail_for_numerical_underflow
When the observation sequence gets too long, the regular viterbi will fail due to numerical underflow
test/HMM/test_hmm.py:57
Methodtest_window_creation
(self)
test/training_pipeline/test_windows.py:30
Methodtext_size
(self)
text_depixelizer/training_pipeline/original_image.py:33
Methodvalidate_attributes
(self)
text_depixelizer/HMM/hmm.py:33