Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.bio.video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.bio.video
Commits
a9962f1a
There was a problem fetching the pipeline summary.
Commit
a9962f1a
authored
7 years ago
by
Olegs NIKISINS
Browse files
Options
Downloads
Patches
Plain Diff
Reverted quality assessment function
parent
29636955
No related branches found
No related tags found
1 merge request
!32
Quality check on the fly
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/bio/video/preprocessor/Wrapper.py
+4
-17
4 additions, 17 deletions
bob/bio/video/preprocessor/Wrapper.py
with
4 additions
and
17 deletions
bob/bio/video/preprocessor/Wrapper.py
+
4
−
17
View file @
a9962f1a
...
@@ -54,8 +54,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
...
@@ -54,8 +54,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
frame_selector
=
utils
.
FrameSelector
(),
frame_selector
=
utils
.
FrameSelector
(),
quality_function
=
None
,
quality_function
=
None
,
compressed_io
=
False
,
compressed_io
=
False
,
read_original_data
=
None
,
read_original_data
=
None
quality_assessment_function
=
None
):
):
def
_read_video_data
(
biofile
,
directory
,
extension
):
def
_read_video_data
(
biofile
,
directory
,
extension
):
...
@@ -79,13 +78,11 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
...
@@ -79,13 +78,11 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
preprocessor
=
preprocessor
,
preprocessor
=
preprocessor
,
frame_selector
=
frame_selector
,
frame_selector
=
frame_selector
,
compressed_io
=
compressed_io
,
compressed_io
=
compressed_io
,
read_original_data
=
read_original_data
,
read_original_data
=
read_original_data
quality_assessment_function
=
quality_assessment_function
)
)
self
.
quality_function
=
quality_function
self
.
quality_function
=
quality_function
self
.
compressed_io
=
compressed_io
self
.
compressed_io
=
compressed_io
self
.
quality_assessment_function
=
quality_assessment_function
def
_check_data
(
self
,
frames
):
def
_check_data
(
self
,
frames
):
"""
Checks if the given video is in the desired format.
"""
"""
Checks if the given video is in the desired format.
"""
...
@@ -121,8 +118,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
...
@@ -121,8 +118,6 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
annots
=
None
annots
=
None
fc
=
utils
.
FrameContainer
()
fc
=
utils
.
FrameContainer
()
quality_index
=
0
for
index
,
frame
,
_
in
frames
:
for
index
,
frame
,
_
in
frames
:
# if annotations are given, we take them
# if annotations are given, we take them
if
annotations
is
not
None
:
annots
=
annotations
[
index
]
if
index
in
annotations
.
keys
()
else
None
if
annotations
is
not
None
:
annots
=
annotations
[
index
]
if
index
in
annotations
.
keys
()
else
None
...
@@ -138,15 +133,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
...
@@ -138,15 +133,7 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
else
:
else
:
quality
=
None
quality
=
None
# add image to frame container
# add image to frame container
if
self
.
quality_assessment_function
is
not
None
:
fc
.
add
(
index
,
preprocessed
,
quality
)
if
self
.
quality_assessment_function
(
quality
):
#quality satisfies our criteria
fc
.
add
(
quality_index
,
preprocessed
)
# no need to add quality here because we already addressed it
quality_index
+=
1
else
:
fc
.
add
(
index
,
preprocessed
,
quality
)
return
fc
return
fc
...
@@ -190,4 +177,4 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
...
@@ -190,4 +177,4 @@ class Wrapper(bob.bio.base.preprocessor.Preprocessor):
if
self
.
compressed_io
:
if
self
.
compressed_io
:
return
utils
.
save_compressed
(
frames
,
filename
,
self
.
preprocessor
.
write_data
)
return
utils
.
save_compressed
(
frames
,
filename
,
self
.
preprocessor
.
write_data
)
else
:
else
:
frames
.
save
(
bob
.
io
.
base
.
HDF5File
(
filename
,
'
w
'
),
self
.
preprocessor
.
write_data
)
frames
.
save
(
bob
.
io
.
base
.
HDF5File
(
filename
,
'
w
'
),
self
.
preprocessor
.
write_data
)
\ 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