Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move examples from ml5-example to the core ml5-library repo #831

Merged
merged 20 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
dc360b4
Move example scripts into root directory scripts folder
bomanimc Mar 8, 2020
42dadf3
Delete package.json and LICENSE in examples sub-directory
bomanimc Mar 8, 2020
b2332ec
Use the Copy plugin for webpack to move examples into the dist folder
bomanimc Mar 8, 2020
983b37b
Add live-server for examples directory
bomanimc Mar 11, 2020
4a20524
Use a relative path for example links
bomanimc Mar 12, 2020
7623da4
Update to more descriptive variables names in the update-examples-jso…
bomanimc Mar 13, 2020
3c0af80
Make the live-server map requests from the base path to the examples/…
bomanimc Mar 14, 2020
1384089
Concurrently run webpack-dev-server and live-server so that examples …
bomanimc Mar 14, 2020
3694ab2
Replace reference to locally served ml5.js file with unpkg distributi…
bomanimc Mar 14, 2020
428b3ac
Move live-server and recursive-readdir to dev deependencies
bomanimc Mar 14, 2020
4a3bfd8
Don't open the browser when the devserver for ml5.js finishes loading
bomanimc Mar 14, 2020
1be13bf
Remove scripts for updating ml5 references that are now unnecessary
bomanimc Mar 14, 2020
fc6b205
Small refinements to the scripts for serving examples
bomanimc Mar 14, 2020
1499a96
Make cleanup-oriented changes to the update-examples-json.js file
bomanimc Mar 14, 2020
f518e9d
Change examples json update command name to examples:update-json
bomanimc Mar 15, 2020
21d74ff
Update contributor documentation to remove references to a separate m…
bomanimc Mar 15, 2020
004a2b2
Change docs to reference examples directories in the ml5-library repo…
bomanimc Mar 15, 2020
3b2a89d
Separate examples and library files into separate build target files
bomanimc Mar 16, 2020
4826bc9
Run the examples JSON update script when the examples directory are b…
bomanimc Mar 26, 2020
9662522
Update towards mounting the ./examples directory instead of ./example…
bomanimc Mar 26, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ I'm submitting a new issue. Please see the details below.


### → Step 3: Share an example of the issue 🦄
> Here's some example code or a demonstration of in https://github.com/ml5js/ml5-examples OR in the https://editor.p5js.org or codepen/jsfiddle/etc...
> Here's some example code or a demonstration of my feature in this issue, separe GitHub repo, or in the https://editor.p5js.org or codepen/jsfiddle/Glitch/etc...



Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ I'm making a Pull Request(PR). Please see the details below.
**A great PR 🌟🌟**

### → Step 3: Share a Relevant Example 🦄
> Here's some example code or a link to another PR in https://github.com/ml5js/ml5-examples OR in the https://editor.p5js.org or codepen/jsfiddle/etc...
> Here's some example code or a demonstration of my feature as a part of this pull request, a separate pull request, in the https://editor.p5js.org, or codepen/jsfiddle/etc...



Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ training/lstm/data/t
/public
/static
/dist
/dist_examples

website/translated_docs
website/build/
Expand Down
47 changes: 7 additions & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ ml5.js is comprised a number of sister repositories which you can find at the [m

- **The 3 main repositories you'll likely be working with**:
+ [ml5-library]([https://github.com/ml5js](https://github.com/ml5js/ml5-library))
* this is the main ml5js library. When building the library, all of the files in the `/src` directory get bundled into the `ml5.js` library. Releases to the ml5 library get sent to `npm` and are hosted at https://unpkg.com/ (e.g. `https://unpkg.com/[email protected]/dist/ml5.min.js`)
+ [ml5-examples](https://github.com/ml5js/ml5-examples)
* the ml5-examples repo showcases the functionality of the ml5-library. When submitting new features or updates to the ml5 library, you should also make a pull request to the ml5-examples repo to showcase how your new feature works. Usually examples are submitted in a simple p5.js sketch, but they can also be in vanilla javascript.
* this is the main ml5js library. When building the library, all of the files in the `/src` directory get bundled into the `ml5.js` library. Releases to the ml5 library get sent to `npm` and are hosted at https://unpkg.com/ (e.g. `https://unpkg.com/[email protected]/dist/ml5.min.js`). When adding new features or updates to the ml5 library, you should also add an example in the `examples/` subdirectory of this repo to showcase how your new feature works. Usually examples are submitted in a simple p5.js sketch, but they can also be in vanilla javascript.
+ [ml5-website](https://github.com/ml5js/ml5-website)
* the ml5-website is what you see here: https://ml5js.org/. As we make changes to the ml5 API and examples, the website also needs to be updated. For now, we're working with a manual process to updating changes, but we're working on development processes to help sync all these efforts. For now, make sure to update the ml5-examples and ml5-website when making changes to ml5-library and vice-versa.
* the ml5-website is what you see here: https://ml5js.org/. As we make changes to the ml5 API and examples, the website also needs to be updated. For now, we're working with a manual process to updating changes, but we're working on development processes to help sync all these efforts. For now, make sure to update the ml5-website when making changes to ml5-library and vice-versa.
- **Data and models**:
+ [ml5-data-and-models](https://github.com/ml5js/ml5-data-and-models)
* This repository stores data sets and pre-trained models you can use in ml5.js.
Expand Down Expand Up @@ -49,8 +47,8 @@ Preamble: If you're interested in to contribute to the ml5 project, just know yo
3. you make a comment on an existing issue or post your issue and indicate that you're curious to do your best to add this to ml5-library 🔬
4. you create a new branch on your `forked` copy of the ml5-library and call it something meaningful like `new-generative-model-x`
5. you jam on your new feature, commit your changes with meaningful commit messages, and push your changes to your new feature branch (e.g. `new-generative-model-x`)
6. when ready, make a pull request to the `development` branch of ml5-library. Submit to the `development` since your feature is part of the new frontier of the ml5-library. Important is step 7 below.
7. you should also submit a pull request to ml5-examples with an example of your new feature so the ml5 dev team can run your proposed feature and provide feedback.
6. you should also add an example of your new feature to the `examples/` directory so that other people can learn how to use your new feature.
7. when ready, make a pull request to the `development` branch of ml5-library. Submit to the `development` since your feature is part of the new frontier of the ml5-library. Important is step 7 below.
8. the ml5 dev team will review your changes and quite likely correspond with you on your changes. When all looks good, your changes will be merged in. 🎉
9. hi-fives 👏 and hugs 🤗

Expand Down Expand Up @@ -235,7 +233,7 @@ NVM_HOMEBREW="/usr/local/opt/nvm/nvm.sh"

Just be sure to add files before running commitizen!

7. (OPTIONAL) Push your code and submit a Pull Request! Remember if you make a pull request on a new features or feature update you should make a parallel pull request to the ml5-examples repo so that others can use your new feature and test it out.
7. (OPTIONAL) Push your code and submit a Pull Request!

## Running Unit Tests

Expand Down Expand Up @@ -318,39 +316,8 @@ npm run publish:npm
```

7. Enter your multi-factor auth when prompted where it says `OTP` (one time password): `your OTP code`
8. Your new npm version should be released!

Now what is important is that you:

1. go to Github and document that new release with `release notes`.
2. go to `ml5-examples` and make sure you have the latest development branch stuff:

```
git checkout development
git fetch
git pull
```

3. then make a new branch for deployment e.g. `new-release-v0.3.2` and update the ml5 references on all examples:

```
git checkout -b new-release-v0.3.2
npm run update-ml5 0.3.2
git add .
git commit -m "update examples to v0.3.2"
```

4. Fix any merge conflicts if necessary

```
git push origin new-release-v0.3.2
git tag v0.3.2
git push --tags
```

5. Merge `new-release-v0.3.2` with `release`
6. Add release notes to the latest release
7. Merge `release` with `master` (for the github pages & website)
8. Your new npm version should be released!
9. Lastly, go to Github and document that new release with `release notes`.


## Additional Resources
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ For example:

- [Getting Started](https://ml5js.org/getting-started/)
- [API Reference](https://ml5js.org/reference/)
- [Examples](https://github.com/ml5js/ml5-examples)
- [Examples](https://github.com/ml5js/ml5-library/tree/development/examples)
- [Community](https://ml5js.org/community)
- [FAQ](https://ml5js.org/getting-started/faq/)

## Standalone Examples

You can find a collection of standalone examples in this repository: [github.com/ml5js/ml5-examples](https://github.com/ml5js/ml5-examples)
You can find a collection of standalone examples in this repository within the `examples/` directory. You can also test working hosted of the examples online on the ml5.js examples index website (TODO: Add a link).

These examples are meant to serve as an introduction to the library and machine learning concepts.

Expand Down
14 changes: 7 additions & 7 deletions docs/reference/bodypix.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ bodyPix.segmentWithParts(?input, ?options, callback);
## Examples

**p5.js**
* [BodyPix_Image](https://github.com/ml5js/ml5-examples/tree/development/p5js/BodyPix/BodyPix_Image)
* [BodyPix_Webcam](https://github.com/ml5js/ml5-examples/tree/development/p5js/BodyPix/BodyPix_Webcam)
* [BodyPix_Webcam_Parts](https://github.com/ml5js/ml5-examples/tree/development/p5js/BodyPix/BodyPix_Webcam_Parts)
* [BodyPix_p5Instance](https://github.com/ml5js/ml5-examples/tree/development/p5js/BodyPix/BodyPix_p5Instance)
* [BodyPix_Image](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/BodyPix/BodyPix_Image)
* [BodyPix_Webcam](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/BodyPix/BodyPix_Webcam)
* [BodyPix_Webcam_Parts](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/BodyPix/BodyPix_Webcam_Parts)
* [BodyPix_p5Instance](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/BodyPix/BodyPix_p5Instance)

**p5 web editor**
* [BodyPix_Image](https://editor.p5js.org/ml5/sketches/BodyPix_Image)
Expand All @@ -274,9 +274,9 @@ bodyPix.segmentWithParts(?input, ?options, callback);
* [BodyPix_p5Instance](https://editor.p5js.org/ml5/sketches/BodyPix_p5Instance)

**plain javascript**
* [BodyPix_Image](https://github.com/ml5js/ml5-examples/tree/development/javascript/BodyPix/BodyPix_Image)
* [BodyPix_Webcam](https://github.com/ml5js/ml5-examples/tree/development/javascript/BodyPix/BodyPix_Webcam)
* [BodyPix_Webcam_Parts](https://github.com/ml5js/ml5-examples/tree/development/javascript/BodyPix/BodyPix_Webcam_Parts)
* [BodyPix_Image](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/BodyPix/BodyPix_Image)
* [BodyPix_Webcam](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/BodyPix/BodyPix_Webcam)
* [BodyPix_Webcam_Parts](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/BodyPix/BodyPix_Webcam_Parts)

## Demo

Expand Down
12 changes: 6 additions & 6 deletions docs/reference/charrnn.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ charrnn.reset();
## Examples

**p5.js**
* [CharRNN_Interactive](https://github.com/ml5js/ml5-examples/tree/development/p5js/CharRNN/CharRNN_Interactive)
* [CharRNN_Text](https://github.com/ml5js/ml5-examples/tree/development/p5js/CharRNN/CharRNN_Text)
* [CharRNN_Text_Stateful](https://github.com/ml5js/ml5-examples/tree/development/p5js/CharRNN/CharRNN_Text_Stateful)
* [CharRNN_Interactive](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/CharRNN/CharRNN_Interactive)
* [CharRNN_Text](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/CharRNN/CharRNN_Text)
* [CharRNN_Text_Stateful](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/CharRNN/CharRNN_Text_Stateful)

**p5 web editor**

Expand All @@ -164,9 +164,9 @@ charrnn.reset();
* [CharRNN_Text_Stateful](https://editor.p5js.org/ml5/sketches/CharRNN_Text_Stateful)

**plain javascript**
* [CharRNN_Interactive](https://github.com/ml5js/ml5-examples/tree/development/javascript/CharRNN/CharRNN_Interactive)
* [CharRNN_Text](https://github.com/ml5js/ml5-examples/tree/development/javascript/CharRNN/CharRNN_Text)
* [CharRNN_Text_Stateful](https://github.com/ml5js/ml5-examples/tree/development/javascript/CharRNN/CharRNN_Text_Stateful)
* [CharRNN_Interactive](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/CharRNN/CharRNN_Interactive)
* [CharRNN_Text](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/CharRNN/CharRNN_Text)
* [CharRNN_Text_Stateful](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/CharRNN/CharRNN_Text_Stateful)

## Demo

Expand Down
4 changes: 2 additions & 2 deletions docs/reference/cvae.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ cvae.generate(label, callback);
## Examples

**p5.js**
* [CVAE_QuickDraw](https://github.com/ml5js/ml5-examples/tree/development/p5js/CVAE/CVAE_QuickDraw)
* [CVAE_QuickDraw](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/CVAE/CVAE_QuickDraw)

**p5 web editor**
* [CVAE_QuickDraw](https://editor.p5js.org/ml5/sketches/CVAE_QuickDraw)

**plain javascript**
* [CVAE_QuickDraw](https://github.com/ml5js/ml5-examples/tree/development/javascript/CVAE/CVAE_QuickDraw)
* [CVAE_QuickDraw](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/CVAE/CVAE_QuickDraw)


## Demo
Expand Down
16 changes: 8 additions & 8 deletions docs/reference/dcgan.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ dcgan.generate(callback, ?latentVector);
## Examples

**p5.js**
* [DCGAN_LatentVector](https://github.com/ml5js/ml5-examples/tree/development/p5js/DCGAN/DCGAN_LatentVector)
* [DCGAN_LatentVector_RandomWalk](https://github.com/ml5js/ml5-examples/tree/development/p5js/DCGAN/DCGAN_LatentVector_RandomWalk)
* [DCGAN_LatentVector_Slider](https://github.com/ml5js/ml5-examples/tree/development/p5js/DCGAN/DCGAN_LatentVector_Slider)
* [DCGAN_Random](https://github.com/ml5js/ml5-examples/tree/development/p5js/DCGAN/DCGAN_Random)
* [DCGAN_LatentVector](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/DCGAN/DCGAN_LatentVector)
* [DCGAN_LatentVector_RandomWalk](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/DCGAN/DCGAN_LatentVector_RandomWalk)
* [DCGAN_LatentVector_Slider](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/DCGAN/DCGAN_LatentVector_Slider)
* [DCGAN_Random](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/DCGAN/DCGAN_Random)

**p5 web editor**
* [DCGAN_LatentVector](https://editor.p5js.org/ml5/sketches/DCGAN_LatentVector)
Expand All @@ -115,10 +115,10 @@ dcgan.generate(callback, ?latentVector);


**plain javascript**
* [DCGAN_LatentVector](https://github.com/ml5js/ml5-examples/tree/development/javascript/DCGAN/DCGAN_LatentVector)
* [DCGAN_LatentVector_RandomWalk](https://github.com/ml5js/ml5-examples/tree/development/javascript/DCGAN/DCGAN_LatentVector_RandomWalk)
* [DCGAN_LatentVector_Slider](https://github.com/ml5js/ml5-examples/tree/development/javascript/DCGAN/DCGAN_LatentVector_Slider)
* [DCGAN_Random](https://github.com/ml5js/ml5-examples/tree/development/javascript/DCGAN/DCGAN_Random)
* [DCGAN_LatentVector](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/DCGAN/DCGAN_LatentVector)
* [DCGAN_LatentVector_RandomWalk](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/DCGAN/DCGAN_LatentVector_RandomWalk)
* [DCGAN_LatentVector_Slider](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/DCGAN/DCGAN_LatentVector_Slider)
* [DCGAN_Random](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/DCGAN/DCGAN_Random)



Expand Down
12 changes: 6 additions & 6 deletions docs/reference/face-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,18 +139,18 @@ faceapi.detectSingle(optionsOrCallback, configOrCallback, callback);
## Examples

**p5.js**
* [FaceApi_Image_Landmarks](https://github.com/ml5js/ml5-examples/tree/development/p5js/FaceApi/FaceApi_Image_Landmarks)
* [FaceApi_Video_Landmarks](https://github.com/ml5js/ml5-examples/tree/development/p5js/FaceApi/FaceApi_Video_Landmarks)
* [FaceApi_Video_Landmarks_LocalModels](https://github.com/ml5js/ml5-examples/tree/development/p5js/FaceApi/FaceApi_Video_Landmarks_LocalModels)
* [FaceApi_Image_Landmarks](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/FaceApi/FaceApi_Image_Landmarks)
* [FaceApi_Video_Landmarks](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/FaceApi/FaceApi_Video_Landmarks)
* [FaceApi_Video_Landmarks_LocalModels](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/FaceApi/FaceApi_Video_Landmarks_LocalModels)

**p5 web editor**
* [FaceApi_Image_Landmarks](https://editor.p5js.org/ml5/sketches/FaceApi_Image_Landmarks)
* [FaceApi_Video_Landmarks](https://editor.p5js.org/ml5/sketches/FaceApi_Video_Landmarks)

**plain javascript**
* [FaceApi_Image_Landmarks](https://github.com/ml5js/ml5-examples/tree/development/javascript/FaceApi/FaceApi_Image_Landmarks/)
* [FaceApi_Video_Landmarks](https://github.com/ml5js/ml5-examples/tree/development/javascript/FaceApi/FaceApi_Video_Landmarks/)
* [FaceApi_Video_Landmarks_LocalModels](https://github.com/ml5js/ml5-examples/tree/development/javascript/FaceApi/FaceApi_Video_Landmarks_LocalModels/)
* [FaceApi_Image_Landmarks](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/FaceApi/FaceApi_Image_Landmarks/)
* [FaceApi_Video_Landmarks](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/FaceApi/FaceApi_Video_Landmarks/)
* [FaceApi_Video_Landmarks_LocalModels](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/FaceApi/FaceApi_Video_Landmarks_LocalModels/)

## Demo

Expand Down
8 changes: 4 additions & 4 deletions docs/reference/feature-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,17 +256,17 @@ featureExtractor.load(filesOrPath = null, callback);
## Examples

**p5.js**
* [FeatureExtractor_Image_Regression](https://github.com/ml5js/ml5-examples/tree/development/p5js/FeatureExtractor/FeatureExtractor_Image_Regression)
* [FeatureExtractor_Image_Classification](https://github.com/ml5js/ml5-examples/tree/development/p5js/FeatureExtractor/FeatureExtractor_Image_Classification)
* [FeatureExtractor_Image_Regression](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/FeatureExtractor/FeatureExtractor_Image_Regression)
* [FeatureExtractor_Image_Classification](https://github.com/ml5js/ml5-library/tree/development/examples/p5js/FeatureExtractor/FeatureExtractor_Image_Classification)

**p5 web editor**
* [FeatureExtractor_Image_Regression](https://editor.p5js.org/ml5/sketches/FeatureExtractor_Image_Regression)
* [FeatureExtractor_Image_Classification](https://editor.p5js.org/ml5/sketches/FeatureExtractor_Image_Classification)


**plain javascript**
* [FeatureExtractor_Image_Regression](https://github.com/ml5js/ml5-examples/tree/development/javascript/FeatureExtractor/FeatureExtractor_Image_Regression)
* [FeatureExtractor_Image_Classification](https://github.com/ml5js/ml5-examples/tree/development/javascript/FeatureExtractor/FeatureExtractor_Image_Classification)
* [FeatureExtractor_Image_Regression](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/FeatureExtractor/FeatureExtractor_Image_Regression)
* [FeatureExtractor_Image_Classification](https://github.com/ml5js/ml5-library/tree/development/examples/javascript/FeatureExtractor/FeatureExtractor_Image_Classification)



Expand Down
Loading