a91b4632b2e85bc3d0df94381562546db7a194b5,src/Model.py,Model,inferBatch,#Model#,245

Before Change


        // decode, optionally save RNN output
        numBatchElements = len(batch.imgs)
        evalRnnOutput = self.dump or calcProbability
        evalList = [self.decoder] + ([self.ctcIn3dTBC] if evalRnnOutput else [])
        feedDict = {self.inputImgs: batch.imgs, self.seqLen: [Model.maxTextLen] * numBatchElements,
                    self.is_train: False}
        evalRes = self.sess.run(evalList, feedDict)
        decoded = evalRes[0]

After Change


        numBatchElements = len(batch.imgs)

        // put tensors to be evaluated into list
        evalList = []

        if self.decoderType == DecoderType.WordBeamSearch:
            evalList.append(self.wbsInput)
        else:
            evalList.append(self.decoder)

        if self.dump or calcProbability:
            evalList.append(self.ctcIn3dTBC)

        // dict containing all tensor fed into the model
        feedDict = {self.inputImgs: batch.imgs, self.seqLen: [Model.maxTextLen] * numBatchElements,
                    self.is_train: False}

        // evaluate model
        evalRes = self.sess.run(evalList, feedDict)

        // TF decoders: decoding already done in TF graph
        if self.decoderType != DecoderType.WordBeamSearch:
            decoded = evalRes[0]
        // word beam search decoder: decoding is done in C++ function compute()
        else:
            decoded = self.decoder.compute(evalRes[0])

        // map labels (numbers) to character string
        texts = self.decoderOutputToText(decoded, numBatchElements)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: githubharald/SimpleHTR
Commit Name: a91b4632b2e85bc3d0df94381562546db7a194b5
Time: 2021-02-17
Author: harald@newpc.com
File Name: src/Model.py
Class Name: Model
Method Name: inferBatch


Project Name: ntucllab/libact
Commit Name: 6edc4e4cf3c2ed91ef5d2f57759f53645644628c
Time: 2019-05-05
Author: yangarbiter@gmail.com
File Name: setup.py
Class Name:
Method Name:


Project Name: kenshohara/3D-ResNets-PyTorch
Commit Name: f27993c9ecae9cc8d714baa86cb595ed393c1a35
Time: 2018-11-30
Author: kensho.hara@aist.go.jp
File Name: main.py
Class Name:
Method Name: get_train_utils


Project Name: daavoo/pyntcloud
Commit Name: 8d63d75858cc6df30ea19c55f0da955d8d46f53a
Time: 2018-07-26
Author: daviddelaiglesiacastro@gmail.com
File Name: pyntcloud/core_class.py
Class Name: PyntCloud
Method Name: plot


Project Name: githubharald/SimpleHTR
Commit Name: a91b4632b2e85bc3d0df94381562546db7a194b5
Time: 2021-02-17
Author: harald@newpc.com
File Name: src/Model.py
Class Name: Model
Method Name: inferBatch