Skip to content

Instantly share code, notes, and snippets.

@magesh-technovator
Created April 25, 2021 06:12
Show Gist options
  • Save magesh-technovator/4bcf19d0fc21ae613a2851b26c067e9a to your computer and use it in GitHub Desktop.
Save magesh-technovator/4bcf19d0fc21ae613a2851b26c067e9a to your computer and use it in GitHub Desktop.
CRAFT Initialize the network
cuda = False # set to True for GPU
# load net
net = CRAFT()
# Load the weights from pre-trained model
if cuda:
net.load_state_dict(copyStateDict(torch.load(args.trained_model)))
else:
net.load_state_dict(copyStateDict(torch.load(args.trained_model, map_location='cpu')))
# set to eval mode
net.eval()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment