Open ciwei123 opened 3 years ago
For this line
img = img.__div__(255)
in ncnn
const float norm_vals[3] = {1/255.f, 1/255.f, 1/255.f};
in.substract_mean_normalize(0, norm_vals);
For this line
img = img.__div__(255)
in ncnn
const float norm_vals[3] = {1/255.f, 1/255.f, 1/255.f}; in.substract_mean_normalize(0, norm_vals);
@nihui Thanks for your reply . I know this convertion you said, but PIL.Image is different to Opencv when read an image, Opencv is consistent with bitmap
, PIL.Image is inconsistent with bitmap
. I want to know if I use PIL.Image in pytorch, what should I do in NCNN?Thank you very much!!
@nihui Thanks for your sharing. I want to read an image,and there are two methods: 1.in pytorch by opencv :
2.in pytorch by PIL.Image
And I want to convert the pytorch model to ncnn, but the image type is
bitmap
:And I find that the first method is consistend with the NCNN,but the second methos is inconsistend with the NCNN. Coud you tell me what is the correspoding NCNN code for the second method?Thank you very much!!