MCPcopy Create free account
hub / github.com/ml5js/ml5-library / draw

Function draw

examples/javascript/StyleTransfer/StyleTransfer_Video/sketch.js:44–52  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42setup();
43
44function draw(){
45 requestAnimationFrame(draw);
46 // Switch between showing the raw camera or the style
47 if (isTransferring) {
48 ctx.drawImage(resultImg, 0, 0, 320, 240);
49 } else {
50 ctx.drawImage(video, 0, 0, 320, 240);
51 }
52}
53
54// A function to call when the model has been loaded.
55function modelLoaded() {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected