I am trying to run posenet on my website using p5 and its setup of a canvas. The only other things on this page is the navbar at the top and the footer at the bottom. Since the canvas isn't created until after I accept permissions for video, the canvas ends up being created below the footer.
<!-- <div>
<br />
<h1 class="display-4">
Demo
</h1>
<script src="camera.js"></script>
<br />
</div> -->
Above is the section in the HTML where the script is supposed to run. Below is the javascript that is supposed to setup the canvas with video
'''
let video;
let poseNet;
let pose;
function setup(){
createCanvas(640, 480);
video = createCapture(VIDEO);
video.hide();
poseNet = ml5.poseNet(video, modelLoaded);
poseNet.on("pose", gotPoses)
}
'''