aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/tensorboard/components/tf-image-dashboard/demo/image-loader-demo.html
blob: 7aafd247f30bde7c085d4a40f722036adcdfb801 (plain)
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
72
73
<!DOCTYPE html>
<html>
  <head>
    <script src="../../../bower_components/webcomponentsjs/webcomponents-lite.min.js"></script>
    <script src="../../../bower_components/d3/d3.js"></script>
    <script src="../../../bower_components/plottable/plottable.js"></script>
    <link rel="stylesheet" type="text/css" href="../../../bower_components/plottable/plottable.css">
    <link rel="import" href="../tf-image-dashboard.html">
    <title>Event Dashboard Demo Demo</title>
  </head>
  <body>
    <script>
      TF.Urls.runsUrl = function() {
        return "data/runs.json"
      };
      TF.Urls.scalarsUrl = function(tag, run) {
        return "data/" + run + "/" + tag + ".json";
      };
    </script>

    <dom-module id="x-demo">
      <style>
      #loader {
        width: 300px;
        height: 300px;
      }
      </style>
      <template>
        <tf-image-loader
          id="loader"
          run="[[run]]"
          tag="[[tag]]"
          images-generator="[[imagesGenerator]]"
          individual-image-generator="[[individualImageGenerator]]"
        ></tf-image-loader>
      </template>
      <script>
      var imagesUrl = function(tag, run) {
        return "data/images/" + run + "/" + tag + ".json";
      };
      var individualImageUrl = function(query) {
        return "data/individualImage/" + query + ".png";
      };
      Polymer({
        is: "x-demo",
        properties: {
          run: {
            type: String,
            value: "train",
          },
          tag: {
            type: String,
            value: "reconstruction_07%2Fimage%2F2"
          },
          imagesGenerator: {
            type: Function,
            value: function() {
              return imagesUrl;
            },
          },
          individualImageGenerator: {
            type: Function,
            value: function() {
              return individualImageUrl;
            },
          },
        },
      });
      </script>
    </dom-module>
    <x-demo id="demo"></x-demo>
  </body>
</html>