improve accuracy

we dont need 3 channels for manga, and in my tests the accuracy was greatly improved by lowering the number of channels to only two (maybe B&W)

this can be related to the fact that some files in the model folder do mention that only two channels are supposed to be used.
This commit is contained in:
千住柱間 2025-04-19 05:28:07 +00:00
commit f956324616

View file

@ -85,7 +85,7 @@ def preprocess_image(image_path):
mat_in = ncnn.Mat.from_pixels_resize(
img, ncnn.Mat.PixelType.PIXEL_RGB, img.shape[1], img.shape[0], 224, 224
)
mean_vals, norm_vals = [0.5] * 3, [1 / 255.0] * 3
mean_vals, norm_vals = [0.5] * 2, [1 / 255.0] * 2
mat_in.substract_mean_normalize(mean_vals, norm_vals)
return mat_in