ModelDepot / tfjs-yolo-tiny

In-Browser Object Detection using Tiny YOLO on Tensorflow.js
https://modeldepot.io/mikeshi/tiny-yolo-in-javascript
MIT License
530 stars 92 forks source link

How this can be integrate without browser? #14

Open himvish997 opened 6 years ago

himvish997 commented 6 years ago

I am working on the project where we can not use the browser, Is this can be integrated without the help of the browser? If Yes then how?

MikeShi42 commented 6 years ago

Hi! You can check out tfjs-node to use tfjs packages in Node. Otherwise you can check out models that can run on Python DL frameworks on ModelDepot.

Nedomas commented 6 years ago

@himvish997 did not have the time to push this back upstream to the main repo, but I have it working on node here: https://github.com/Nedomas/tfjs-yolo-tiny

If you find this helpful, feel free to create a PR to ModelDepot/tfjs-yolo-tiny with these changes.

MikeShi42 commented 6 years ago

@Nedomas awesome! It'd probably take a bit of work to merge the two things so that this package can support both node and browser. tbh never made a package before that can switch across both runtimes, would have to figure out how to reconcile the two.

Nedomas commented 6 years ago

Probably not much work. It's just that you'd additionally need to compile a Node.js-compatable bundle (whereas I just changed some parts in the code manually).

Also - browser key on package.json might help to have two env's when requiring it. https://docs.npmjs.com/files/package.json#browser

jonaslund commented 6 years ago

Would be great with some more info @Nedomas as to how you got it running server-side. Running into all sorts of different issues, the first one being

let [boxes, scores, classes] = await yolo_filter_boxes(
                                 ^^^^^
SyntaxError: await is only valid in async function
MikeShi42 commented 6 years ago

@jonaslund I believe you can check out his fork available here: https://github.com/Nedomas/tfjs-yolo-tiny

I would love to see a PR to this repo adding node support. I decided to hold off on that due to time constraints + tfjs node is supposedly very experimental?