We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
怎么单独去做测试一些照片?
The text was updated successfully, but these errors were encountered:
您好,这个问题您解决了吗?怎么单独去测试一些图片?
Sorry, something went wrong.
我自己写了个单独测试的代码
import models if name == 'main': resume = 'RCFcheckpoint_epoch12.pth' model = models.RCF() model.eval() checkpoint = torch.load(resume,map_location='cpu') try: model.load_state_dict(checkpoint) except Exception: model.load_state_dict(checkpoint['state_dict'],False) img_path = r'D:\Work\line_extraction\RCF-pytorch-master\BSR\BSDS500\data\images\train\12003.jpg' result_path = './examples/demo.png'
original_img = np.array(cv2.imread(img_path), dtype=np.float32) h, w, _ = original_img.shape img = prepare_image_cv2(original_img) img = torch.from_numpy(img).unsqueeze(0) outs = model(img) result = outs[-1].squeeze().detach().cpu().numpy() result = (result * 255).astype(np.uint8) Image.fromarray(result).save(result_path)
No branches or pull requests
怎么单独去做测试一些照片?
The text was updated successfully, but these errors were encountered: