Dlib: How to use landmark detector with JS in browser ?

Created on 30 May 2017  路  5Comments  路  Source: davisking/dlib

Thanks for this awesome work, I am developing an AR application which runs in browser, my app core functionality is to track and detect landmarks point in real time via web cam. I tried your python binding at back-end and HTML,JS at front-end by connecting them via web-sockets but could not get good results. Its very slow because I am first streaming live via webcam using getUserMedia Api and then send frames to back-end for analyzing images.
I just want to know how can I use dlib seamlessly with web browsers, Is there any DLIB-JS binding out there, I researched a lot but could not find.

inactive

Most helpful comment

You can compile your C++ that includes dlib with emscripten. You will need to write bindings to getUserMedia in C though, so that the generated js can be "linked properly".

You can call C from js and js from C. The how is documented in emscripten's website.

Sending frames through websockets is not fast. You should look into creating a WebRTC "server" that your page would talk to. You can also look into other streaming means like FreeSWITCH.

Let us know what you come up with :)

All 5 comments

Thanks, glad you like it :)

Not that I know of. As far as I know you can't call C++ code from javascript, excluding some tooling that compiles C++ code directly to javascript like asm.js, which is maybe what you are asking about. I haven't heard of anyone doing that with dlib though.

You can compile your C++ that includes dlib with emscripten. You will need to write bindings to getUserMedia in C though, so that the generated js can be "linked properly".

You can call C from js and js from C. The how is documented in emscripten's website.

Sending frames through websockets is not fast. You should look into creating a WebRTC "server" that your page would talk to. You can also look into other streaming means like FreeSWITCH.

Let us know what you come up with :)

Have you tried running it with js using emscripten?

Warning: this issue has been inactive for 194 days and will be automatically closed on 2018-09-07 if there is no further activity.

If you are waiting for a response but haven't received one it's likely your question is somehow inappropriate. E.g. you didn't follow the issue submission instructions, or your question is easily answerable by reading the FAQ, dlib's documentation, or a Google search.

Notice: this issue has been closed because it has been inactive for 198 days. You may reopen this issue if it has been closed in error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kalravibhor picture kalravibhor  路  5Comments

lvella picture lvella  路  4Comments

unicorn7t picture unicorn7t  路  3Comments

maromcik picture maromcik  路  4Comments

jackweiwang picture jackweiwang  路  4Comments