if weights.endswith(".pt"): // pytorch format checkpoint = torch.load(weights, map_location="cpu") model.load_state_dict(checkpoint["model"]) del checkpoint else: // darknet format load_darknet_weights(model, weights) model.to(device).eval()
// Load weights if weights.endswith(".pt"): // pytorch format model.load_state_dict(torch.load(weights, map_location="cpu")["model"]) else: // darknet format load_darknet_weights(model, weights) model.to(device).eval()