Skip to content
Discussion options

You must be logged in to vote

Hi @Palettenbrett, to test the inference speed of EfficientAD in anomalib you should just measure the timing for model inference in eval mode. You could do something like this for example:

from anomalib.models.efficient_ad import EfficientAd
import torch
from tqdm import tqdm
import time

if __name__ == "__main__":
    x = torch.rand(1,3,256,256).cuda()
    model = EfficientAd().model.eval().cuda()

    time_list = []
    num = 1000
    exclude_first = 10
    for i in tqdm(range(num)):
        torch.cuda.synchronize()
        tic = time.time()
        model(x)
        torch.cuda.synchronize()
        time_list.append(time.time()-tic)
    time_list = time_list[exclude_first:]
    print("  …

Replies: 3 comments 10 replies

Comment options

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

Comment options

You must be logged in to vote
8 replies
@Palettenbrett
Comment options

@alexriedel1
Comment options

@Palettenbrett
Comment options

@alexriedel1
Comment options

@Palettenbrett
Comment options

Answer selected by Palettenbrett
Comment options

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

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