Skip to content

how to calculate Precision/Recall/Accuracy in v1.1.10? #2213

Discussion options

You must be logged in to vote

@stevensagaert newer version of Torchmetrics require you to also pass the task parameter. One solution would be to use dict to pass the argument

from anomalib.data import MVTec
from anomalib.engine import Engine
from anomalib.models import Padim

if __name__ == "__main__":
    model = Padim()
    data = MVTec()
    engine = Engine(
        image_metrics={
            "Precision": {
                "class_path": "torchmetrics.Precision",
                "init_args": {"task": "binary"},
            }
        },
    )
    engine.train(model, datamodule=data)

Replies: 6 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mykappa
Comment options

Answer selected by ashwinvaidya17
Comment options

You must be logged in to vote
1 reply
@ashwinvaidya17
Comment options

Comment options

You must be logged in to vote
1 reply
@ashwinvaidya17
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants
Converted from issue

This discussion was converted from issue #2205 on July 24, 2024 14:29.