quickdraw-small / README.md
jerilseb's picture
Update README.md
ffecb0d verified
|
raw
history blame
323 Bytes
metadata
license: mit

Usage

state_dict = torch.load('model.pth', map_location='cpu')
model.load_state_dict(state_dict, strict=False)
model.eval()

def predict(im):
    x = torch.tensor(im, dtype=torch.float32)

    with torch.no_grad():
        out = model(x)

    probabilities = F.softmax(out[0], dim=0)