Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    <meta name="viewport" width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0>
    <style> body {padding: 0; margin: 0;} </style>
  <script src=""></script>
  <script src=""></script>
   <script src="" type="text/javascript"></script>
    <script src="sketch.js"></script>




                //Sea of Memory I
//made using  the ml5.js and p5.js libraries: 

let mobilenet;
let video;
let label = '';
let label2 = '';
let label3 = '';
let conf;
let prob = '';

function modelReady() {
    console.log('Model ready');
    mobilenet.predict(video, gotResult);

function gotResult(error, results) {
    if (error) {
    } else {
    label = results[0].className;
    label2 = results[1].className;
    label3 = results[2].className;
    prob = results[0].probability;
    mobilenet.predict(video, gotResult);

function setup() {
  createCanvas(windowWidth, windowHeight);
  video = createCapture(VIDEO);
  mobilenet = ml5.imageClassifier('MobileNet', video, modelReady);

function draw() {
    background(0, 0.9);
  //the more confident the computer is in its guess, the brighter the text will be
    conf = map(prob, 0, 1, 0, 255);
  //text displaying the top three guesses of what the computer can see. 
    text(label, random(0, width-200), random(0, height-30));
    text(label2, random(0, width-200), random(0, height-30));
    text(label3, random(0, width-200), random(0, height-10));