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: rlworkgroup/garage
Commit Name: 1c6238429d8beff5e3934b6326d847b2f96e192a
Time: 2020-11-11
Author: shinyinn@usc.edu
File Name: src/garage/sampler/vec_worker.py
Class Name: VecWorker
Method Name: start_episode


Project Name: has2k1/plotnine
Commit Name: 21d7042c38a23d4cfe6278ddd5fa1c247af4e376
Time: 2016-07-11
Author: has2k1@gmail.com
File Name: ggplot/stats/stat_density.py
Class Name:
Method Name: compute_density