Skip to content

How to inference custom dataset without Folder()? #2357

Closed Answered by cory619-seungwon
cory619-seungwon asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks a lot. I got a solution as below.

    inferencer = TorchInferencer(path="D:\\patchcore\\anomalib_2\\models\\model.pt", device="cpu")

    image = Image.open("D:\\patchcore\\anomalib_2\\evaluation_1_image\\TEST_098.png").convert("RGB")
    image = image.resize((224, 224))
    transform = transforms.ToTensor()
    image_tensor = transform(image) 
    
    result = inferencer.predict(image=image_tensor)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@cory619-seungwon
Comment options

Answer selected by samet-akcay
@samet-akcay
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
3 participants