de52463f855369ad17148054fa5a0a634c6b99a1,calamari_ocr/ocr/dataset/datareader/pagexml/reader.py,PageXMLReader,cutout,#Any#Any#Any#Any#,200

Before Change


            return pageimg[min(c[0] for c in coords):max(c[0] for c in coords),
                   min(c[1] for c in coords):max(c[1] for c in coords)]
        rr, cc = polygon(coords[:, 0], coords[:, 1], pageimg.shape)
        offset = (min([x[0] for x in coords]), min([x[1] for x in coords]))
        box = np.ones(
            (max([x[0] for x in coords]) - offset[0],
             max([x[1] for x in coords]) - offset[1],
             ) + ((pageimg.shape[-1],) if len(pageimg.shape) == 3 else ()),

After Change


            return pageimg[min(c[0] for c in coords):max(c[0] for c in coords),
                   min(c[1] for c in coords):max(c[1] for c in coords)]
        rr, cc = polygon(coords[:, 0], coords[:, 1], pageimg.shape)
        coords = np.asarray([rr, cc])
        offset = np.min(coords, axis=1)
        size = np.max(coords, axis=1) - offset + 1
        box = np.ones(tuple(map(int, size)) + ((pageimg.shape[-1],) if len(pageimg.shape) == 3 else ()), dtype=pageimg.dtype) * 255
        box[rr - offset[0], cc - offset[1]] = pageimg[rr, cc]
        return box
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: Calamari-OCR/calamari
Commit Name: de52463f855369ad17148054fa5a0a634c6b99a1
Time: 2021-01-19
Author: christoph.wick@planet-ai.de
File Name: calamari_ocr/ocr/dataset/datareader/pagexml/reader.py
Class Name: PageXMLReader
Method Name: cutout


Project Name: pfnet/optuna
Commit Name: 40d975f2d040d02b1e6dfa93fb830f11d0e39e2d
Time: 2020-07-06
Author: phjgt308@gmail.com
File Name: optuna/visualization/_edf.py
Class Name:
Method Name: _get_edf_plot


Project Name: tflearn/tflearn
Commit Name: 45e0e9f57cd6aa0253ef45ecd9044dbdb329c8f0
Time: 2017-05-22
Author: aymeric.damien@gmail.com
File Name: examples/images/dcgan.py
Class Name:
Method Name: