-
Notifications
You must be signed in to change notification settings - Fork 18
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
add image classifier model #65
Conversation
Hi @OrpheasK - kudos to getting this to a mergable state! I'll quickly look through the changed files and add comments if something jumps out. Best from Shanghai |
} | ||
// The results are in an array ordered by confidence. | ||
console.log(results); | ||
resultsP.html(`Label: ${results[0].label } ${nf(results[0].confidence, 0, 2)}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be more beginner friendly to do this without template literals here.
examples/Sentiment/imindex.js
Outdated
@@ -0,0 +1,28 @@ | |||
import neuralNetwork from "./NeuralNetwork"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file looks like it might have been accidentally included?
package.json
Outdated
"@tensorflow-models/pose-detection": "^2.1.0", | ||
"@tensorflow/tfjs": "^4.2.0", | ||
"@tensorflow/tfjs-vis": "^1.5.1", | ||
"axios": "^1.3.4", | ||
"webpack-merge": "^5.9.0" | ||
}, | ||
"overrides": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We explored "overrides" before @ziyuan-linn made us switch to yarn
, where this doesn't seem to be necessary anymore. Probably good to delete this, especially if it installs on yarn without it.
This is looking fantastic @OrpheasK, yay! Once this is merged I think we'll be able to make this repo the official new ml5.js release! I quickly tested the video example with a teachable machine model, but got an error. Have you tried TM models yet? Here's a URL for testing: function preload() {
classifier = ml5.imageClassifier(
"https://teachablemachine.withgoogle.com/models/bXy2kDNi/model.json"
);
} |
This commit enables the Image Classifier functionality with Teachable Machine models. It also introduces classifyStop() to be used along with classifyStart() for video classification. On that end, the flags isClassifying, signalStop, prevStart are added to maintain a consistent structure of code with the other ml5 models which make use of detectStart()/detectStop(). All models included are functional with Mobilenet and Teachable Machine tested more thoroughly. Some of them still require image resizing and for those imgToTensor() is applied to the input similarly to the previous version of ml5. |
// Copyright (c) 2018 ml5 | ||
// | ||
// This software is released under the MIT License. | ||
// https://opensource.org/licenses/MIT | ||
|
||
export function getTopKClassesFromArray(values, topK, CLASSES) { | ||
const valuesAndIndices = []; | ||
for (let i = 0; i < values.length; i += 1) { | ||
valuesAndIndices.push({ | ||
value: values[i], | ||
index: i, | ||
}); | ||
} | ||
valuesAndIndices.sort((a, b) => b.value - a.value); | ||
|
||
const topkValues = new Float32Array(topK); | ||
const topkIndices = new Int32Array(topK); | ||
for (let i = 0; i < topK; i += 1) { | ||
topkValues[i] = valuesAndIndices[i].value; | ||
topkIndices[i] = valuesAndIndices[i].index; | ||
} | ||
|
||
const topClassesAndProbs = []; | ||
for (let i = 0; i < topkIndices.length; i += 1) { | ||
topClassesAndProbs.push({ | ||
className: CLASSES[topkIndices[i]], | ||
probability: topkValues[i], | ||
}); | ||
} | ||
return topClassesAndProbs; | ||
} | ||
|
||
export async function getTopKClassesFromTensor(logits, topK, CLASSES) { | ||
const values = await logits.data(); | ||
return getTopKClassesFromArray(values, topK, CLASSES); | ||
} | ||
|
||
export default { getTopKClassesFromArray, getTopKClassesFromTensor } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is so frustrating to see all the work that I have put into this library being completely ignored. I rewrote this utility to be cleaner, more efficient, better documented, and handle more situations. Why are we still using the old version?
let image; | ||
if (!(img instanceof tf.Tensor)) { | ||
if (img instanceof HTMLImageElement | ||
|| img instanceof HTMLVideoElement | ||
|| img instanceof HTMLCanvasElement | ||
|| img instanceof ImageData) { | ||
image = tf.browser.fromPixels(img); | ||
} else if (typeof img === 'object' && (img.elt instanceof HTMLImageElement | ||
|| img.elt instanceof HTMLVideoElement | ||
|| img.elt instanceof HTMLCanvasElement | ||
|| img.elt instanceof ImageData)) { | ||
image = tf.browser.fromPixels(img.elt); // Handle p5.js image, video and canvas. | ||
} | ||
} else { | ||
image = img; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire block is not necessary because img
is already a Tensor. I explained that and I fixed it in ml5js/ml5-library#1396 but no one is even looking!?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @lindapaiste for highlighting this! I'll be in touch to coordinate a meeting where we can look at the best way to integrate the work you did in the previous repo. Thank you for your patience with us!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@OrpheasK I left some nitpicky comments mostly about the examples. I tested and the examples are working well, thank you for this work! My apologies again to @lindapaiste, I'll be coordinating a meeting to discuss if it makes the most sense to merge this and then integrate Linda's work or whether we want to integrate it into this branch before merging. Thanks everyone!
createCanvas(640, 480); | ||
background(255); | ||
textSize(32); | ||
fill(255); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpicking comment, but i would put the modifiers for drawing the text in draw()
let classifier; | ||
|
||
// A variable to hold the video we want to classify | ||
let vid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using video
is perhaps more clear?
} | ||
|
||
//A mouse click to stop and restart the classification process | ||
function mousePressed(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe the basic example doesn't need to show how to stop the classifier, just with a mouse press might be confusing to the user.
examples/ImageClassifier/index.html
Outdated
<script src="../../dist/ml5.js"></script> | ||
</head> | ||
<body> | ||
<h1>Image classification using MobileNet</h1> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would take out the <h1>
elements as they can be confusing for beginners especially if the primary environment is the p5.js web editor and they aren't used to editing index.html.
let image; | ||
if (!(img instanceof tf.Tensor)) { | ||
if (img instanceof HTMLImageElement | ||
|| img instanceof HTMLVideoElement | ||
|| img instanceof HTMLCanvasElement | ||
|| img instanceof ImageData) { | ||
image = tf.browser.fromPixels(img); | ||
} else if (typeof img === 'object' && (img.elt instanceof HTMLImageElement | ||
|| img.elt instanceof HTMLVideoElement | ||
|| img.elt instanceof HTMLCanvasElement | ||
|| img.elt instanceof ImageData)) { | ||
image = tf.browser.fromPixels(img.elt); // Handle p5.js image, video and canvas. | ||
} | ||
} else { | ||
image = img; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @lindapaiste for highlighting this! I'll be in touch to coordinate a meeting where we can look at the best way to integrate the work you did in the previous repo. Thank you for your patience with us!
Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com>
Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com>
@OrpheasK here's a plain JS version of the pre-processing utilities from ml5js/ml5-library#1398 the rest of that PR is already in JS and should be usable. import * as tf from '@tensorflow/tfjs';
/**
* Common operations for pre-processing and post-processing images.
*/
/**
* Rescale the pixel values from one range to another.
*
* @param {tf.Tensor} tensor
* @param {number} inMin
* @param {number} inMax
* @param {number} outMin
* @param {number} outMax
* @return {tf.Tensor}
*/
function rescale(tensor, inMin, inMax, outMin, outMax) {
// Note: could be one chained operation if useless ops like .sub(0) .div(1) are not a concern.
return tf.tidy(() => {
let result = tensor.toFloat();
if (inMin !== 0) {
result = tf.sub(result, tf.scalar(inMin));
}
const divisor = (inMax - inMin) / (outMax - outMin);
if (divisor !== 1) {
result = tf.div(result, tf.scalar(divisor));
}
if (outMin !== 0) {
result = tf.add(result, tf.scalar(outMin));
}
return result;
});
}
export default class ImageProcessor {
/**
* @typedef {Object} ProcessorConfig
* @property {[number, number, number] | [number, number, number, number]} inputShape
* @property {[number, number]} inputRange - Value range expected by the model. Typically [-1, 1] or [0, 1].
* @property {boolean} [alignCorners] - default `false`
* @property {'bilinear' | 'nearest'} [resizeMethod] - default 'bilinear'
*
* @param {ProcessorConfig} config
*/
constructor(config) {
/**
* @type {ProcessorConfig} - The options which were passed to the constructor.
* @readonly
*/
this.config = config;
// Derive size and numChannels from the inputShape.
const shape = config.inputShape;
const [height, width, numChannels] = shape.length === 3 ? shape : shape.slice(1);
/**
* @type {number} - The depth of the expected image. Can be 1 (grayscale), 3 (RGB) or 4 (RGBA).
* @readonly
*/
this.numChannels = numChannels;
/**
* @type {[number, number]} - The image input size expected by the underlying model.
* @readonly
*/
this.size = [height, width];
}
/**
* @param {tf.Tensor3D|tf.Tensor4D} input
* @return {tf.Tensor3D|tf.Tensor4D}
*/
resize(input) {
// Skip no-op resize.
if (input.shape[0] === this.size[0] && input.shape[1] === this.size[1]) return input;
// Use appropriate method based on config.
const resizeFn = this.config.resizeMethod === 'nearest' ? tf.image.resizeNearestNeighbor : tf.image.resizeBilinear;
return resizeFn(input, this.size, this.config.alignCorners);
}
/**
* Pre-process an image based on the provided config. Handles:
* - conversion to tensor
* - correct number of channels (alpha, grayscale)
* - resizing
* - scaling the range of values
* - converting to 4D batch (if needed)
*
* @param {tf.Tensor3D | HTMLVideoElement | HTMLCanvasElement | HTMLImageElement} input
* @return {tf.Tensor3D|tf.Tensor4D}
* @public
*/
preProcess(input) {
return tf.tidy(() => {
// Convert to tensor, handle depth.
const tensor = (input instanceof tf.Tensor) ? input : tf.browser.fromPixels(input, this.numChannels);
// Resize width/height.
const resized = this.resize(tensor);
// Rescale values from range [0-255] to inputRange.
const [min, max] = this.inputRange;
const rescaled = rescale(resized, 0, 255, min, max);
// Possible batch.
return this.inputShape.length === 3 ? rescaled : rescaled.expandDims(0);
});
}
// TODO: post-process, for models which return an image
} |
Thanks for this @lindapaiste, will be looking into the integration of #1398 along with the #1396 and #1362 PRs which were mentioned in the discussion! |
I've taken another look through this pull request and as we discussed, I think it makes sense to merged first and we can look at bringing in the enhancements, optimizations, and code cleanup proposed by @lindapaiste in separate branches, thank you for everyone's patience and understanding! |
commit 8a3fa07 Merge: a3083ee 5a0b8b8 Author: Daniel Shiffman <daniel.shiffman@gmail.com> Date: Wed Feb 28 13:43:09 2024 -0500 Merge pull request #65 from OrpheasK/image_cl add image classifier model commit 5a0b8b8 Author: OrpheasK <o.kofinakos@gmail.com> Date: Thu Feb 15 14:56:06 2024 -0500 resolve example change commit b2dbcd4 Author: OrpheasK <o.kofinakos@gmail.com> Date: Thu Feb 15 14:46:58 2024 -0500 resolve changes commit 03bea20 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Feb 15 14:09:18 2024 -0500 Update examples/ImageClassifier-video/index.html Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com> commit c081dbe Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Feb 15 14:09:09 2024 -0500 Update examples/ImageClassifier-video/index.html Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com> commit 3443d8f Author: OrpheasK <o.kofinakos@gmail.com> Date: Fri Jan 26 17:27:21 2024 -0500 Add model functionalities, update example commit 9aeb162 Author: OrpheasK <o.kofinakos@gmail.com> Date: Mon Jan 22 23:50:45 2024 -0500 Update files commit 8577fb2 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Wed Jan 17 20:33:36 2024 -0500 Update sketch.js commit 52abe8d Author: OrpheasK <o.kofinakos@gmail.com> Date: Wed Jan 17 20:26:03 2024 -0500 Add video example, remove helper model commit f7dbf56 Author: OrpheasK <o.kofinakos@gmail.com> Date: Tue Jan 9 09:27:46 2024 -0500 Add image classifier dependencies and examples, modify model commit b452cbc Merge: ac31473 5734120 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Mon Jan 8 07:55:28 2024 -0500 Merge branch 'ml5js:main' into image_cl commit ac31473 Merge: 3665c0f 72bd2a6 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Nov 30 22:26:58 2023 -0500 Merge branch 'ml5js:main' into image_cl commit 3665c0f Author: OrpheasK <o.kofinakos@gmail.com> Date: Sun Nov 12 13:42:32 2023 -0500 add image classifier
await this.classifyInternal(image, number); | ||
// call the callback function | ||
callCallback(this.classifyInternal(image, number), callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will call the this.classifyInternal
function twice. The callCallback
function returns the underlying promise so you can await
it. You don't need line 209. You can just do await callCallback(this.classifyInternal(image, number), callback);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted, thanks for catching this, will be corrected in the upcoming Image Classifier update
|
||
// call recursively for continuous classification | ||
if (!this.signalStop){ | ||
requestAnimationFrame(classifyFrame); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the detector models we are using await tf.nextFrame()
and structuring the loop a bit differently. I don't know that one is necessarily better than the other but IMO we should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be looking into this
commit 512d143 Merge: bf7c1d9 508743f Author: Daniel Shiffman <daniel.shiffman@gmail.com> Date: Wed Mar 6 17:53:25 2024 -0500 Merge pull request #71 from ml5js/Add-option-handling Add user options handling commit 508743f Author: ziyuan-linn <zl4140@nyu.edu> Date: Mon Mar 4 21:59:30 2024 -0500 update checkEnum jsdoc commit 78acbf5 Author: Ziyuan Lin <93690311+ziyuan-linn@users.noreply.github.com> Date: Mon Mar 4 21:57:38 2024 -0500 Update src/utils/handleOptions.js Co-authored-by: Linda Paiste <lindapaiste@gmail.com> commit a696539 Author: ziyuan-linn <zl4140@nyu.edu> Date: Mon Mar 4 21:56:22 2024 -0500 remove debug console log commit 06b3226 Author: ziyuan-linn <zl4140@nyu.edu> Date: Mon Mar 4 21:55:05 2024 -0500 swap checkEnum logic ordering commit 5548ba8 Merge: 1746bce bf7c1d9 Author: Ziyuan Lin <zl4140@nyu.edu> Date: Mon Mar 4 14:29:29 2024 -0500 run prettier formatter commit 1746bce Author: Ziyuan Lin <zl4140@nyu.edu> Date: Mon Mar 4 14:26:27 2024 -0500 change eol to lf commit 9d08c6d Author: Ziyuan Lin <zl4140@nyu.edu> Date: Mon Mar 4 14:25:08 2024 -0500 add gitattributes commit ad18e64 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 22:52:53 2024 -0500 use model name and options handling for imageClassifier commit 561c9cd Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 22:06:55 2024 -0500 fix handleModelName bug when no modelName is provided commit 6de9e0d Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 21:40:29 2024 -0500 run prettier formatter commit 6179a38 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 21:38:46 2024 -0500 Squashed commit of the following: commit 8a3fa07 Merge: a3083ee 5a0b8b8 Author: Daniel Shiffman <daniel.shiffman@gmail.com> Date: Wed Feb 28 13:43:09 2024 -0500 Merge pull request #65 from OrpheasK/image_cl add image classifier model commit 5a0b8b8 Author: OrpheasK <o.kofinakos@gmail.com> Date: Thu Feb 15 14:56:06 2024 -0500 resolve example change commit b2dbcd4 Author: OrpheasK <o.kofinakos@gmail.com> Date: Thu Feb 15 14:46:58 2024 -0500 resolve changes commit 03bea20 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Feb 15 14:09:18 2024 -0500 Update examples/ImageClassifier-video/index.html Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com> commit c081dbe Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Feb 15 14:09:09 2024 -0500 Update examples/ImageClassifier-video/index.html Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com> commit 3443d8f Author: OrpheasK <o.kofinakos@gmail.com> Date: Fri Jan 26 17:27:21 2024 -0500 Add model functionalities, update example commit 9aeb162 Author: OrpheasK <o.kofinakos@gmail.com> Date: Mon Jan 22 23:50:45 2024 -0500 Update files commit 8577fb2 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Wed Jan 17 20:33:36 2024 -0500 Update sketch.js commit 52abe8d Author: OrpheasK <o.kofinakos@gmail.com> Date: Wed Jan 17 20:26:03 2024 -0500 Add video example, remove helper model commit f7dbf56 Author: OrpheasK <o.kofinakos@gmail.com> Date: Tue Jan 9 09:27:46 2024 -0500 Add image classifier dependencies and examples, modify model commit b452cbc Merge: ac31473 5734120 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Mon Jan 8 07:55:28 2024 -0500 Merge branch 'ml5js:main' into image_cl commit ac31473 Merge: 3665c0f 72bd2a6 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Nov 30 22:26:58 2023 -0500 Merge branch 'ml5js:main' into image_cl commit 3665c0f Author: OrpheasK <o.kofinakos@gmail.com> Date: Sun Nov 12 13:42:32 2023 -0500 add image classifier commit f2d4760 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:44:37 2024 -0500 use options handling for faceMesh commit aa83564 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:27:47 2024 -0500 use model name handling for bodyPose commit 2a2cb5e Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:25:42 2024 -0500 update model name for bodySegmentation commit 53877ac Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:19:30 2024 -0500 use modelName and options handling for bodySegmentation commit e3fb3a7 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:18:45 2024 -0500 add modelName parameter handling commit 8fe7f92 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 12:39:21 2024 -0500 use options handling for bodyPose commit c136edb Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 12:37:15 2024 -0500 add multipleOf rule to number type commit b647260 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 12:30:11 2024 -0500 change handPose to camelCase commit 6fb7930 Merge: b2fac0b a3083ee Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 11:02:57 2024 -0500 Merge branch 'main' into Add-option-handling commit b2fac0b Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 20:22:53 2024 -0500 update documentation commit 25681f4 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 20:07:24 2024 -0500 add ignore rule commit 4342fd4 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 19:58:54 2024 -0500 add check for integer commit a1ef7e6 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 19:38:04 2024 -0500 update handpose maxHands max value commit 357417e Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 19:35:22 2024 -0500 update friendly errrors commit be239ec Author: ziyuan-linn <zl4140@nyu.edu> Date: Tue Jan 30 22:20:30 2024 -0500 add model name as an argument for friendly errors commit be2f63c Author: ziyuan-linn <zl4140@nyu.edu> Date: Tue Jan 30 22:05:53 2024 -0500 Simplify checkEnum commit 8c5fa45 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:47:14 2024 -0500 update documentation commit d605d83 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:14:30 2024 -0500 remove debug console log commit fa85218 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:11:44 2024 -0500 edit rules for handpose commit 79e0bd7 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:11:21 2024 -0500 refactor options handling functions commit a6f4d11 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 20:56:55 2024 -0500 add handling for object type commit c18f98e Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 20:25:47 2024 -0500 fix merge conflicts commit b12b7fd Merge: e5168db 9fb24fe Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 20:22:43 2024 -0500 Merge branch 'main' into Add-option-handling commit e5168db Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Jan 14 18:14:00 2024 -0500 add documentation on the usage of handleOptions commit 5f96fa5 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Jan 7 22:18:33 2024 -0500 edit handpose moldObject commit c9e6a7c Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Jan 7 22:13:45 2024 -0500 add function evaluation for moldObject values commit f3c40e3 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:46:02 2024 -0500 add handling for enum commit 2cd59a1 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:11:44 2024 -0500 add handling for strings commit 4494764 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:08:42 2024 -0500 Add handling for booleans commit 08bbb0b Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:06:32 2024 -0500 add handling for numbers commit 11bdbfc Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:05:40 2024 -0500 setup options handling in util
* set up all contributors * migrate contributor list from old repo * adjust all contributors setting * add instruction on using all-contributors * add custom community manager contribution type * add contributor acosmica * update documentation * add contributor VivianChenyc5519 * convert conflicting files to lf * add contributor ch3926 * add contributor ziyuan-linn * add contributor oziomarc * add contributor B2xx * Squashed commit of the following: commit 512d143 Merge: bf7c1d9 508743f Author: Daniel Shiffman <daniel.shiffman@gmail.com> Date: Wed Mar 6 17:53:25 2024 -0500 Merge pull request #71 from ml5js/Add-option-handling Add user options handling commit 508743f Author: ziyuan-linn <zl4140@nyu.edu> Date: Mon Mar 4 21:59:30 2024 -0500 update checkEnum jsdoc commit 78acbf5 Author: Ziyuan Lin <93690311+ziyuan-linn@users.noreply.github.com> Date: Mon Mar 4 21:57:38 2024 -0500 Update src/utils/handleOptions.js Co-authored-by: Linda Paiste <lindapaiste@gmail.com> commit a696539 Author: ziyuan-linn <zl4140@nyu.edu> Date: Mon Mar 4 21:56:22 2024 -0500 remove debug console log commit 06b3226 Author: ziyuan-linn <zl4140@nyu.edu> Date: Mon Mar 4 21:55:05 2024 -0500 swap checkEnum logic ordering commit 5548ba8 Merge: 1746bce bf7c1d9 Author: Ziyuan Lin <zl4140@nyu.edu> Date: Mon Mar 4 14:29:29 2024 -0500 run prettier formatter commit 1746bce Author: Ziyuan Lin <zl4140@nyu.edu> Date: Mon Mar 4 14:26:27 2024 -0500 change eol to lf commit 9d08c6d Author: Ziyuan Lin <zl4140@nyu.edu> Date: Mon Mar 4 14:25:08 2024 -0500 add gitattributes commit ad18e64 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 22:52:53 2024 -0500 use model name and options handling for imageClassifier commit 561c9cd Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 22:06:55 2024 -0500 fix handleModelName bug when no modelName is provided commit 6de9e0d Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 21:40:29 2024 -0500 run prettier formatter commit 6179a38 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Feb 28 21:38:46 2024 -0500 Squashed commit of the following: commit 8a3fa07 Merge: a3083ee 5a0b8b8 Author: Daniel Shiffman <daniel.shiffman@gmail.com> Date: Wed Feb 28 13:43:09 2024 -0500 Merge pull request #65 from OrpheasK/image_cl add image classifier model commit 5a0b8b8 Author: OrpheasK <o.kofinakos@gmail.com> Date: Thu Feb 15 14:56:06 2024 -0500 resolve example change commit b2dbcd4 Author: OrpheasK <o.kofinakos@gmail.com> Date: Thu Feb 15 14:46:58 2024 -0500 resolve changes commit 03bea20 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Feb 15 14:09:18 2024 -0500 Update examples/ImageClassifier-video/index.html Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com> commit c081dbe Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Feb 15 14:09:09 2024 -0500 Update examples/ImageClassifier-video/index.html Co-authored-by: Daniel Shiffman <daniel.shiffman@gmail.com> commit 3443d8f Author: OrpheasK <o.kofinakos@gmail.com> Date: Fri Jan 26 17:27:21 2024 -0500 Add model functionalities, update example commit 9aeb162 Author: OrpheasK <o.kofinakos@gmail.com> Date: Mon Jan 22 23:50:45 2024 -0500 Update files commit 8577fb2 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Wed Jan 17 20:33:36 2024 -0500 Update sketch.js commit 52abe8d Author: OrpheasK <o.kofinakos@gmail.com> Date: Wed Jan 17 20:26:03 2024 -0500 Add video example, remove helper model commit f7dbf56 Author: OrpheasK <o.kofinakos@gmail.com> Date: Tue Jan 9 09:27:46 2024 -0500 Add image classifier dependencies and examples, modify model commit b452cbc Merge: ac31473 5734120 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Mon Jan 8 07:55:28 2024 -0500 Merge branch 'ml5js:main' into image_cl commit ac31473 Merge: 3665c0f 72bd2a6 Author: OrpheasK <45125993+OrpheasK@users.noreply.github.com> Date: Thu Nov 30 22:26:58 2023 -0500 Merge branch 'ml5js:main' into image_cl commit 3665c0f Author: OrpheasK <o.kofinakos@gmail.com> Date: Sun Nov 12 13:42:32 2023 -0500 add image classifier commit f2d4760 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:44:37 2024 -0500 use options handling for faceMesh commit aa83564 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:27:47 2024 -0500 use model name handling for bodyPose commit 2a2cb5e Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:25:42 2024 -0500 update model name for bodySegmentation commit 53877ac Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:19:30 2024 -0500 use modelName and options handling for bodySegmentation commit e3fb3a7 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 14:18:45 2024 -0500 add modelName parameter handling commit 8fe7f92 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 12:39:21 2024 -0500 use options handling for bodyPose commit c136edb Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 12:37:15 2024 -0500 add multipleOf rule to number type commit b647260 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 12:30:11 2024 -0500 change handPose to camelCase commit 6fb7930 Merge: b2fac0b a3083ee Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Feb 24 11:02:57 2024 -0500 Merge branch 'main' into Add-option-handling commit b2fac0b Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 20:22:53 2024 -0500 update documentation commit 25681f4 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 20:07:24 2024 -0500 add ignore rule commit 4342fd4 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 19:58:54 2024 -0500 add check for integer commit a1ef7e6 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 19:38:04 2024 -0500 update handpose maxHands max value commit 357417e Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Feb 4 19:35:22 2024 -0500 update friendly errrors commit be239ec Author: ziyuan-linn <zl4140@nyu.edu> Date: Tue Jan 30 22:20:30 2024 -0500 add model name as an argument for friendly errors commit be2f63c Author: ziyuan-linn <zl4140@nyu.edu> Date: Tue Jan 30 22:05:53 2024 -0500 Simplify checkEnum commit 8c5fa45 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:47:14 2024 -0500 update documentation commit d605d83 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:14:30 2024 -0500 remove debug console log commit fa85218 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:11:44 2024 -0500 edit rules for handpose commit 79e0bd7 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 22:11:21 2024 -0500 refactor options handling functions commit a6f4d11 Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 20:56:55 2024 -0500 add handling for object type commit c18f98e Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 20:25:47 2024 -0500 fix merge conflicts commit b12b7fd Merge: e5168db 9fb24fe Author: ziyuan-linn <zl4140@nyu.edu> Date: Wed Jan 24 20:22:43 2024 -0500 Merge branch 'main' into Add-option-handling commit e5168db Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Jan 14 18:14:00 2024 -0500 add documentation on the usage of handleOptions commit 5f96fa5 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Jan 7 22:18:33 2024 -0500 edit handpose moldObject commit c9e6a7c Author: ziyuan-linn <zl4140@nyu.edu> Date: Sun Jan 7 22:13:45 2024 -0500 add function evaluation for moldObject values commit f3c40e3 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:46:02 2024 -0500 add handling for enum commit 2cd59a1 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:11:44 2024 -0500 add handling for strings commit 4494764 Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:08:42 2024 -0500 Add handling for booleans commit 08bbb0b Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:06:32 2024 -0500 add handling for numbers commit 11bdbfc Author: ziyuan-linn <zl4140@nyu.edu> Date: Sat Jan 6 22:05:40 2024 -0500 setup options handling in util
Bringing in the ImageClassifier model, this branch picks up from where @gohai made the necessary changes regarding input normalization. This version alters the way video classification is used, introducing classifyStart() for a similar approach to image input, instead of passing video input as an argument to the constructor. Many thanks to @ziyuan-linn for filling me in on alterations that had taken place while migrating to the next gen version of the library.