Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aidge_backend_opencv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eclipse Projects
aidge
aidge_backend_opencv
Commits
a57953ae
Commit
a57953ae
authored
1 year ago
by
Thibault Allenet
Browse files
Options
Downloads
Patches
Plain Diff
Add double and char cases for tensor creation and convertion functions
parent
3dd2b548
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/Utils.cpp
+12
-12
12 additions, 12 deletions
src/utils/Utils.cpp
with
12 additions
and
12 deletions
src/utils/Utils.cpp
+
12
−
12
View file @
a57953ae
...
...
@@ -33,9 +33,9 @@ std::shared_ptr<Aidge::Tensor> Aidge::convertCpu(std::shared_ptr<Aidge::Tensor>
case
CV_8U
:
tensorCpu
->
setDataType
(
Aidge
::
DataType
::
UInt8
);
break
;
//
case CV_8S:
//
tensorCpu->setDataType(Aidge::DataType::Int8);
//
break;
case
CV_8S
:
tensorCpu
->
setDataType
(
Aidge
::
DataType
::
Int8
);
break
;
case
CV_16U
:
tensorCpu
->
setDataType
(
Aidge
::
DataType
::
UInt16
);
break
;
...
...
@@ -48,9 +48,9 @@ std::shared_ptr<Aidge::Tensor> Aidge::convertCpu(std::shared_ptr<Aidge::Tensor>
case
CV_32F
:
tensorCpu
->
setDataType
(
Aidge
::
DataType
::
Float32
);
break
;
//
case CV_64F:
//
tensorCpu->setDataType(Aidge::DataType::Float64);
//
break;
case
CV_64F
:
tensorCpu
->
setDataType
(
Aidge
::
DataType
::
Float64
);
break
;
default:
throw
std
::
runtime_error
(
"Cannot convert cv::Mat to Tensor: incompatible types."
);
...
...
@@ -69,9 +69,9 @@ std::shared_ptr<Aidge::Tensor> Aidge::convertCpu(std::shared_ptr<Aidge::Tensor>
case
CV_8U
:
convert
<
unsigned
char
>
(
*
itChannel
,
tensorCpu
->
getImpl
()
->
rawPtr
(),
count
*
static_cast
<
std
::
size_t
>
((
*
itChannel
).
rows
*
(
*
itChannel
).
cols
));
break
;
//
case CV_8S:
//
convert<char>(*itChannel, tensorCpu->getImpl()->rawPtr(), count*static_cast<std::size_t>((*itChannel).rows*(*itChannel).cols));
//
break;
case
CV_8S
:
convert
<
char
>
(
*
itChannel
,
tensorCpu
->
getImpl
()
->
rawPtr
(),
count
*
static_cast
<
std
::
size_t
>
((
*
itChannel
).
rows
*
(
*
itChannel
).
cols
));
break
;
case
CV_16U
:
convert
<
unsigned
short
>
(
*
itChannel
,
tensorCpu
->
getImpl
()
->
rawPtr
(),
count
*
static_cast
<
std
::
size_t
>
((
*
itChannel
).
rows
*
(
*
itChannel
).
cols
));
break
;
...
...
@@ -84,9 +84,9 @@ std::shared_ptr<Aidge::Tensor> Aidge::convertCpu(std::shared_ptr<Aidge::Tensor>
case
CV_32F
:
convert
<
float
>
(
*
itChannel
,
tensorCpu
->
getImpl
()
->
rawPtr
(),
count
*
static_cast
<
std
::
size_t
>
((
*
itChannel
).
rows
*
(
*
itChannel
).
cols
));
break
;
//
case CV_64F:
//
convert<double>(*itChannel, tensorCpu->getImpl()->rawPtr(), count*static_cast<std::size_t>((*itChannel).rows*(*itChannel).cols));
//
break;
case
CV_64F
:
convert
<
double
>
(
*
itChannel
,
tensorCpu
->
getImpl
()
->
rawPtr
(),
count
*
static_cast
<
std
::
size_t
>
((
*
itChannel
).
rows
*
(
*
itChannel
).
cols
));
break
;
default:
throw
std
::
runtime_error
(
"Cannot convert cv::Mat to Tensor: incompatible types."
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment