File size: 3,553 Bytes
052979d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D Trajectory Tracker</title>
    <link rel="stylesheet" href="/static/styles.css">
</head>
<body>
    <div class="container">
        <header>
            <h1>🎯 3D Trajectory Tracker</h1>
            <p>Upload a video to track and visualize object movements in 3D</p>
        </header>

        <div class="upload-section">
            <div class="upload-box" id="uploadBox">
                <input type="file" id="videoInput" accept="video/*" hidden>
                <div class="upload-content">
                    <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                        <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
                        <polyline points="17 8 12 3 7 8"></polyline>
                        <line x1="12" y1="3" x2="12" y2="15"></line>
                    </svg>
                    <h3>Drop video here or click to upload</h3>
                    <p>Supports MP4, AVI, MOV, MKV</p>
                </div>
            </div>
            <button id="uploadBtn" class="btn primary" style="display: none;">Process Video</button>
        </div>

        <div id="loadingSection" class="loading-section" style="display: none;">
            <div class="spinner"></div>
            <p>Processing video... This may take a few moments.</p>
        </div>

        <div id="resultsSection" class="results-section" style="display: none;">
            <div class="stats-panel">
                <h3>📊 Tracking Statistics</h3>
                <div class="stats-grid">
                    <div class="stat-item">
                        <span class="stat-label">Objects Tracked:</span>
                        <span class="stat-value" id="statObjects">0</span>
                    </div>
                    <div class="stat-item">
                        <span class="stat-label">Total Frames:</span>
                        <span class="stat-value" id="statFrames">0</span>
                    </div>
                    <div class="stat-item">
                        <span class="stat-label">FPS:</span>
                        <span class="stat-value" id="statFPS">0</span>
                    </div>
                    <div class="stat-item">
                        <span class="stat-label">Duration:</span>
                        <span class="stat-value" id="statDuration">0s</span>
                    </div>
                </div>
            </div>

            <div class="visualization-panel">
                <h3>🎬 3D Trajectory Visualization</h3>
                <div class="controls">
                    <button id="playBtn" class="btn">▶ Play</button>
                    <button id="resetBtn" class="btn">↻ Reset</button>
                    <label>
                        <input type="checkbox" id="showTrails" checked>
                        Show Trails
                    </label>
                </div>
                <div id="canvas3d"></div>
            </div>
        </div>

        <footer>
            <p>Built with FastAPI, Three.js, and OpenCV</p>
        </footer>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js"></script>
    <script src="/static/visualizer.js"></script>
    <script src="/static/app.js"></script>
</body>
</html>