8d0d0c7a6db3904f0222cbe058388a92cf21a548,calamari_ocr/thirdparty/ocrodeg/degrade.py,,random_pad,#,44

Before Change



def random_pad(image, horizontal=(0, 100)):
    l, r = np.random.randint(*horizontal, size=1), np.random.randint(*horizontal, size=1)
    return np.pad(image, ((l[0], r[0]), (0, 0)), mode="constant")
//
// random distortions
//

After Change



def random_pad(image, horizontal=(0, 100)):
    l, r = np.random.randint(*horizontal, size=1), np.random.randint(*horizontal, size=1)
    return cv.copyMakeBorder(image, l[0], r[0], 0, 0, cv.BORDER_CONSTANT,
                             value=[0]*(1 if image.ndim == 2 else image.shape[-1]))

//
// random distortions
//
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: Calamari-OCR/calamari
Commit Name: 8d0d0c7a6db3904f0222cbe058388a92cf21a548
Time: 2021-02-06
Author: ChWick@users.noreply.github.com
File Name: calamari_ocr/thirdparty/ocrodeg/degrade.py
Class Name:
Method Name: random_pad


Project Name: librosa/librosa
Commit Name: 489494cdbbd3bf9f75b37c58e15ffbbbc1dd0188
Time: 2015-01-03
Author: brian.mcfee@nyu.edu
File Name: librosa/util.py
Class Name:
Method Name: fix_length


Project Name: librosa/librosa
Commit Name: 8acf04da9110e1fdb5846c4bf511c8d9f29a6565
Time: 2014-11-06
Author: brian.mcfee@nyu.edu
File Name: librosa/util.py
Class Name:
Method Name: pad_center