allenhzy commited on
Commit
2c1e150
1 Parent(s): 6a7952d
Files changed (2) hide show
  1. index.html +6 -8
  2. static/js/index.js +32 -8
index.html CHANGED
@@ -448,29 +448,27 @@
448
  <div style="clear: both"></div>
449
  </div>
450
  <div id="c10" class="column interpolation-video-column" style="width: 70%;">
451
- <div id="interpolation-image-wrapper" >
452
  Loading...
453
  </div>
454
- <input class="slider is-full-width is-large is-info"
455
  id="interpolation-slider"
456
  step="1" min="0" max="6" value="0" type="range">
457
  <label for="interpolation-slider"><strong>Perturbation Budget &Epsilon;</strong> from 2/255 to 128/255</label>
458
  </div>
459
  <!-- <div id="c100" class="column interpolation-video-column" style="width: 70%; display: none;">
460
- <div id="interpolation-image-wrapper" >
461
  Loading...
462
  </div>
463
- <input class="slider is-full-width is-large is-info"
464
- id="interpolation-slider"
465
  step="1" min="0" max="6" value="0" type="range">
466
  <label for="interpolation-slider"><strong>Perturbation Budget &Epsilon;</strong> from 2/255 to 128/255</label>
467
  </div> -->
468
  <div id="imgnet" class="column interpolation-video-column" style="width: 70%; display: none;">
469
- <div id="interpolation-image-wrapper" >
470
  Loading...
471
  </div>
472
- <input class="slider is-full-width is-large is-info"
473
- id="interpolation-slider"
474
  step="1" min="0" max="6" value="0" type="range">
475
  <label for="interpolation-slider"><strong>Perturbation Budget &Epsilon;</strong> from 2/255 to 128/255</label>
476
 
 
448
  <div style="clear: both"></div>
449
  </div>
450
  <div id="c10" class="column interpolation-video-column" style="width: 70%;">
451
+ <div id="c10-image-wrapper" >
452
  Loading...
453
  </div>
454
+ <input name="c10" class="slider is-full-width is-large is-info"
455
  id="interpolation-slider"
456
  step="1" min="0" max="6" value="0" type="range">
457
  <label for="interpolation-slider"><strong>Perturbation Budget &Epsilon;</strong> from 2/255 to 128/255</label>
458
  </div>
459
  <!-- <div id="c100" class="column interpolation-video-column" style="width: 70%; display: none;">
460
+ <div id="c100-image-wrapper" >
461
  Loading...
462
  </div>
463
+ <input name="c100" class="slider is-full-width is-large is-info interpolation-slider"
 
464
  step="1" min="0" max="6" value="0" type="range">
465
  <label for="interpolation-slider"><strong>Perturbation Budget &Epsilon;</strong> from 2/255 to 128/255</label>
466
  </div> -->
467
  <div id="imgnet" class="column interpolation-video-column" style="width: 70%; display: none;">
468
+ <div id="imgnet-image-wrapper" >
469
  Loading...
470
  </div>
471
+ <input name="imgnet" class="slider is-full-width is-large is-info interpolation-slider"
 
472
  step="1" min="0" max="6" value="0" type="range">
473
  <label for="interpolation-slider"><strong>Perturbation Budget &Epsilon;</strong> from 2/255 to 128/255</label>
474
 
static/js/index.js CHANGED
@@ -3,20 +3,44 @@ window.HELP_IMPROVE_VIDEOJS = false;
3
  var INTERP_BASE = "./static/images/adaptive";
4
  var NUM_INTERP_FRAMES = 7;
5
 
6
- var interp_images = [];
 
 
 
7
  function preloadInterpolationImages() {
8
  for (var i = 0; i < NUM_INTERP_FRAMES; i++) {
9
- var path = INTERP_BASE + '/' + String(i) + '.png';
10
- interp_images[i] = new Image();
11
- interp_images[i].src = path;
 
 
 
 
 
 
 
 
 
12
  }
13
  }
14
 
15
- function setInterpolationImage(i) {
16
- var image = interp_images[i];
 
 
 
 
 
 
 
 
 
 
 
 
17
  image.ondragstart = function() { return false; };
18
  image.oncontextmenu = function() { return false; };
19
- $('#interpolation-image-wrapper').empty().append(image);
20
  }
21
 
22
 
@@ -68,7 +92,7 @@ $(document).ready(function() {
68
  preloadInterpolationImages();
69
 
70
  $('#interpolation-slider').on('input', function(event) {
71
- setInterpolationImage(this.value);
72
  });
73
  setInterpolationImage(0);
74
  $('#interpolation-slider').prop('max', NUM_INTERP_FRAMES - 1);
 
3
  var INTERP_BASE = "./static/images/adaptive";
4
  var NUM_INTERP_FRAMES = 7;
5
 
6
+ var c10_images = [];
7
+ var c100_images = [];
8
+ var imgnet_images = [];
9
+
10
  function preloadInterpolationImages() {
11
  for (var i = 0; i < NUM_INTERP_FRAMES; i++) {
12
+ var c10_path = INTERP_BASE + '/c10_' + String(i) + '.png';
13
+ // var c100_path = INTERP_BASE + '/c100_' + String(i) + '.png';
14
+ var imgnet_path = INTERP_BASE + '/imgnet_' + String(i) + '.png';
15
+
16
+ c10_images[i] = new Image();
17
+ c10_images[i].src = c10_path;
18
+
19
+ // c100_images[i] = new Image();
20
+ // c100_images[i].src = c100_path;
21
+
22
+ imgnet_images[i] = new Image();
23
+ imgnet_images[i].src = imgnet_path;
24
  }
25
  }
26
 
27
+ function setInterpolationImage(name, value) {
28
+
29
+ if (name == "c10"){
30
+ var image = c10_images[value]
31
+ }
32
+ else if (name == "c100"){
33
+ var image = c100_images[value]
34
+ }
35
+ else if (name == "imgnet"){
36
+ var image = imgnet_images[value]
37
+ }
38
+ else {
39
+ var image = c10_images[value]
40
+ }
41
  image.ondragstart = function() { return false; };
42
  image.oncontextmenu = function() { return false; };
43
+ $('#'+name+'-image-wrapper').empty().append(image);
44
  }
45
 
46
 
 
92
  preloadInterpolationImages();
93
 
94
  $('#interpolation-slider').on('input', function(event) {
95
+ setInterpolationImage(this.name, this.value);
96
  });
97
  setInterpolationImage(0);
98
  $('#interpolation-slider').prop('max', NUM_INTERP_FRAMES - 1);