Create a new folder for your project and add an index.html
file. In this file, we’ll include the necessary libraries via CDN:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Real-Time Object Detection</title>
<style>
body {
text-align: center;
background: #222;
color: #fff;
font-family: sans-serif;
}
canvas {
border: 2px solid #fff;
}
</style>
</head>
<body>
<h1>Real-Time Object Detection Web App</h1>
<!-- p5.js and TensorFlow.js -->
<script src="https://cdn.jsdelivr.net/npm/p5@1.6.0/lib/p5.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@4.6.0/dist/tf.min.js"></script>
<!-- Pre-trained model: COCO-SSD -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/coco-ssd"></script>
<script src="sketch.js"></script>
</body>
</html>