Skip to content
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

Convert to tensorflowjs #12

Open
dongngm opened this issue Oct 19, 2021 · 13 comments
Open

Convert to tensorflowjs #12

dongngm opened this issue Oct 19, 2021 · 13 comments

Comments

@dongngm
Copy link

dongngm commented Oct 19, 2021

Hi,
Thanks for your great work.

Could you please upload the saved model/keras model so that it could be converted to tensorflowjs model? I am working on a web application.

Thank you in advance.

@geonm
Copy link
Collaborator

geonm commented Oct 19, 2021

Hi.

Glad to hear that.

Do you want ckpt files?

@dongngm
Copy link
Author

dongngm commented Oct 19, 2021

Yes, it would be very helpful. Thanks a lot @geonm

@geonm
Copy link
Collaborator

geonm commented Oct 19, 2021

No problem. 😄

I will share ckpt files after checking the code ASAP.

@geonm
Copy link
Collaborator

geonm commented Oct 19, 2021

I added ckpt files. (For now, only M-LSD 512 large model is uploaded)

Please refer to https://github.com/navervision/mlsd/tree/master/ckpt_models/M-LSD_512_large

If you want to check the code that converts the ckpt files into a tflite model, please refer to https://github.com/navervision/mlsd#how-to-convert-ckpt-models-to-tflite-models

@dongngm
Copy link
Author

dongngm commented Oct 20, 2021

big thanks @geonm

@dongngm dongngm closed this as completed Oct 20, 2021
@dongngm dongngm reopened this Oct 20, 2021
@dongngm
Copy link
Author

dongngm commented Oct 20, 2021

sorry for bothering you again @geonm . I've tested the converted tensorflowjs model and it seems that the response time is not good enough for my real-time application. Could you please also upload the tiny with lower resolution model version? Thanks a lot.

@geonm
Copy link
Collaborator

geonm commented Oct 20, 2021

Of course, I can provide all ckpt files.

However, my computing server used in this project will not be available until next Monday (10/25/2021 KST) due to internal circumstances.

Is it urgent?

BTW, what was the FPS of your application with M-LSD 512 large?

With desktop CPU, M-LSD 512 large (ckpt file) was fast enough for me.

NOTE: In this repository, I coded easy-to-use demo using only tflite models.
Even it works on desktop CPU, it is slower than mobile devices.
Please refer to https://stackoverflow.com/questions/54093424/why-is-tensorflow-lite-slower-than-tensorflow-on-desktop

@dongngm
Copy link
Author

dongngm commented Oct 20, 2021

Next Monday is fine. Thank you @geonm
I am having like 700ms for a single image prediction with tensorflow js on my desktop (quite not comparable to what you've got with tflite models, don't know tensorflow js could be that slower). Maybe trying smaller model, lower resolution may help

@dongngm
Copy link
Author

dongngm commented Oct 26, 2021

hi, any update on this @geonm?

@geonm
Copy link
Collaborator

geonm commented Oct 26, 2021

I got the machine and now I'm testing.

@geonm
Copy link
Collaborator

geonm commented Oct 26, 2021

I added all ckpt files.

M-LSD 512 large, M-LSD 320 large
M-LSD 512 tiny, M-LSD 320 tiny

Please refer to https://github.com/navervision/mlsd/tree/master/ckpt_models

If you want to check the code that converts the ckpt files into a tflite model, please refer to https://github.com/navervision/mlsd#how-to-convert-ckpt-models-to-tflite-models

@dongngm Could you make your tensorflow JS codes public?

It will be very helpful to anyone new to tensorflow JS with M-LSD.

@dongngm
Copy link
Author

dongngm commented Oct 27, 2021

thanks @geonm
After testing is ok I will make PR for tensorfow JS code

@randhirjhadw
Copy link

Hello @dongngm

I am trying to convert the model to tenserflowjs but it's not working
Can you help to convert the ckpt model to tenserflowjs?

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants