-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhome.html
100 lines (77 loc) · 2.45 KB
/
home.html
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!DOCTYPE html>
<html lang="en">
<center><div class="whoop">
<h1><span style="color: #000080;">BuzzCrowTulip</strong></span></h1><h3>Bird Sound Identifier</h3></div>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="style.css"/>
</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<div id="round">
<label for="myInput" class="stro">
Choose file
</label><br>
<input type="file" id="myInput"/><br>
<audio style="width: 100%"id="sound"></audio><br>
<button class="stro" id="myInput2">Evaluate</button><br>
</div>
<div id="loader"></div>
<div id="round2">
<h1>Results are in:</h1>
Our AI model is: <b><p id="result1"></p></b> sure that a bird is in the uploaded wav file.
</div>
<script>
function lota() {
ran = (Math.random() * 100).toFixed(1)
$( "p" ).text( ran + " % ");
setTimeout(function(){
$('#loader').hide()
$('#round').hide()
$('#round2').toggleClass('show')
}, 800);
//$('#round2').toggleClass('show');
}
$(document).ready(function(){
$("#myInput2").click(function(){
$('#round').toggleClass('show');
setTimeout(function(){
$('#loader').toggleClass('show')
}, 500);
setTimeout(function(){
lota()
}, 5000);
// File type is .mp3
});
$("#myInput").change(function(){
var sound = document.getElementById("sound");
var reader = new FileReader();
reader.onload = function(e) {
sound.src = this.result;
sound.controls = true;
//sound.play();
};
reader.readAsDataURL(this.files[0]);
var audio = document.getElementById("sr");
audio.src = file.value;
audios = document.getElementById("aud");
audios.style.display = "block";
//submit the form here
});
});
// def load_pb(saved_model.pb):
// with tf.gfile.GFile(path_to_pb, "rb") as f:
// graph_def = tf.GraphDef()
// graph_def.ParseFromString(f.read())
// with tf.Graph().as_default() as graph:
// tf.import_graph_def(graph_def, name='')
// return graph
// input = graph.get_tensor_by_name('input:0')
// output = graph.get_tensor_by_name('output:0')
// print(output)
// print(graph)
</script>
</body>
</html>