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
I have tried convert to ONNX, but have got a lot of issues. After that seen your SamOnnxModel(nn.Module), but do not know how implement it.
As I see it have to be something like that
ModelToExport = SamOnnxModel(model= model, return_single_mask = True) dummy_image_embeddings = torch.randn(1, 3, 1024, 1024, device='cuda', requires_grad=True) dummy_point_coords = torch.randn(1, 1, 2, device='cuda', requires_grad=True) dummy_point_labels = torch.randn(1, 1, device='cuda', requires_grad=True) dummy_mask_input = torch.randn(1, 1, 1200, 1200, device='cuda', requires_grad=True) # ?? dummy_has_mask_input = torch.randn(1, 1024, 1024, 3, device='cuda', requires_grad=True) # ?? dummy_orig_im_size = torch.randn(1200, 1200, device='cuda', requires_grad=True) inputs = ['image_embeddings', 'point_coords', 'point_labels', 'mask_input', 'has_mask_input', 'orig_im_size'] outputs = ['upscaled_masks', 'scores', 'masks'] torch.onnx.export(ModelToExport, (dummy_image_embeddings, dummy_point_coords, dummy_point_labels, dummy_mask_input, dummy_has_mask_input, dummy_orig_im_size), opt.checkpoint_path.replace('pth','onnx'), export_params=True, do_constant_folding=True, input_names=inputs, output_names=outputs, opset_version=19, verbose=False)
But I do not know how used mask_input and has_mask_input. This inputs do not included in base predict of for torch model.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have tried convert to ONNX, but have got a lot of issues. After that seen your SamOnnxModel(nn.Module), but do not know how implement it.
As I see it have to be something like that
But I do not know how used mask_input and has_mask_input. This inputs do not included in base predict of for torch model.
The text was updated successfully, but these errors were encountered: