tfjs-yolo-tiny icon indicating copy to clipboard operation
tfjs-yolo-tiny copied to clipboard

How this can be integrate without browser?

Open himvish997 opened this issue 6 years ago • 6 comments

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?

himvish997 avatar Jun 18 '18 06:06 himvish997

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.

MikeShi42 avatar Jun 18 '18 17:06 MikeShi42

@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.

Nedomas avatar Aug 21 '18 09:08 Nedomas

@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.

MikeShi42 avatar Aug 21 '18 16:08 MikeShi42

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

Nedomas avatar Aug 21 '18 19:08 Nedomas

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

jonaslund avatar Nov 07 '18 21:11 jonaslund

@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?

MikeShi42 avatar Nov 08 '18 00:11 MikeShi42