5ab9bebaa63b1615cbc1e98184f17e4d67e90e73,calamari_ocr/ocr/datasets/pagexml_dataset/dataset.py,PageXMLDatasetGenerator,_load_sample,#PageXMLDatasetGenerator#Any#Any#,35
Before Change
img = None
if self.mode == DataSetMode.PREDICT or self.mode == DataSetMode.TRAIN or self.mode == DataSetMode.PRED_AND_EVAL:
img = np.array(Image.open(image_path))
for sample in loader.load(image_path, xml_path):
text = sample["text"]
orientation = sample["orientation"]
After Change
img = None
if self.mode == DataSetMode.PREDICT or self.mode == DataSetMode.TRAIN or self.mode == DataSetMode.PRED_AND_EVAL:
img = load_image(image_path)
for sample in loader.load(image_path, xml_path):
text = sample["text"]
orientation = sample["orientation"]

In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 4
Instances
Project Name: Calamari-OCR/calamari
Commit Name: 5ab9bebaa63b1615cbc1e98184f17e4d67e90e73
Time: 2021-01-13
Author: wick.chr@gmail.com
File Name: calamari_ocr/ocr/datasets/pagexml_dataset/dataset.py
Class Name: PageXMLDatasetGenerator
Method Name: _load_sample
Project Name: Calamari-OCR/calamari
Commit Name: a41acdfb871bc90599cb6c488afb5ed6f3dc2fd9
Time: 2021-01-19
Author: wick.chr@gmail.com
File Name: calamari_ocr/test/test_prediction.py
Class Name: TestValidationTrain
Method Name: test_raw_prediction
Project Name: Calamari-OCR/calamari
Commit Name: a41acdfb871bc90599cb6c488afb5ed6f3dc2fd9
Time: 2021-01-19
Author: wick.chr@gmail.com
File Name: calamari_ocr/test/test_prediction.py
Class Name: TestValidationTrain
Method Name: test_raw_prediction_voted
Project Name: Calamari-OCR/calamari
Commit Name: a41acdfb871bc90599cb6c488afb5ed6f3dc2fd9
Time: 2021-01-19
Author: wick.chr@gmail.com
File Name: calamari_ocr/ocr/dataset/datareader/pagexml/reader.py
Class Name: PageXMLReader
Method Name: _load_sample