0db94786a7a463fed49825811fac903f1f1fc3c8,python/caffe/classifier.py,Classifier,predict,#Classifier#,49
Before Change
for N images and C classes.
// Scale to standardize input dimensions.
inputs = np.asarray([caffe.io.resize_image(im, self.image_dims)
for im in inputs])
if oversample:
// Generate center, corner, and mirrored crops.
inputs = caffe.io.oversample(inputs, self.crop_dims)
After Change
for N images and C classes.
// Scale to standardize input dimensions.
input_ = np.zeros((len(inputs),
self.image_dims[0], self.image_dims[1], inputs[0].shape[2]),
dtype=np.float32)
for ix, in_ in enumerate(inputs):
input_[ix] = caffe.io.resize_image(in_, self.image_dims)
if oversample:
// Generate center, corner, and mirrored crops.
input_ = caffe.io.oversample(input_, self.crop_dims)
else:
// Take center crop.
center = np.array(self.image_dims) / 2.0
crop = np.tile(center, (1, 2))[0] + np.concatenate([
-self.crop_dims / 2.0,
self.crop_dims / 2.0
])
input_ = input_[:, crop[0]:crop[2], crop[1]:crop[3], :]
// Classify
caffe_in = np.zeros(np.array(input_.shape)[[0,3,1,2]],
dtype=np.float32)
for ix, in_ in enumerate(input_):
caffe_in[ix] = self.preprocess(self.inputs[0], in_)
out = self.forward_all(**{self.inputs[0]: caffe_in})
predictions = out[self.outputs[0]].squeeze(axis=(2,3))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: BVLC/caffe
Commit Name: 0db94786a7a463fed49825811fac903f1f1fc3c8
Time: 2014-08-05
Author: shelhamer@imaginarynumber.net
File Name: python/caffe/classifier.py
Class Name: Classifier
Method Name: predict
Project Name: EpistasisLab/scikit-rebate
Commit Name: ece383696800b9b34854df27a65a3d1d74669952
Time: 2020-05-28
Author: alexmxu@alexs-mbp-3.attlocal.net
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit
Project Name: EpistasisLab/scikit-rebate
Commit Name: 163eb7df13667e21b0e02a2706e18d1f53eee610
Time: 2020-01-29
Author: alexmxu99@gmail.com
File Name: skrebate/iterrelief.py
Class Name: IterRelief
Method Name: fit