Skip to content
Discussion options

You must be logged in to vote

It's unorthodox but this works for me 😄:

from anomalib.pre_processing import PreProcessor
from anomalib.pre_processing.utils.transform import get_exportable_transform
from torchvision.transforms.v2 import Transform, Compose
import torch

class Default_Transform(Transform):
    def __init__(self, model_transform):
        super().__init__()
        self.pre_transform = model_transform

    def transform(self, inpt: torch.tensor, params=None):
        input = self.pre_transform(inpt)
        # maybe so more stuff I want to do for a custom transform
        return input + 1

class Default(PreProcessor):
    def __init__(self, model_transform):
        super().__init__()
        self.transform =

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
5 replies
@lucianchauvin
Comment options

@alexriedel1
Comment options

@lucianchauvin
Comment options

@lucianchauvin
Comment options

@alfieroddan
Comment options

Comment options

You must be logged in to vote
4 replies
@lucianchauvin
Comment options

@samet-akcay
Comment options

@lucianchauvin
Comment options

@alfieroddan
Comment options

Answer selected by lucianchauvin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
4 participants