Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.db.uvad
Commits
c172d0cc
Commit
c172d0cc
authored
Dec 04, 2017
by
Amir MOHAMMADI
Browse files
Fix cropping
parent
de560cfb
Pipeline
#14534
passed with stages
in 19 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/db/uvad/query.py
View file @
c172d0cc
...
...
@@ -49,7 +49,11 @@ class Database(FileListPadDatabase):
# crop frames to 720 x 1024
h
,
w
=
numpy
.
shape
(
frame
)[
-
2
:]
dh
,
dw
=
(
h
-
720
)
//
2
,
(
w
-
1024
)
//
2
frame
=
frame
[:,
dh
:
-
dh
,
dw
:
-
dw
]
if
dh
!=
0
:
frame
=
frame
[:,
dh
:
-
dh
,
:]
if
dw
!=
0
:
frame
=
frame
[:,
:,
dw
:
-
dw
]
assert
frame
.
shape
==
self
.
frame_shape
,
frame
.
shape
yield
frame
def
number_of_frames
(
self
,
padfile
):
...
...
bob/db/uvad/test.py
View file @
c172d0cc
...
...
@@ -38,3 +38,5 @@ def test_frames():
"way we can test more features of the database interface."
)
padfile
=
db
.
all_files
((
'train'
,
'dev'
))[
0
][
0
]
assert
db
.
number_of_frames
(
padfile
)
==
270
,
db
.
number_of_frames
(
padfile
)
frame
=
next
(
db
.
frames
(
padfile
))
assert
db
.
frame_shape
==
frame
.
shape
,
frame
.
shape
Write
Preview
Supports
Markdown
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