Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
metrics-plotters
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
Ulysse Darmet
metrics-plotters
Commits
200c532d
Commit
200c532d
authored
8 years ago
by
Ulysse Darmet
Browse files
Options
Downloads
Patches
Plain Diff
Add the PSNR metrics computed directly by the encoder
parent
ddce9da8
Branches
master
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
metricsmanager.py
+16
-10
16 additions, 10 deletions
metricsmanager.py
with
16 additions
and
10 deletions
metricsmanager.py
+
16
−
10
View file @
200c532d
...
@@ -153,7 +153,12 @@ class profile:
...
@@ -153,7 +153,12 @@ class profile:
def
get_metrics_set
(
self
,
metric
):
def
get_metrics_set
(
self
,
metric
):
bitrates_list
=
np
.
sum
(
self
.
dict
[
'
Bitrates
'
],
axis
=
0
)
bitrates_list
=
np
.
sum
(
self
.
dict
[
'
Bitrates
'
],
axis
=
0
)
if
metric
==
'
mPSNR
'
:
if
metric
==
'
PSNR
'
:
y_psnr
=
np
.
array
(
self
.
dict
[
'
PSNR-Y
'
])
u_psnr
=
np
.
array
(
self
.
dict
[
'
PSNR-U
'
])
v_psnr
=
np
.
array
(
self
.
dict
[
'
PSNR-V
'
])
elif
metric
==
'
mPSNR
'
:
y_psnr
=
np
.
array
(
self
.
dict
[
'
mPSNRY
'
])
y_psnr
=
np
.
array
(
self
.
dict
[
'
mPSNRY
'
])
u_psnr
=
np
.
array
(
self
.
dict
[
'
mPSNRU
'
])
u_psnr
=
np
.
array
(
self
.
dict
[
'
mPSNRU
'
])
v_psnr
=
np
.
array
(
self
.
dict
[
'
mPSNRV
'
])
v_psnr
=
np
.
array
(
self
.
dict
[
'
mPSNRV
'
])
...
@@ -207,25 +212,26 @@ if __name__ == '__main__':
...
@@ -207,25 +212,26 @@ if __name__ == '__main__':
for
metric
in
metrics
:
for
metric
in
metrics
:
x
=
[]
x
=
[]
y
=
[]
y
=
[]
for
ratio
in
sorted
(
profiles1
.
keys
())
:
try
:
try
:
for
ratio
in
sorted
(
profiles1
.
keys
())
:
metrics_set1
=
profiles1
[
ratio
].
get_metrics_set
(
metric
)
metrics_set1
=
profiles1
[
ratio
].
get_metrics_set
(
metric
)
metrics_set2
=
profiles2
[
ratio
].
get_metrics_set
(
metric
)
metrics_set2
=
profiles2
[
ratio
].
get_metrics_set
(
metric
)
except
KeyError
:
x
.
append
(
ratio
)
continue
y
.
append
(
func
(
metrics_set1
,
metrics_set2
))
x
.
append
(
ratio
)
except
KeyError
:
y
.
append
(
func
(
metrics_set1
,
metrics_set2
))
continue
plt
.
plot
(
x
,
y
,
label
=
metric
)
else
:
plt
.
plot
(
x
,
y
,
label
=
metric
)
# Show
# Show
plt
.
title
(
title
)
plt
.
title
(
title
)
plt
.
xlabel
(
r
'
$\tau$
'
)
plt
.
xlabel
(
r
'
$\tau
= \frac{EL}{EL + BL}
$
'
)
plt
.
ylabel
(
ylabel
)
plt
.
ylabel
(
ylabel
)
plt
.
legend
()
plt
.
legend
()
return
fig
return
fig
# Main function
# Main function
metrics
=
[
'
mPSNR
'
,
'
tPSNR
'
,
'
PSNR_DE0100
'
,
'
HDR-VQM
'
]
metrics
=
[
'
PSNR
'
,
'
mPSNR
'
,
'
tPSNR
'
,
'
PSNR_DE0100
'
,
'
HDR-VQM
'
]
rate_figure
=
plot_bjontegaard
(
r
'
BD(SHM, HM) = $f(\tau)$
'
,
rate_figure
=
plot_bjontegaard
(
r
'
BD(SHM, HM) = $f(\tau)$
'
,
scalables
,
simulcast
,
scalables
,
simulcast
,
...
...
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