DonaldRR / SimpleNet

MIT License
402 stars 59 forks source link

Generate anomaly map #19

Closed thanhthanhhp123 closed 11 months ago

thanhthanhhp123 commented 1 year ago

How can I generate anomaly map after training?

Abhijeet99999 commented 9 months ago

@thanhthanhhp123

How can I generate anomaly map after training? Even after you share Test.py it does not work :

from simplenet import SimpleNet import torch

Create an empty image tensor

empty_image = torch.empty((224, 224, 3)) # Replace height, width, and channels with your actual values

Reshape the tensor to match the expected shape for your model

empty_image = empty_image.permute(2, 0, 1) # Adjust the permutation based on your model's input requirements

s = SimpleNet(device='cuda')

s.predict(empty_image)