<commit_before><!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>&lt;tracking-elements&gt;</title>

  <!-- Importing Web Component's Polyfill -->
  <script src="../bower_components/platform/platform.js"></script>

  <!-- Importing Custom Elements -->
  <link rel="import" href="../src/image-object-tracking.html">
  <link rel="import" href="../src/canvas-object-tracking.html">
  <link rel="import" href="../src/video-object-tracking.html">
</head>
<body>

  <h1>ObjectTracker</h1>


  <p>An example of using <code>&lt;image-object-tracking-element&gt;</code>:</p>

  <!-- Using Custom Elements -->
  <img is="image-object-tracking" target="face" src="assets/faces.png" />

  <script>
    var img = document.querySelector('img');

    img.addEventListener('track', function(event) {
      event.detail.data.forEach(function(rect) {
        plotRectangle(img, rect);
      });
    });
  </script>


  <p>An example of using <code>&lt;canvas-object-tracking-element&gt;</code>:</p>

  <!-- Using Custom Elements -->
  <canvas is="canvas-object-tracking" target="face"></canvas>

  <script>
    var canvas = document.querySelector('canvas');

    canvas.addEventListener('track', function(event) {
      event.detail.data.forEach(function(rect) {
        plotRectangle(canvas, rect);
      });
    });

    window.addEventListener('polymer-ready', function(event) {
      // Waits the image to be loaded nto the canvas.
      tracking.Canvas.loadImage(canvas, 'assets/faces.png', 0, 0, 600, 348, function() {
        canvas.trackerTask.stop().run();
      });
    });
  </script>

  <p>An example of using <code>&lt;video-object-tracking-element&gt;</code>:</p>

  <!-- Using Custom Elements -->
  <video is="video-object-tracking" target="face" camera="true" width="480" height="320" autoplay><video>

  <script>
    var debug;
    var video = document.querySelector('video');

    video.addEventListener('track', function(event) {
      event.detail.data.forEach(function(rect) {
        debug = plotRectangle(video, rect, debug);
      });
    });
  </script>

  <!-- Private Helpers -->
  <script>
    function plotRectangle(el, rect, opt_div) {
      var div = opt_div || document.createElement('div');
      div.style.position = 'absolute';
      div.style.border = '2px solid ' + (rect.color || 'magenta');
      div.style.width = rect.width + 'px';
      div.style.height = rect.height + 'px';
      div.style.left = el.offsetLeft + rect.x + 'px';
      div.style.top = el.offsetTop + rect.y + 'px';
      document.body.appendChild(div);
      return div;
    }
  </script>

</body>
</html><commit_msg>Removes video from object example<commit_after><!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>&lt;tracking-elements&gt;</title>

  <!-- Importing Web Component's Polyfill -->
  <script src="../bower_components/platform/platform.js"></script>

  <!-- Importing Custom Elements -->
  <link rel="import" href="../src/image-object-tracking.html">
  <link rel="import" href="../src/canvas-object-tracking.html">
  <link rel="import" href="../src/video-object-tracking.html">
</head>
<body>

  <h1>ObjectTracker</h1>


  <p>An example of using <code>&lt;image-object-tracking-element&gt;</code>:</p>

  <!-- Using Custom Elements -->
  <img is="image-object-tracking" target="face" src="assets/faces.png" />

  <script>
    var img = document.querySelector('img');

    img.addEventListener('track', function(event) {
      event.detail.data.forEach(function(rect) {
        plotRectangle(img, rect);
      });
    });
  </script>


  <p>An example of using <code>&lt;canvas-object-tracking-element&gt;</code>:</p>

  <!-- Using Custom Elements -->
  <canvas is="canvas-object-tracking" target="face"></canvas>

  <script>
    var canvas = document.querySelector('canvas');

    canvas.addEventListener('track', function(event) {
      event.detail.data.forEach(function(rect) {
        plotRectangle(canvas, rect);
      });
    });

    window.addEventListener('polymer-ready', function(event) {
      // Waits the image to be loaded nto the canvas.
      tracking.Canvas.loadImage(canvas, 'assets/faces.png', 0, 0, 600, 348, function() {
        canvas.trackerTask.stop().run();
      });
    });
  </script>

  <!-- Private Helpers -->
  <script>
    function plotRectangle(el, rect, opt_div) {
      var div = opt_div || document.createElement('div');
      div.style.position = 'absolute';
      div.style.border = '2px solid ' + (rect.color || 'magenta');
      div.style.width = rect.width + 'px';
      div.style.height = rect.height + 'px';
      div.style.left = el.offsetLeft + rect.x + 'px';
      div.style.top = el.offsetTop + rect.y + 'px';
      document.body.appendChild(div);
      return div;
    }
  </script>

</body>
</html>
{'fraction_non_alphanumeric': 0.18539443398200461, 'fraction_numerical': 0.006277463904582548, 'mean_word_length': 3.2188879082082966, 'pattern_counts': {'":': 0, '<': 90, '<?xml version=': 0, '>': 90, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2600601', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1483, 'n_words': 288}