pavancm / CONTRIQUE

Official implementation for "Image Quality Assessment using Contrastive Learning"
125 stars 12 forks source link

Error when calculating features #19

Closed AnastasiaBam closed 1 year ago

AnastasiaBam commented 1 year ago

When i try to calculate the features using the demo_feat.py for some images of the Koniq dataset , in order to train the regressor i run into this problem RuntimeError: Given groups=1, weight of size [64, 3, 7, 7], expected input[1, 1, 224, 224] to have 3 channels, but got 1 channels instead Is there a way to fix it?

pavancm commented 1 year ago

That will be due to presence of grayscale images in the dataset. The model by default assumes all images to be in RGB color space. A simple fix for grayscale images is to replicate the gray values across three channels and use that as input to the model.

AnastasiaBam commented 1 year ago

Thank you