import os
import sys
import glob
import numpy as np
import time
import cv2
import cudasift
class PreCuda:
def __init__(self, size):
print("__init__")
self.rows = size
self.cols = size
self.stream = cv2.cuda_Stream( )
self.frame = np.zeros((size,size,3),np.uint8)
cv2.cuda.registerPageLocked(self.frame)
self.frame_device = cv2.cuda_GpuMat(size,size,cv2.CV_8UC3)
def __del__(self):
print("unregisterPageLocked")
cv2.cuda.unregisterPageLocked(self.frame)
def ProcessFrame(self):
print("ProcessFrame")
self.frame_device.upload(self.frame, self.stream) # <-- issue
def Frame(self, img):
print("Frame")
img = cv2.imread(image_name)
img.resize(self.rows, self.cols, 3)
np.copyto(self.frame,img)
image_names = glob.glob('images/*')
size = 512
image_data = PreCuda(size)
for image_name in image_names:
image_data.Frame(image_name)
image_data.ProcessFrame()
System information (version)
Detailed description
When I run self.frame_device.upload(self.frame, stream) I'm getting an extra cudaStreamCreate and cudaStreamDestroy right before the cudaMemcpy2DAsync. (See attached)

Steps to reproduce
-->