Closed yehyunsuh closed 2 years ago
pill_type = ["μμ½_μν",'μμ½_μ₯λ°©νorνμν','μμ½_κΈ°ν','μμ½_νκ°ν','μμ½_μΌκ°ν','μμ½_μ¬κ°ν','μμ½_μ€κ°ν','μμ½_μ‘κ°ν','μμ½_λ§λ¦λͺ¨ν','μΊ‘μ_μ₯λ°©νorνμν','μΊ‘μ_κΈ°ν']
pill_type = sorted(['ν¬λͺ
', 'μ°λ, ν¬λͺ
', 'μ΄λ‘, ν¬λͺ
', 'νμ', 'νμ, ν¬λͺ
', 'κ°μorλΉ¨κ°', 'λ
Έλorμ£Όν©', 'μ£Όν©, ν¬λͺ
', 'νμ, λ
Έλ', 'λΆν, ν¬λͺ
', 'κ°μ, ν¬λͺ
', '보λΌ', 'μ°λorμ΄λ‘', '보λΌ, ν¬λͺ
', 'μ²λ‘, ν¬λͺ
', 'νμ, κ°μ', 'μ²λ‘', 'λΆν', 'νμ, νλ', 'νμ', 'λΉ¨κ°, ν¬λͺ
', 'λ¨μ', 'νλ, ν¬λͺ
', 'νλ', 'κ²μ ', 'μμ£Ό', 'λ
Έλ, ν¬λͺ
'])
pill_type = ['μμ½','μΊ‘μ']
model = timm.create_model('resnet50', pretrained=True, num_classes=30)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model.to(device)
PATH = ""
model.load_state_dict(torch.load(PATH, map_location=device))
with torch.no_grad():
print("Calculating validation results...")
model.eval()
i, accuracy = 0, []
for test in test_loader:
inputs = test
inputs = inputs.to(device)
outs = model(inputs)
preds = torch.argmax(outs, dim=-1)
print(preds) # result of the classification
Classification done. The train dataset will be changed to segmented data. Issue close.
What
Image Classification
Why
For use in our project
How
reference: #15 #25