1b305c86dc2ff6b3461c42f4428460b66a8bff8b,calamari_ocr/ocr/backends/tensorflow_backend/tensorflow_model.py,TensorflowModel,predict_dataset,#TensorflowModel#Any#,350
Before Change
dataset_gen,
)
for softmax, params, output_seq_len in zip(*out):
softmax = np.roll(softmax, 1, axis=1) // fix bla
// decode encoded params from json. On python<=3.5 this are bytes, else it already is a str
enc_param = params[0]
enc_param = json.loads(enc_param.decode("utf-8") if isinstance(enc_param, bytes) else enc_param)
decoded = self.ctc_decoder.decode(softmax[:output_seq_len[0]])
// return prediction result
yield NetworkPredictionResult(softmax=softmax,
output_length=output_seq_len,
decoded=decoded,
After Change
def predict_dataset(self, dataset) -> Generator[NetworkPredictionResult, None, None]:
dataset_gen = self.create_dataset_inputs(dataset, self.batch_size, self.network_proto.features, self.network_proto.backend.shuffle_buffer_size,
mode="test")
out = sum([list(zip(self.predict_raw_batch(d[0]["input_data"], d[0]["input_sequence_length"]), d[0]["input_data_params"])) for d in dataset_gen], [])
for pred, params in out:
enc_param = params[0].numpy()
pred.params = json.loads(enc_param.decode("utf-8") if isinstance(enc_param, bytes) else enc_param)
yield pred
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances Project Name: Calamari-OCR/calamari
Commit Name: 1b305c86dc2ff6b3461c42f4428460b66a8bff8b
Time: 2020-01-31
Author: wick.chr.info@gmail.com
File Name: calamari_ocr/ocr/backends/tensorflow_backend/tensorflow_model.py
Class Name: TensorflowModel
Method Name: predict_dataset
Project Name: librosa/librosa
Commit Name: 9b95e0f07b60b6a144893dcc506dfaf90db61c95
Time: 2020-05-18
Author: bmcfee@users.noreply.github.com
File Name: librosa/feature/utils.py
Class Name:
Method Name: stack_memory
Project Name: dpressel/mead-baseline
Commit Name: 1b8ca89144d2eb858ef0763a6f9b272619b7ee59
Time: 2020-10-28
Author: dpressel@gmail.com
File Name: api-examples/transformer_utils.py
Class Name: NextTurnPredictionFileLoader
Method Name: process_line
Project Name: librosa/librosa
Commit Name: f5122cdab53605b7b800c96d6700b791b8c9add8
Time: 2016-04-26
Author: brian.mcfee@nyu.edu
File Name: librosa/segment.py
Class Name:
Method Name: lag_to_recurrence