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
3dd2b548
Commit
3dd2b548
authored
1 year ago
by
Thibault Allenet
Browse files
Options
Downloads
Patches
Plain Diff
Add getNbModalities function in MNIST
parent
e126bf4d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/aidge/backend/opencv/database/MNIST.hpp
+2
-1
2 additions, 1 deletion
include/aidge/backend/opencv/database/MNIST.hpp
src/database/MNIST.cpp
+6
-1
6 additions, 1 deletion
src/database/MNIST.cpp
with
8 additions
and
2 deletions
include/aidge/backend/opencv/database/MNIST.hpp
+
2
−
1
View file @
3dd2b548
...
...
@@ -37,7 +37,6 @@ inline bool isBigEndian()
class
MNIST
:
public
Database
{
public:
MNIST
()
=
delete
;
MNIST
(
const
std
::
string
&
dataPath
,
// const GraphView transformations,
bool
train
,
...
...
@@ -65,6 +64,8 @@ public:
std
::
size_t
getLen
()
override
;
std
::
size_t
getNbModalities
()
override
;
union
MagicNumber
{
unsigned
int
value
;
unsigned
char
byte
[
4
];
...
...
This diff is collapsed.
Click to expand it.
src/database/MNIST.cpp
+
6
−
1
View file @
3dd2b548
...
...
@@ -127,7 +127,7 @@ void Aidge::MNIST::uncompress(const std::string& dataPath,
std
::
vector
<
std
::
shared_ptr
<
Aidge
::
Tensor
>>
Aidge
::
MNIST
::
getItem
(
std
::
size_t
index
)
{
std
::
vector
<
std
::
shared_ptr
<
Tensor
>>
item
;
// Load the digit tensor
// TODO : Currently converts the tensor Opencv but this operation will be carried by a convert operator
later
// TODO : Currently converts the tensor Opencv but this operation will be carried by a convert operator
in the preprocessing graph
item
.
push_back
(
Aidge
::
convertCpu
((
std
::
get
<
0
>
(
mStimulis
.
at
(
index
))).
load
()));
// item.push_back((std::get<0>(mStimulis.at(index))).load());
// Load the label tensor
...
...
@@ -138,4 +138,9 @@ std::vector<std::shared_ptr<Aidge::Tensor>> Aidge::MNIST::getItem(std::size_t in
std
::
size_t
Aidge
::
MNIST
::
getLen
(){
return
mStimulis
.
size
();
}
std
::
size_t
Aidge
::
MNIST
::
getNbModalities
(){
size_t
tupleSize
=
std
::
tuple_size
<
decltype
(
mStimulis
)
::
value_type
>::
value
;
return
tupleSize
;
}
\ No newline at end of file
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