aeff9c9e2c24ed09c093414a7b51ec9bd42f1e86,python/tests/transformers/named_image_test.py,NamedImageTransformerBaseTestCase,setUpClass,#Any#,67

Before Change


        super(NamedImageTransformerBaseTestCase, cls).setUpClass()

        cls.appModel = keras_apps.getKerasApplicationModel(cls.name)
        shape = cls.appModel.inputShape()

        imgFiles, images = getSampleImageList()
        imageArray = np.empty((len(images), shape[0], shape[1], 3), "uint8")
        for i, img in enumerate(images):
            assert img is not None and img.mode == "RGB"
            imageArray[i] = np.array(img.resize(shape))
        cls.imageArray = imageArray

        // Predict the class probabilities for the images in our test library using keras API
        // and cache for use by multiple tests.

After Change


        imgFiles, imageArray = cls.getSampleImageList()
        cls.imageArray = imageArray
        cls.imgFiles = imgFiles
        cls.fileOrder = {imgFiles[i].split("/")[-1]: i for i in range(len(imgFiles))}
        // Predict the class probabilities for the images in our test library using keras API
        // and cache for use by multiple tests.
        preppedImage = cls.appModel._testPreprocess(imageArray.astype("float32"))
        cls.preppedImage = preppedImage
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: databricks/spark-deep-learning
Commit Name: aeff9c9e2c24ed09c093414a7b51ec9bd42f1e86
Time: 2017-12-19
Author: 33237569+tomasatdatabricks@users.noreply.github.com
File Name: python/tests/transformers/named_image_test.py
Class Name: NamedImageTransformerBaseTestCase
Method Name: setUpClass


Project Name: hyperspy/hyperspy
Commit Name: cf4b1078573d69bbb5c511a22300f42ff2b0da76
Time: 2016-11-29
Author: t.ostasevicius@gmail.com
File Name: hyperspy/samfire_utils/samfire_worker.py
Class Name: Worker
Method Name: send_results


Project Name: sao-eht/eat
Commit Name: 433cd5e10c9af9e74f97a2de2abb3142c36bb6a0
Time: 2017-07-04
Author: ckchan@cfa.harvard.edu
File Name: eat/factor.py
Class Name:
Method Name: factor