-
Notifications
You must be signed in to change notification settings - Fork 903
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
redid the YOLO object detection algorithm #176
Conversation
Isn't this supposed to be
Isn't this supposed to be |
p5 images and video are not supported anymore? |
@mw108 thank you , i guess i missed those mistakes :) concerning p5 images & video i am not really sure how to handle them , anyone is welcome to join in and help me with a pr |
here's a working example(image) |
@TheHidden1 Thanks for the quick fixes. :) I fiddled around a bit with p5 and it turned out that supporting p5 images and webcam is actually pretty easy. For images, you need to pass And for webcam, you need to pass |
Thanks @TheHidden1 and @mw108! this is great work! |
Thanks for the hard work @TheHidden1! There are issue with the tests. Let's fix them and move to get this merge! |
For integration with p5 receiving the bounding box as |
const yolo = new ml5.yolo('v2') and also this: const options = {
version: '3'
// other options
}
const yolo = new ml5.yolo(options) |
Aligning with our API though we would wrap in a function (avoiding const yolo = ml5.YOLO('v2') |
ups! yes, missed that! |
src/YOLO/index_test.js
Outdated
@@ -25,14 +25,15 @@ describe('YOLO', () => { | |||
|
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.
The test error is:
TypeError: Cannot read property 'filterBoxesThreshold' of undefined
can you try defining the variable here first. Like this: https://github.com/ml5js/ml5-library/blob/master/src/ImageClassifier/index_test.js#L20
Hello @TheHidden1 I've tried to run your re-implementation and I get the following error at the If I run the YOLO detection on a simple example as it is currently implemented in ml5.js v0.1.3, then this is what I see: Let us know if you're interested to explore this further. Many thanks! |
i will check it out right away |
it seems to be working for me (i think you missed ( i am not sure about the firefox error though) |
Thanks for jumping back into this @TheHidden1! 🎉🎉🎉 @joeyklee happy to look at this together sometime this week if that would be helpful, perhaps merging pull requests could be a good activity for our Friday sessions! 🌈 |
@TheHidden1 - Thanks so much for the updates! @shiffman and I will have a look this week and let you know if/when we merge! Many thanks! |
added support for yolo v3 models & made some changed to the post proccessing alogorithm now wen can chang the model input size on the fly
@shiffman @joeyklee i cleaned up some stuff and added support for yolo v3 models :
// this an example for the tiny yolov2 model
let config = {
version: 'v2', /* 'v2' || 'v3' */
/*
128 || 144 || 224 || 256 || 320 || 416 (or any multiple of 32 rly)
we can change this on the fly now wohoo!
*/
modelSize: 416 ,
URL: '',
/* inference parameters */
IOUThreshold: 0.5,
classProbThreshold: 0.4,
/* this mask defines witch anchors go to witch layer
eg : for tiny yolo v3 : ( hast 2 output layers at different scales )
masks: [ [3, 4, 5], [0, 1, 2] ],
anchors: [[10, 14], [23, 27], [37, 58], [81, 82], [135, 169], [344, 319] ],
*/
masks: [ [0, 1, 2, 3, 4] ],
anchors: [ [0.57273, 0.677385], [1.87446, 2.06253], [3.33843, 5.47434], [7.88282, 3.52778], [9.77052, 9.16828]],
/* class names array */
classes: CLASS_NAMES_COCO,
}
* Intel® HD Graphics 630** NVIDIA GeForce GTX 1050 Tihere is an updated demo where you can try out all of this stuff : https://codepen.io/hiddentn/full/gqrBeO note : there is a big time difference when using |
Hi @TheHidden1 Wow! This is wild. I didn't manage to have a deep look at your contributions yet, but I hope to do some checks with @shiffman soon. I just wanted to check in to let you know it's still very much on our minds! Thanks! |
Hi @TheHidden1 - apologies for the radio silence. @yining1023 and I had a deeper look into your code and we have the feeling that your current proposal diverges a bit too far from the current API structure. We recognize that we don't have good (or any?) documentation yet about the API conventions for ml5.js but that is high on our list. We would like to propose the following:
Thanks again for all your work on this! cc/ @shiffman |
i'll try & do my best |
i added a small demo ml5js/ml5-examples#107 |
you know what, let me start this again. this has become too messy |
redid the YOLO object detection algorithm
more simple & understandable
no more memory leaks
performance boost (i think )
a normal usage example should look like this
here's a working example(image)
https://codepen.io/hiddentn/pen/NBjPKRanother one with a video element
https://codepen.io/hiddentn/pen/jpmbRy