Closed shiffman closed 5 years ago
Makes sense. The same can be applied for every future set of methods that can work with arrays, in that case making a util function that checks for all types of valid inputs would be useful.
Also, in line with https://github.com/ml5js/ml5-library/issues/245, it would be great to just pass the name of the body part
Closed in #256
I am looking at @yining1023's wonderful KNN Classifier examples from Machine Learning for the Web. It would be useful for the
KNNClassifier
'sclassify()
andaddExample()
methods to be able to accept a tensor or a plain array (and then internally make the tensor). This would allow the following:to turn into:
This is also relevant to recent discussions with @mayaman as there may be an easier way to get a flat array out of the the detected pose rather than having to dig into the object and use a higher order function like
map()
.It's also useful to note that with the MobileNet
FeatureExtractor
example + KNN theinfer()
function outputs a tensor which gets passed directly intoaddExample()
. I wonder if there might be a way of asking PoseNet for the tensor of results directly here for optimization purposes? This is lower priority, however, as the user is likely going to want to draw the results so needs access to the data anyway.