Skip to content

Commit

Permalink
Add a index page for samples
Browse files Browse the repository at this point in the history
  • Loading branch information
huningxin committed Aug 11, 2017
1 parent e49c81b commit 2e1a316
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 24 deletions.
16 changes: 8 additions & 8 deletions samples/face-detection-wasm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@
</div>
</div>
</body>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://threejs.org/examples/js/libs/stats.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js"></script>
<script src="/samples/libs/adapter-latest.js"></script>
<script src="/samples/libs/stats.min.js"></script>
<script src="/samples/libs/dat.gui.min.js"></script>
<script>
var Module = {
wasmBinaryFile: 'https://huningxin.github.io/opencv.js/build/wasm/opencv_js.wasm',
wasmBinaryFile: '/build/wasm/opencv_js.wasm',
preRun: [function() {
Module.FS_createPreloadedFile('/', 'haarcascade_eye.xml', 'https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_eye.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_frontalface_default.xml', 'https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_default.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_profileface.xml', 'https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_profileface.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_eye.xml', '/samples/data/haarcascade_eye.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_frontalface_default.xml', '/samples/data/haarcascade_frontalface_default.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_profileface.xml', '/samples/data/haarcascade_profileface.xml', true, false);
}],
_main: function() {opencvIsReady();}
};
</script>
<script async src="https://huningxin.github.io/opencv.js/build/wasm/opencv.js"></script>
<script async src="/build/wasm/opencv.js"></script>

<script src="js/index.js"></script>

Expand Down
14 changes: 7 additions & 7 deletions samples/face-detection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@
</div>
</div>
</body>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://threejs.org/examples/js/libs/stats.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js"></script>
<script src="/samples/libs/adapter-latest.js"></script>
<script src="/samples/libs/stats.min.js"></script>
<script src="/samples/libs/dat.gui.min.js"></script>
<script>
var Module = {
preRun: [function() {
Module.FS_createPreloadedFile('/', 'haarcascade_eye.xml', 'https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_eye.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_frontalface_default.xml', 'https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_frontalface_default.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_profileface.xml', 'https://raw.githubusercontent.com/opencv/opencv/master/data/haarcascades/haarcascade_profileface.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_eye.xml', '/samples/data/haarcascade_eye.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_frontalface_default.xml', '/samples/data/haarcascade_frontalface_default.xml', true, false);
Module.FS_createPreloadedFile('/', 'haarcascade_profileface.xml', '/samples/data/haarcascade_profileface.xml', true, false);
}],
_main: function() {opencvIsReady();}
};
</script>
<script async src="https://huningxin.github.io/opencv.js/build/asm.js/opencv.js"></script>
<script async src="/build/asm.js/opencv.js"></script>

<script src="js/index.js"></script>

Expand Down
37 changes: 37 additions & 0 deletions samples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<!--
* Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree.
-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1, maximum-scale=1">

<title>OpenCV.js Samples</title>

<style>
.text-center {
text-align: center;
}
</style>
</head>

<body>
<div id="container" class="text-center">

<h2 id="the-demos">OpenCV.js Samples</h2>

<p><a href="face-detection">Face detection demo</a></p>

<p><a href="face-detection-wasm">Face detection demo (WebAssembly)</a></p>

<p><a href="video-processing">Video processing demo</a></p>

<p><a href="video-processing-wasm">Video processing demo (WebAssembly)</a></p>
</div>
</body>
</html>
10 changes: 5 additions & 5 deletions samples/video-processing-wasm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
</div>
</div>
</body>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://threejs.org/examples/js/libs/stats.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js"></script>
<script src="/samples/libs/adapter-latest.js"></script>
<script src="/samples/libs/stats.min.js"></script>
<script src="/samples/libs/dat.gui.min.js"></script>
<script>
var Module = {
wasmBinaryFile: 'https://huningxin.github.io/opencv.js/build/wasm/opencv_js.wasm',
wasmBinaryFile: '/build/wasm/opencv_js.wasm',
_main: function() {opencvIsReady();}
};
</script>
<script async src="https://huningxin.github.io/opencv.js/build/wasm/opencv.js"></script>
<script async src="/build/wasm/opencv.js"></script>

<script src="js/index.js"></script>

Expand Down
8 changes: 4 additions & 4 deletions samples/video-processing/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
</div>
</div>
</body>
<script src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
<script src="https://threejs.org/examples/js/libs/stats.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.6.5/dat.gui.min.js"></script>
<script async src="https://huningxin.github.io/opencv.js/build/asm.js/opencv.js" onload="opencvIsReady()"></script>
<script src="/samples/libs/adapter-latest.js"></script>
<script src="/samples/libs/stats.min.js"></script>
<script src="/samples/libs/dat.gui.min.js"></script>
<script async src="/build/asm.js/opencv.js" onload="opencvIsReady()"></script>

<script src="js/index.js"></script>

Expand Down

0 comments on commit 2e1a316

Please sign in to comment.