Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

ml5js/ml5-examples

Repository files navigation

NOTE: This repository is archived and its contents have been moved into the core ml5-library repository. If you have an outstanding issue or pull request on this repository, please open it on ml5-library. Please feel free to read more and follow updates on issue #809 and pull request #831. You can view the examples index site at https://examples.ml5js.org.


ml5 Examples

Description

This repository contains a collection of examples using ml5.js. The examples are meant to serve as an introduction to the library and machine learning concepts.

Examples are organized into folders according to their integration with other JavaScript libraries.

For example, the /p5js folder holds examples of using ml5.js with p5.js. All examples are self-contained and can be run independently. Libraries are loaded through a Content Delivery Network (CDN) and certain examples (indicated in code comments) download a machine learning model from a "cloud" url. This means that ml5 currently relies on an internet connection in order to retrieve pre-trained models (unless they are served locally).

Instead of using the CDN links to p5 and ml5, you can download the p5.js libraries here and ml5 library here.

Setup

Step 1: or clone this repository:

Open your terminal and type:

# clone the repo or download the zip file
git clone https://github.com/ml5js/ml5-examples.git

Step 2: start a local development server

Open your terminal

# change directories
cd ml5-examples

# install the dependencies
npm install

# run the local web server
npm run develop

# you should be able to run the examples at: 
# localhost:8082

If you don't know how to start a server, check this guide on how to start a local web server.

Usage

Open your terminal

# change directories
cd ml5-examples

# run the local web server
npm run develop

# you should be able to run the examples at: 
# localhost:8082

Examples Index

Contributing

See CONTRIBUTING.MD

Contributors