Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv_contrib
Commits
201a5b7d
Commit
201a5b7d
authored
Sep 15, 2015
by
Hyunjun Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added dev_test
parent
f60ca728
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
fr_lfw.cpp
modules/datasets/src/fr_lfw.cpp
+38
-1
No files found.
modules/datasets/src/fr_lfw.cpp
View file @
201a5b7d
...
...
@@ -106,6 +106,7 @@ void FR_lfwImp::loadDataset(const string &path)
ifstream
infile
((
path
+
"pairs.txt"
).
c_str
());
string
line
;
getline
(
infile
,
line
);
// should be 10 300
CV_Assert
(
line
==
"10
\t
300"
);
unsigned
int
num
=
0
;
while
(
getline
(
infile
,
line
))
{
...
...
@@ -113,7 +114,6 @@ void FR_lfwImp::loadDataset(const string &path)
{
train
.
push_back
(
vector
<
Ptr
<
Object
>
>
());
test
.
push_back
(
vector
<
Ptr
<
Object
>
>
());
validation
.
push_back
(
vector
<
Ptr
<
Object
>
>
());
}
vector
<
string
>
elems
;
...
...
@@ -143,10 +143,12 @@ void FR_lfwImp::loadDataset(const string &path)
num
++
;
}
infile
.
close
();
// dev train loading to train[0]
ifstream
infile2
((
path
+
"pairsDevTrain.txt"
).
c_str
());
getline
(
infile2
,
line
);
// should 1100
CV_Assert
(
line
==
"1100"
);
while
(
getline
(
infile2
,
line
))
{
vector
<
string
>
elems
;
...
...
@@ -174,6 +176,41 @@ void FR_lfwImp::loadDataset(const string &path)
train
[
0
].
push_back
(
curr
);
}
infile2
.
close
();
// dev train loading to validation[0]
ifstream
infile3
((
path
+
"pairsDevTest.txt"
).
c_str
());
getline
(
infile3
,
line
);
// should 500
CV_Assert
(
line
==
"500"
);
validation
.
push_back
(
vector
<
Ptr
<
Object
>
>
());
while
(
getline
(
infile3
,
line
))
{
vector
<
string
>
elems
;
split
(
line
,
elems
,
'\t'
);
Ptr
<
FR_lfwObj
>
curr
(
new
FR_lfwObj
);
string
&
person1
=
elems
[
0
];
unsigned
int
imageNumber1
=
atoi
(
elems
[
1
].
c_str
())
-
1
;
curr
->
image1
=
person1
+
"/"
+
faces
[
person1
][
imageNumber1
];
string
person2
;
unsigned
int
imageNumber2
;
if
(
3
==
elems
.
size
())
{
person2
=
elems
[
0
];
imageNumber2
=
atoi
(
elems
[
2
].
c_str
())
-
1
;
curr
->
same
=
true
;
}
else
{
person2
=
elems
[
2
];
imageNumber2
=
atoi
(
elems
[
3
].
c_str
())
-
1
;
curr
->
same
=
false
;
}
curr
->
image2
=
person2
+
"/"
+
faces
[
person2
][
imageNumber2
];
validation
[
0
].
push_back
(
curr
);
}
infile3
.
close
();
}
Ptr
<
FR_lfw
>
FR_lfw
::
create
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment