File size: 1,456 Bytes
44acddd
 
 
 
 
 
 
e3a0233
 
 
 
 
4242202
e3a0233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44acddd
 
9c02022
e3a0233
17e13ce
4fc145a
73b548b
44acddd
e3a0233
44acddd
 
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
<!-- templates/index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Object Detection App</title>
    <style>
        body {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            height: 100vh;
            margin: 0;
        }

        h1 {
            margin-bottom: 20px;
        }

        #loading {
            display: none;
        }

        #output {
            max-width: 100%;
            height: auto;
            display: none; /* Initially hidden until loaded */
        }
    </style>
     <script type="text/javascript">
        document.getElementById("loading").style.display = "none"; // Hide the loading icon
        // Function to show loading icon while waiting for response
        function showLoading() {
            document.getElementById("loading").style.display = "block";
        }
    </script>
</head>
<body>
    <h1>Object Detection App</h1>
    <form action="/detect/" method="post" enctype="multipart/form-data" onsubmit="showLoading();">
        <label for="file">Upload an Image or Video :</label>
        <input type="file" id="file" name="file" accept=".jpg, .jpeg, .png, .mp4, .mov" required>
        <button type="submit">Detect</button>
    </form>
    <div id="loading">Loading...</div>
</body>
</html>