first commit
This commit is contained in:
45
templates/index.html
Normal file
45
templates/index.html
Normal file
@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Hand Gesture Detection</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hand Gesture Detection</h1>
|
||||
<img id="video_feed" src="{{ url_for('video_feed') }}" width="640" height="480" alt="Video Feed">
|
||||
<div id="image_dataset" style="display: inline;"></div>
|
||||
|
||||
<p id="name"></p>
|
||||
<p id="the_keterangan"></p>
|
||||
</body>
|
||||
<script src="assets/scripts/jquery.min.js"></script>
|
||||
<script>
|
||||
setInterval(function() {
|
||||
$.ajax({
|
||||
url: 'http://127.0.0.1:5000/get_data',
|
||||
type: 'GET',
|
||||
success: function (data) {
|
||||
// if data == {}
|
||||
if (data.name) {
|
||||
// console.log("ada data")
|
||||
$("#image_dataset").html("");
|
||||
|
||||
$("#image_dataset").append('<img src="/show_image?image_path=' + data.image_path + '" width="100" height="100" alt="image dataset">');
|
||||
|
||||
$("#name").html(data.name);
|
||||
$("#the_keterangan").html(data.keterangan);
|
||||
|
||||
}else{
|
||||
console.log("tidak ada data")
|
||||
// remove all
|
||||
$("#image_dataset").html("");
|
||||
|
||||
$("#name").html("");
|
||||
$("#the_keterangan").html("");
|
||||
}
|
||||
}
|
||||
});
|
||||
},1000)
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user