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


        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: 3

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: has2k1/plotnine
Commit Name: b8f8bbb6e8f5480174c4c49445bc0e7d952f3946
Time: 2014-04-25
Author: eric.chiang.m@gmail.com
File Name: ggplot/geoms/geom_abline.py
Class Name: geom_abline
Method Name: _plot_unit


Project Name: epfl-lts2/pygsp
Commit Name: 25578194028e16c82cfbcfa7b2748d90d74e8715
Time: 2017-08-28
Author: michael.defferrard@epfl.ch
File Name: pygsp/plotting.py
Class Name:
Method Name: _qtg_plot_signal