Robert-JunWang/Pelee

Using pelee network in classification

tuan3w opened this issue · 2 comments

Hi @Robert-JunWang ,
I try to test image classification with pelee net. I create a pytorch version and convert weights from your caffe model to pytorch model.
However, I wonder what is correct way to pre-process image. I follow your code in python notebook. Here is my code:

def preprocess(imgfile):
    img = cv2.imread(imgfile)
    img = cv2.resize(img, (224,224))
    img_mean = np.array([103.94, 116.78, 123.68], dtype=np.float32)
    img = img.astype(np.float32, copy=True) - img_mean
    img = img * 0.017
    img = img.astype(np.float32)
    img = img.transpose((2, 0, 1))
    return img

I test some images, but the results are bad.
I know, that is code used for image detect problem. Is it the same in image classification problem?
Thanks.

I will open source the code and weight of my Pytorch version PeleeNet soon. The original code can only run on Pytorch 0.3.1. I need some time to make it works on Pytorch 1.0.

It's good to hear that. I'm looking forward to seeing your pytorch pretrained.