I’m trying to develop a text detection application with Pytorch and Opencv in Python.
I can use Pytorch tensor with Opencv like below.
val = y[0,:,:,0].data.cpu().numpy()
cv2.threshold(val , 0.4, 1, 0)
But it takes a lot of time. I need to do this operation by using tensor object. How can I do that?