forked from baidut/PatchVQ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hist.htm
71 lines (62 loc) · 1.9 KB
/
hist.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<script>
function update_hist() {
if (window.obj == undefined) return; // otherwise this function will not be called after encountering error
var hist_data = [
{
x: [].concat(...window.obj.normalized_local_scores.slice()),
type: 'histogram',
histnorm: 'probability',
marker: {
color: 'rgb(0,0,100)',
},
}
];
var hist_layout = {
height: 100,
width: 400,
autosize: true,
margin: {
l: 25,
r: 25,
b: 20,
t: 0, // tooltip bar
pad: 0
},
};
// https://plot.ly/javascript/axes/
if(!do_stretch()){
hist_layout['xaxis'] = {range: [0, 100]}
}
Plotly.newPlot('qualityHist', hist_data, hist_layout);
// $('#btn_im_map').trigger('mouseenter');
// $('#btn_im_map').trigger("click"); // mobile
// alert(obj.global);
// $('#score').text(obj.result);
// score = Math.pow(obj.result/100, 2)*100;
score = window.obj.normalized_global_score;
$('#score').width(score+'%').attr('aria-valuenow', score+'%');
// Predicted Quality Score: ' +
$('#score').text(score);
$('#h1_score').text(window.obj.category);
// to do, support multiple files
// https://plot.ly/javascript/colorscales/
//$('#imtest').height() document.querySelector('#imtest').height
//
}
$(document).ready(function(){
// $("#imgUploaded").hover(hide_image, show_image);
// $('#heatmap').css('opacity', '0.8'); $('#imtest').css('opacity', '0.2')
$('#check_contrast_stretch').change(update_qmap);
update_hist();
on_update_qmap(update_hist);
// $('#check_contrast_stretch').prop( "checked", true );
});
</script>
<div class="doublecolumn advancedcfg">
<div class="alert alert-light" role="alert">
Local score histogram and global score
<br/>
<div align="center" id='qualityHist' style="width:100%; height: 80px"></div>
<br/>
</div>
</div>