Qt World Summit: Submit your Presentation

Use tensorflow lite with Qt

  • Environment :

    OS : Win10 64bits
    Qt: 5.12.3
    NDK: r18b
    JDK: jdk1.8.0_201

    I would like to use the tensorflow-lite with Qt5, but there are lots of issues when I try to import the java classes. But how could I download the tensorflow-lite-gpu, tensorflow-lite-cpu and tensorflow-lite-support?

    The android studio make this work with 3 lines in the build.gradle, I try to add the 3 lines into the build.gradle too.

    dependencies {
        // Build off of nightly TensorFlow Lite
        implementation 'org.tensorflow:tensorflow-lite:0.0.0-nightly'
        implementation 'org.tensorflow:tensorflow-lite-gpu:0.0.0-nightly'
        implementation 'org.tensorflow:tensorflow-lite-support:0.0.0-nightly'    

    Error messages

    At pastebin

    I can build this example by android studio without any issues, how could I use the java api of tensorflow with Qt?

  • Found the solutions, put them at StackOverflow.

    It would be ideal if we could use the c++ api rather than java, hope one day we could have a c++ library which could perform inference task of deep learning models efficiently on major platforms of desktop, mobiles and other embedded devices (opencv works well for desktops and other embedded devices, bad at mobile)

  • Hi,

    You can use the TensorFlow Lite c++ API with Qt/QML for Android and iOS devices, have a look at this tutorial. There are also other tutorials that apply to desktop and Raspberry Pi.


Log in to reply