项目作者: IvanSafonov

项目描述 :
Qt TensorFlow Lite example
高级语言: C++
项目地址: git://github.com/IvanSafonov/qt-tf-lite-example.git
创建时间: 2021-01-04T13:54:26Z
项目社区:https://github.com/IvanSafonov/qt-tf-lite-example

开源协议:MIT License

下载


Qt TensorFlow Lite example

A simple example that shows how to use TensorFlow Lite with Qt. That’s a modified version of the label_image example.

Tested on Ubuntu 20.04.

How to build

  • Install Visual Studio Code with Remote Containers extension
  • Clone this project and open in Visual Studio Code
    1. git clone https://github.com/IvanSafonov/qt-tf-lite-example.git
    2. code ./qt-tf-lite-example
  • In the Command Palette find and click Remote-Containers: Reopen in Container
  • In the Command Palette find and click CMake: Build

Launch example

The result executable file can be found in the build subdirectory.

  1. vscode /workspaces/qt-tf-lite-example $ ./build/qt-tf-lite-example -h
  2. Usage: ./build/qt-tf-lite-example [options] images
  3. Qt TensorFlow Lite example
  4. Options:
  5. -h, --help Displays this help.
  6. -m, --model <model> TFLite model
  7. -l, --labels <labels> Model labels file
  8. Arguments:
  9. images Input images for classification
  1. vscode /workspaces/qt-tf-lite-example $ ./build/qt-tf-lite-example ./grace_hopper.jpg
  2. INFO: Initialized TensorFlow Lite runtime.
  3. "./grace_hopper.jpg"
  4. 0.784314 653 "military uniform"
  5. 0.105882 907 "Windsor tie"
  6. 0.0156863 458 "bow tie"
  7. 0.0117647 466 "bulletproof vest"