Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure Abstract UDF classes to allow for the future addition of EVA transforms #296

Closed
wants to merge 10 commits into from

Conversation

LordDarkula
Copy link
Collaborator

@LordDarkula LordDarkula commented Aug 5, 2022

Create AbstractUDF base class and update AbstractClassifierUDF base class to inherit from it
Create AbstractTransformationUDF base class
Create PytorchAbstractTransformationUDF to combine torchvision transforms and AbstractTransformationUDF
Rename PytorchAbstractUDF to PytorchClassifierAbstractUDF

eva/udfs/abstract_udfs.py Outdated Show resolved Hide resolved
Not every UDF will accept or output np arrays so ArrayLike is a better type.
@LordDarkula LordDarkula requested a review from gaurav274 August 8, 2022 23:51
@jarulraj
Copy link
Member

jarulraj commented Aug 9, 2022

do we need input format and label properties for every UDF -- that is leading to a slight drop in coverage in #303 ?

@jarulraj
Copy link
Member

jarulraj commented Aug 9, 2022

@LordDarkula @gaurav274 Is it possible to use some kind of reflection to use torchvision transforms instead of writing a separate UDF for each transform? -- https://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful

@LordDarkula
Copy link
Collaborator Author

@LordDarkula @gaurav274 Is it possible to use some kind of reflection to use torchvision transforms instead of writing a separate UDF for each transform? -- https://stackoverflow.com/questions/37628/what-is-reflection-and-why-is-it-useful

I assume you mean allow the user to just use a torchvision transform directly in EVA instead of having to explicitly subclass PytorchAbstractUDF. Assuming we want EVA to be type-safe, we could use a Protocol (https://peps.python.org/pep-0544/). However, this feature was introduced in Python 3.8 and EVA supports earlier versions of Python.

@LordDarkula LordDarkula requested a review from jarulraj August 9, 2022 01:42
@jarulraj
Copy link
Member

jarulraj commented Aug 9, 2022

@jarulraj jarulraj closed this Aug 10, 2022
@jarulraj jarulraj deleted the abstract-udf branch August 10, 2022 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants