Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
beat.examples
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
beat
beat.examples
Commits
212d30aa
Commit
212d30aa
authored
Nov 06, 2017
by
Philip ABBET
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixes (detected on the platform)
parent
a81d1638
Changes
19
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
485 additions
and
68 deletions
+485
-68
advanced/databases/atnt/4.json
advanced/databases/atnt/4.json
+5
-5
advanced/databases/atnt/4.py
advanced/databases/atnt/4.py
+432
-24
advanced/databases/banca/3.py
advanced/databases/banca/3.py
+1
-1
advanced/databases/banca/3.rst
advanced/databases/banca/3.rst
+1
-1
advanced/databases/biosecurid_face/2.py
advanced/databases/biosecurid_face/2.py
+1
-1
advanced/databases/biosecurid_face/2.rst
advanced/databases/biosecurid_face/2.rst
+1
-1
advanced/databases/casme2/3.py
advanced/databases/casme2/3.py
+10
-2
advanced/databases/cbsr_nir_vis_2/3.py
advanced/databases/cbsr_nir_vis_2/3.py
+2
-2
advanced/databases/frgc/3.py
advanced/databases/frgc/3.py
+11
-11
advanced/databases/gbu/3.py
advanced/databases/gbu/3.py
+1
-1
advanced/databases/kboc16/3.json
advanced/databases/kboc16/3.json
+2
-2
advanced/databases/kboc16/3.py
advanced/databases/kboc16/3.py
+4
-4
advanced/databases/lfw/3.py
advanced/databases/lfw/3.py
+1
-1
advanced/databases/mnist/3.py
advanced/databases/mnist/3.py
+8
-7
advanced/databases/mobio/3.py
advanced/databases/mobio/3.py
+1
-1
advanced/databases/utfvp/3.py
advanced/databases/utfvp/3.py
+1
-1
advanced/databases/voxforge/3.py
advanced/databases/voxforge/3.py
+1
-1
advanced/databases/xm2vts/3.py
advanced/databases/xm2vts/3.py
+1
-1
system/dataformats/system_username/kboc16_keystroke/1.json
system/dataformats/system_username/kboc16_keystroke/1.json
+1
-1
No files found.
advanced/databases/atnt/4.json
View file @
212d30aa
...
...
@@ -48,7 +48,7 @@
{
"name"
:
"train"
,
"template"
:
"train"
,
"view"
:
"Train"
,
"view"
:
"Train
EyePositions
"
,
"outputs"
:
{
"file_id"
:
"{{ system_user.username }}/uint64/1"
,
"client_id"
:
"{{ system_user.username }}/uint64/1"
,
...
...
@@ -59,7 +59,7 @@
{
"name"
:
"dev_templates"
,
"template"
:
"templates"
,
"view"
:
"Templates"
,
"view"
:
"Templates
EyePositions
"
,
"parameters"
:
{
"group"
:
"dev"
},
...
...
@@ -74,7 +74,7 @@
{
"name"
:
"dev_probes"
,
"template"
:
"probes"
,
"view"
:
"Probes"
,
"view"
:
"Probes
EyePositions
"
,
"parameters"
:
{
"group"
:
"dev"
},
...
...
@@ -90,7 +90,7 @@
{
"name"
:
"test_templates"
,
"template"
:
"templates"
,
"view"
:
"Templates"
,
"view"
:
"Templates
EyePositions
"
,
"parameters"
:
{
"group"
:
"eval"
},
...
...
@@ -105,7 +105,7 @@
{
"name"
:
"test_probes"
,
"template"
:
"probes"
,
"view"
:
"Probes"
,
"view"
:
"Probes
EyePositions
"
,
"parameters"
:
{
"group"
:
"eval"
},
...
...
advanced/databases/atnt/4.py
View file @
212d30aa
This diff is collapsed.
Click to expand it.
advanced/databases/banca/3.py
View file @
212d30aa
...
...
@@ -445,7 +445,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
advanced/databases/banca/3.rst
View file @
212d30aa
.. Copyright (c) 201
6
Idiap Research Institute, http://www.idiap.ch/ ..
.. Copyright (c) 201
7
Idiap Research Institute, http://www.idiap.ch/ ..
.. Contact: beat.support@idiap.ch ..
.. ..
.. This file is part of the beat.examples module of the BEAT platform. ..
...
...
advanced/databases/biosecurid_face/2.py
View file @
212d30aa
...
...
@@ -397,7 +397,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
advanced/databases/biosecurid_face/2.rst
View file @
212d30aa
.. Copyright (c) 201
6
Idiap Research Institute, http://www.idiap.ch/ ..
.. Copyright (c) 201
7
Idiap Research Institute, http://www.idiap.ch/ ..
.. Contact: beat.support@idiap.ch ..
.. ..
.. This file is part of the beat.examples module of the BEAT platform. ..
...
...
advanced/databases/casme2/3.py
View file @
212d30aa
...
...
@@ -104,7 +104,7 @@ class View:
# Open the database and load the objects to provide via the outputs
self
.
db
=
bob
.
db
.
casme2
.
Database
()
self
.
objs
=
sorted
(
self
.
db
.
objects
(
protocol
=
parameters
[
'protocol'
]
,
self
.
objs
=
sorted
(
self
.
db
.
objects
(
protocol
=
str
(
parameters
[
'protocol'
])
,
groups
=
parameters
[
'group'
]),
key
=
lambda
x
:
(
x
.
emotion
,
x
.
client_id
,
x
.
id
))
...
...
@@ -171,7 +171,11 @@ class View:
if
self
.
outputs
[
'image'
].
isConnected
():
frames
=
obj
.
frames
filename
=
str
(
os
.
path
.
join
(
obj
.
make_path
(
self
.
root_folder
),
frames
[
0
].
filename
))
filename
=
str
(
os
.
path
.
join
(
obj
.
make_path
(),
frames
[
0
].
filename
))
# Bugfix: the database returns invalid paths...
filename
=
filename
.
replace
(
'/idiap/resource/database/CASME2/Cropped'
,
self
.
root_folder
)
frame
=
bob
.
io
.
base
.
load
(
filename
)
data
=
np
.
zeros
(
shape
=
(
len
(
frames
),
frame
.
shape
[
0
],
frame
.
shape
[
1
],
frame
.
shape
[
2
]),
dtype
=
"uint8"
)
...
...
@@ -179,6 +183,10 @@ class View:
for
i
in
range
(
1
,
len
(
frames
)):
filename
=
str
(
os
.
path
.
join
(
obj
.
make_path
(
self
.
root_folder
),
frames
[
i
].
filename
))
# Bugfix: the database returns invalid paths...
filename
=
filename
.
replace
(
'/idiap/resource/database/CASME2/Cropped'
,
self
.
root_folder
)
data
[
i
]
=
bob
.
io
.
base
.
load
(
filename
)
self
.
outputs
[
'image'
].
write
(
...
...
advanced/databases/cbsr_nir_vis_2/3.py
View file @
212d30aa
...
...
@@ -23,7 +23,7 @@
###############################################################################
import
os
import
numpy
import
numpy
as
np
import
bob.io.base
import
bob.io.image
import
bob.db.cbsr_nir_vis_2
...
...
@@ -459,7 +459,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'
value
'
:
template_ids
'
text
'
:
template_ids
},
template_ids_end_index
)
...
...
advanced/databases/frgc/3.py
View file @
212d30aa
...
...
@@ -23,7 +23,7 @@
###############################################################################
import
os
import
numpy
import
numpy
as
np
import
bob.io.base
import
bob.io.image
import
bob.db.frgc
...
...
@@ -104,7 +104,7 @@ class Train:
self
.
outputs
=
outputs
# Open the database and load the objects to provide via the outputs
self
.
db
=
bob
.
db
.
frgc
.
Database
()
self
.
db
=
bob
.
db
.
frgc
.
Database
(
original_directory
=
root_folder
)
self
.
objs
=
sorted
(
self
.
db
.
objects
(
protocol
=
parameters
[
'protocol'
],
groups
=
'world'
,
...
...
@@ -157,7 +157,7 @@ class Train:
# Output: image (provide data at each iteration)
if
self
.
outputs
[
'image'
].
isConnected
():
filename
=
obj
.
make_path
(
self
.
root_folder
,
'.jpg'
)
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
filename
):
path
=
obj
.
make_path
(
self
.
root_folder
,
'.JPG'
)
self
.
outputs
[
'image'
].
write
(
...
...
@@ -200,7 +200,7 @@ class Templates:
- image: "{{ system_user.username }}/array_3d_uint8/1"
- file_id: "{{ system_user.username }}/text/1"
- eye_centers: "{{ system_user.username }}/eye_positions/1"
- template_id: "{{ system_user.username }}/
text
/1"
- template_id: "{{ system_user.username }}/
uint64
/1"
- client_id: "{{ system_user.username }}/text/1"
One "file_id" is associated with a given "image".
...
...
@@ -234,7 +234,7 @@ class Templates:
self
.
parameters
=
parameters
# Open the database and load the objects to provide via the outputs
self
.
db
=
bob
.
db
.
frgc
.
Database
()
self
.
db
=
bob
.
db
.
frgc
.
Database
(
original_directory
=
root_folder
)
template_ids
=
self
.
db
.
model_ids
(
protocol
=
parameters
[
'protocol'
],
groups
=
'dev'
,
...
...
@@ -282,7 +282,7 @@ class Templates:
self
.
outputs
[
'template_id'
].
write
(
{
'
text'
:
template_id
'
value'
:
np
.
uint64
(
template_id
)
},
template_end_index
)
...
...
@@ -315,7 +315,7 @@ class Templates:
# Output: image (provide data at each iteration)
if
self
.
outputs
[
'image'
].
isConnected
():
filename
=
obj
.
make_path
(
self
.
root_folder
,
'.jpg'
)
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
filename
):
path
=
obj
.
make_path
(
self
.
root_folder
,
'.JPG'
)
self
.
outputs
[
'image'
].
write
(
...
...
@@ -360,7 +360,7 @@ class Probes:
- eye_centers: "{{ system_user.username }}/eye_positions/1"
- probe_id: "{{ system_user.username }}/text/1"
- client_id: "{{ system_user.username }}/text/1"
- template_ids: "{{ system_user.username }}/array_1d_
text
/1"
- template_ids: "{{ system_user.username }}/array_1d_
uint64
/1"
One "file_id" is associated with a given "image".
One "eye_centers" is associated with a given "image".
...
...
@@ -397,7 +397,7 @@ class Probes:
self
.
parameters
=
parameters
# Open the database and load the objects to provide via the outputs
self
.
db
=
bob
.
db
.
frgc
.
Database
()
self
.
db
=
bob
.
db
.
frgc
.
Database
(
original_directory
=
root_folder
)
template_ids
=
sorted
(
self
.
db
.
model_ids
(
protocol
=
parameters
[
'protocol'
],
groups
=
'dev'
,
...
...
@@ -457,7 +457,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
@@ -499,7 +499,7 @@ class Probes:
# Output: image (provide data at each iteration)
if
self
.
outputs
[
'image'
].
isConnected
():
filename
=
obj
.
make_path
(
self
.
root_folder
,
'.jpg'
)
if
not
os
.
path
.
exists
(
path
):
if
not
os
.
path
.
exists
(
filename
):
path
=
obj
.
make_path
(
self
.
root_folder
,
'.JPG'
)
self
.
outputs
[
'image'
].
write
(
...
...
advanced/databases/gbu/3.py
View file @
212d30aa
...
...
@@ -447,7 +447,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
advanced/databases/kboc16/3.json
View file @
212d30aa
...
...
@@ -17,7 +17,7 @@
"file_id"
:
"{{ system_user.username }}/uint64/1"
,
"client_id"
:
"{{ system_user.username }}/text/1"
,
"template_id"
:
"{{ system_user.username }}/text/1"
,
"keystroke"
:
"{{ user.username }}/kboc16_keystroke/1"
"keystroke"
:
"{{
system_
user.username }}/kboc16_keystroke/1"
}
},
{
...
...
@@ -32,7 +32,7 @@
"probe_id"
:
"{{ system_user.username }}/uint64/1"
,
"client_id"
:
"{{ system_user.username }}/text/1"
,
"template_ids"
:
"{{ system_user.username }}/array_1d_text/1"
,
"keystroke"
:
"{{ user.username }}/kboc16_keystroke/1"
"keystroke"
:
"{{
system_
user.username }}/kboc16_keystroke/1"
}
}
]
...
...
advanced/databases/kboc16/3.py
View file @
212d30aa
...
...
@@ -36,11 +36,11 @@ def keystroke_reader(filename):
for
line
in
open
(
filename
,
'r'
).
readlines
():
parts
=
string
.
split
(
line
)
times
.
append
(
n
umpy
.
int32
(
parts
[
1
]))
times
.
append
(
n
p
.
int32
(
parts
[
1
]))
keys
.
append
(
parts
[
0
])
return
dict
(
holdtime
=
times
,
timestamps
=
times
,
key_events
=
keys
,
)
...
...
@@ -89,7 +89,7 @@ def get_value_end_index(objs, value, index_in_tuple, value_start_index,
class
Templates
:
"""Outputs:
- keystroke: "{{ user.username }}/kboc16_keystroke/1
- keystroke: "{{
system_
user.username }}/kboc16_keystroke/1
- file_id: "{{ system_user.username }}/uint64/1"
- template_id: "{{ system_user.username }}/text/1"
- client_id: "{{ system_user.username }}/text/1"
...
...
@@ -225,7 +225,7 @@ class Templates:
class
Probes
:
"""Outputs:
- keystroke: "{{ user.username }}/kboc16_keystroke/1
- keystroke: "{{
system_
user.username }}/kboc16_keystroke/1
- file_id: "{{ system_user.username }}/uint64/1"
- client_id: "{{ system_user.username }}/text/1"
- probe_id: "{{ system_user.username }}/uint64/1",
...
...
advanced/databases/lfw/3.py
View file @
212d30aa
...
...
@@ -395,7 +395,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
advanced/databases/mnist/3.py
View file @
212d30aa
...
...
@@ -29,12 +29,12 @@ import bob.db.mnist
#----------------------------------------------------------
def
get_label_end_index
(
label
s
,
label
,
label_start_index
,
def
get_label_end_index
(
obj
s
,
label
,
label_start_index
,
start_index
,
end_index
):
label_end_index
=
label_start_index
while
label_end_index
+
1
<=
end_index
:
label_
=
labels
[
label_end_index
+
1
-
start_index
]
label_
=
objs
[
label_end_index
+
1
-
start_index
][
1
]
if
label_
!=
label
:
return
label_end_index
...
...
@@ -78,7 +78,9 @@ class View:
# Open the database and load the objects to provide via the outputs
self
.
db
=
bob
.
db
.
mnist
.
Database
(
data_dir
=
self
.
root_folder
)
self
.
features
,
self
.
labels
=
sorted
(
self
.
db
.
data
(
groups
=
parameters
[
'group'
]),
features
,
labels
=
self
.
db
.
data
(
groups
=
parameters
[
'group'
])
self
.
objs
=
sorted
([
(
features
[
i
],
labels
[
i
])
for
i
in
range
(
len
(
features
))
],
key
=
lambda
x
:
x
[
1
])
# Determine the range of indices that must be provided
...
...
@@ -97,14 +99,13 @@ class View:
def
next
(
self
):
features
=
self
.
features
[
self
.
next_index
-
self
.
start_index
,
:]
label
=
self
.
labels
[
self
.
next_index
-
self
.
start_index
]
features
,
label
=
self
.
objs
[
self
.
next_index
-
self
.
start_index
]
# Output: class_id (only provide data when the class_id change)
if
self
.
outputs
[
'class_id'
].
isConnected
()
and
\
self
.
outputs
[
'class_id'
].
last_written_data_index
<
self
.
next_index
:
label_end_index
=
get_label_end_index
(
self
.
label
s
,
label
,
label_end_index
=
get_label_end_index
(
self
.
obj
s
,
label
,
self
.
next_index
,
self
.
start_index
,
self
.
end_index
)
...
...
advanced/databases/mobio/3.py
View file @
212d30aa
...
...
@@ -459,7 +459,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
advanced/databases/utfvp/3.py
View file @
212d30aa
...
...
@@ -379,7 +379,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'
value
'
:
template_ids
'
text
'
:
template_ids
},
end_index
)
...
...
advanced/databases/voxforge/3.py
View file @
212d30aa
...
...
@@ -401,7 +401,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'
value
'
:
template_ids
'
text
'
:
template_ids
},
template_ids_end_index
)
...
...
advanced/databases/xm2vts/3.py
View file @
212d30aa
...
...
@@ -449,7 +449,7 @@ class Probes:
self
.
outputs
[
'template_ids'
].
write
(
{
'value'
:
template_ids
'value'
:
np
.
uint64
(
template_ids
)
},
template_ids_end_index
)
...
...
advanced/dataformats/
username/kboc16_keystroke/1.json
→
system/dataformats/system_
username/kboc16_keystroke/1.json
View file @
212d30aa
{
"#description"
:
"Raw KBOC16 keystroke data"
,
"
holdtime
"
:
[
0
,
"int32"
],
"
timestamps
"
:
[
0
,
"int32"
],
"key_events"
:
[
0
,
"string"
]
}
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