用于imageNet验证数据集的caffe2 squeezenet模型的图像预处理功能是什么?

时间:2019-06-25 21:36:59

标签: machine-learning deep-learning caffe2 image-preprocessing

我需要对caffe2 squeezenet模型进行验证的预处理功能。  我从https://github.com/caffe2/models/tree/master/squeezenet

获得了caffe2模型

我尝试了这个,但没有达到预期的准确性 从https://caffe2.ai/docs/tutorial-loading-pre-trained-models.html

获得了这些功能
img = skimage.img_as_float(skimage.io.imread(curr_img)).astype(np.float32)

img = rescale(img, 227, 227)

img = crop_center(img, 227, 227)

img = img.swapaxes(1, 2).swapaxes(0, 1)

img = img[(2, 1, 0), :, :]

img = img * 255 - mean

def preprocessing(imgfile):

    # read the image 

    # some resizing

    # some cropping

    # some mean and std

    # preprocess image with mean and std 

    # some RGB ---> BGR

    return img

imagenet验证数据集的预期准确性为57.5%

0 个答案:

没有答案