| 117 | }; |
| 118 | |
| 119 | Tensor InpaintInto(Tensor &output, Tensor &input, Tensor &masks, double inpaintRadius, std::optional<Stream> pstream) |
| 120 | { |
| 121 | if (!pstream) |
| 122 | { |
| 123 | pstream = Stream::Current(); |
| 124 | } |
| 125 | |
| 126 | nvcv::TensorShape shape = input.shape(); |
| 127 | nvcv::Size2D maxShape{(int)shape[2], (int)shape[1]}; |
| 128 | auto inpaint = CreateOperatorEx<PyOpInpaint>((int)shape[0], maxShape); |
| 129 | |
| 130 | ResourceGuard guard(*pstream); |
| 131 | guard.add(LockMode::LOCK_MODE_READ, {input, masks}); |
| 132 | guard.add(LockMode::LOCK_MODE_WRITE, {output}); |
| 133 | guard.add(LockMode::LOCK_MODE_READWRITE, {*inpaint}); |
| 134 | |
| 135 | inpaint->submit(pstream->cudaHandle(), input, masks, output, inpaintRadius); |
| 136 | |
| 137 | return output; |
| 138 | } |
| 139 | |
| 140 | Tensor Inpaint(Tensor &input, Tensor &masks, double inpaintRadius, std::optional<Stream> pstream) |
| 141 | { |
no test coverage detected