Grayscale Image Source #665
-
Is possible to use grayscale image on anomalib with RGB Resnet Transfer Learning? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I haven't tested it but you could try to use a |
Beta Was this translation helpful? Give feedback.
-
@rumanto00, I agree with @Jonas1302. You could create your custom transforms and add it to your For example, here is a code snippet how you could generate those transform configs via albumentations. from skimage import data
import albumentations as A
from albumentations.pytorch import ToTensorV2
image = data.camera()
transforms = A.Compose([A.ToRGB(), ToTensorV2()])
transformed_image = transforms(image=image)["image"]
# (512, 512) torch.Size([3, 512, 512])
print(image.shape, transformed_image.shape)
A.save(transforms, "transforms.yaml", data_format="yaml") This would save the transforms to __version__: 1.3.0
transform:
__class_fullname__: Compose
additional_targets: {}
bbox_params: null
is_check_shapes: true
keypoint_params: null
p: 1.0
transforms:
- __class_fullname__: ToRGB
always_apply: true
p: 1.0
- __class_fullname__: ToTensorV2
always_apply: true
p: 1.0
transpose_mask: false
|
Beta Was this translation helpful? Give feedback.
-
Hello. Is this 1channel config improved your results? |
Beta Was this translation helpful? Give feedback.
@rumanto00, I agree with @Jonas1302. You could create your custom transforms and add it to your
config.yaml
file as @Jonas1302 suggested.For example, here is a code snippet how you could generate those transform configs via albumentations.
This would save the transforms to
transforms.yaml
file, which would be something like th…