|
|
<!DOCTYPE html>
|
|
|
<html lang="en">
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
<title>MTG Card Segmentation - Real-time Detection</title>
|
|
|
<link rel="stylesheet" href="style.css">
|
|
|
</head>
|
|
|
<body>
|
|
|
<div class="container">
|
|
|
<header>
|
|
|
<h1>🎴 MTG Card Segmentation</h1>
|
|
|
<p>Real-time MTG Cards Semantic Segmentation</p>
|
|
|
</header>
|
|
|
|
|
|
<main>
|
|
|
|
|
|
<div class="camera-selection" id="cameraSelection">
|
|
|
<h2>Select Camera</h2>
|
|
|
<select id="cameraSelect" class="camera-dropdown">
|
|
|
<option value="">Loading cameras...</option>
|
|
|
</select>
|
|
|
<button id="startCamera" class="btn btn-primary" disabled>Start Camera</button>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="video-container" id="videoContainer" style="display: none;">
|
|
|
<div class="video-wrapper">
|
|
|
<video id="videoElement" autoplay muted playsinline></video>
|
|
|
<canvas id="overlayCanvas"></canvas>
|
|
|
<div id="overlayCard"></div>
|
|
|
</div>
|
|
|
|
|
|
<div class="controls">
|
|
|
<button id="toggleInference" class="btn btn-success">Start Detection</button>
|
|
|
<button id="switchCamera" class="btn btn-secondary">Switch Camera</button>
|
|
|
<div class="info">
|
|
|
<span id="resolutionInfo">Resolution: --</span>
|
|
|
<span id="fpsInfo">FPS: --</span>
|
|
|
<span id="inferenceStatus">Detection: Off</span>
|
|
|
<span id="accelerationInfo">Acceleration: --</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="loading" id="loadingIndicator">
|
|
|
<div class="spinner"></div>
|
|
|
<p id="loadingText">Loading model...</p>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="error" id="errorDisplay" style="display: none;">
|
|
|
<h3>⚠️ Error</h3>
|
|
|
<p id="errorMessage"></p>
|
|
|
<button id="retryButton" class="btn btn-primary">Retry</button>
|
|
|
</div>
|
|
|
</main>
|
|
|
|
|
|
<footer>
|
|
|
<p>Powered by ONNX Runtime Web</p>
|
|
|
<p>Source code in <b><a target="_blank" href="https://github.com/diegovazquez/mtg_card_image_segmentation">Github</a></b></p>
|
|
|
</footer>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<script src="https://cdn.jsdelivr.net/npm/onnxruntime-web@1.22.0/dist/ort.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script src="bundle.js"></script>
|
|
|
</body>
|
|
|
</html>
|
|
|
|