GithubHelp home page GithubHelp logo

valyouw / tflite-win-c Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 11.0 22.72 MB

Visual Studio C++ demo app for running ssd object detection and deeplab image segmentation on windows using TensorFlow Lite C api

License: MIT License

C++ 100.00%

tflite-win-c's Introduction

tflite-win-c

This is an ssd object detection and deeplab image segmentation demo project using TensorFlow Lite C API on windows with Visual Studio C++.

There's also a YouTube

Setup

OpenCV

The project make use of OpenCV:

  1. Download and extract opencv to some folder, e.g c:\tools\opencv
  2. Define global environment variable OPENCV_DIST pointing the opencv install dir. The project reference opencv build\include dir and build\x64\vc15\lib dirs as follow: $(OPENCV_DIST)\build\include and $(OPENCV_DIST)\build\x64\vc15\lib, so make sure OPENCV_DIST points to the right place.
  3. During runtime, the app will need to load opencv dll, make sure to have opencv build\x64\vc15\bin dir in the path.

tflite-dist

The project need TensorFlow Lite headers, C lib and C dll, either download them from here or build it yourself. Eventually there should be a "tflite-dist" as follow:

+- tflite-dist
+---+ include
+-------+ tenslorflow\lite\c (all c headers)
+---+ libs\windows_x86_64\tensorflowlite_c.dll.if.lib
+---+ libs\windows_x86_64\tensorflowlite_c.dll

The project refernce these files using a TFLITE_DIST environment variable:

  1. Define a global environment variable that points to your tflite-dist folder.
  2. Make sure to select the "Release/x64" build configuration
  3. During runtime, the app will need to load tensorflowlite_c.dll, make sure to have tflite-dist\libs\windows_x86_64 dir in the path.

License

MIT

tflite-win-c's People

Contributors

valyouw avatar

Stargazers

XYC avatar Oh HyeonSeok avatar Sinden avatar leooo avatar DaikinChester avatar  avatar  avatar  avatar DS.Xu avatar Justin avatar zhuoy avatar  avatar Zac Walker avatar  avatar Junzhe Huang avatar  avatar  avatar  avatar  avatar erica92 avatar  avatar  avatar 王宇驰 avatar Taeyup Song avatar Lyang avatar  avatar  avatar Muti Ur Rehman avatar  avatar Rémi Ratajczak avatar JYOTHIR ROSE K J avatar  avatar Constantin Shafranski avatar  avatar ASHUI avatar duynn avatar

Watchers

James Cloos avatar  avatar  avatar

tflite-win-c's Issues

Using models other than the ones provided gives errors

Hi,
I would like to know the following things:
can you mention the training methodology for all the models that you have provided in this repo(object detection, segmentation and style transfer). Or if these are pretrained models, can you give me the link to the documentation that mentions their training methodology

The models that i have trained are not working with the code provided. Hence would like to know the training strategy so that i can train the models on my own dataset.

Thanks

Usage of C library in windows : tensorflow C api [cpu only]

I am coming from your youtube video, but for tensorflow API, not tensorflow lite, Here is my question:

I want to use this C library from here on windows globally. I intend to run the hello_tf.c example natively on windows with the global install (like how #include <stdio.h> -> #include <tensorflow/c/c_api.h> is available. Is this possible?)
I've looked at StackOverflow multiple times and was not able to figure it out. I was getting this error:

$> gcc hello_tf.c -ltensorflow -o hello_tf     
hello_tf.c: In function 'main':
hello_tf.c:7:60: warning: implicit declaration of function 'TF_Version' [-Wimplicit-function-declaration]
    7 |     printf("Hello from TensorFlow C library version %s\n", TF_Version());
      |                                                            ^~~~~~~~~~
c:/mingw/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ltensorflow
collect2.exe: error: ld returned 1 exit status

I know this is a trivial error, but I cannot figure out how to proceed from here. Below is the source code:

// hello_tf.c
#include <stdio.h>
#include <tensorflow/c/c_api.h>

int main() {
  printf("Hello from TensorFlow C library version %s\n", TF_Version());
  return 0;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.