-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
GpuMat as input/output to cv::dnn::Net #16433
Copy link
Copy link
Open
Labels
RFCcategory: dnncategory: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribOpenCV 4.0+: moved to opencv_contribeffort: few weeksContribution / porting of a new/existed algorithm. With samples / tests / docs / tutorialsContribution / porting of a new/existed algorithm. With samples / tests / docs / tutorialsfeaturefutureThis issue can't be fixed during restrictions of the compatibility requirementsThis issue can't be fixed during restrictions of the compatibility requirements
Milestone
Description
System information (version)
- OpenCV => 4.2.0
APIs that need changes
Suitable APIs for GpuMat input:
void setInput(InputArray blob, const String& name = "", double scalefactor = 1.0, const Scalar& mean = Scalar());
Suitable APIs for GpuMat output:
void forward(OutputArrayOfArrays outputBlobs, const String& outputName = String());void forward(OutputArrayOfArrays outputBlobs, const std::vector<String>& outBlobNames);
Modifications to support GpuMat:
void blobFromImage(InputArray image, OutputArray blob, double scalefactor=1.0, const Size& size = Size(), const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false, int ddepth=CV_32F);
Might also require a new API that would allow a stream to be specified (required if blobFromImage needs to be performed asynchronously).
The CUDA backend uses fully packed tensors everywhere and expects a fully packed tensor as input. GpuMat given as input might be using a 2D memory layout which may not be contiguous. blobFromImage must return a contiguous copy of the input.
The outputs of the CUDA backend are also in fully packed tensors. Hence, for further optimal use of the output (in the case it's an image) would require a transformation to 2D memory layout.
Problems:
GpuMatcannot store an arbitrary number of dimensions. How can the batch of images be passed?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
RFCcategory: dnncategory: gpu/cuda (contrib)OpenCV 4.0+: moved to opencv_contribOpenCV 4.0+: moved to opencv_contribeffort: few weeksContribution / porting of a new/existed algorithm. With samples / tests / docs / tutorialsContribution / porting of a new/existed algorithm. With samples / tests / docs / tutorialsfeaturefutureThis issue can't be fixed during restrictions of the compatibility requirementsThis issue can't be fixed during restrictions of the compatibility requirements