Skip to content

Commit

Permalink
Renew to be a rust crate
Browse files Browse the repository at this point in the history
  • Loading branch information
boncheolgu committed Oct 24, 2018
1 parent 827ee4a commit f61aa7e
Show file tree
Hide file tree
Showing 41 changed files with 50 additions and 15,056 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
build

/target
**/*.rs.bk
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "external/tensorflow"]
path = external/tensorflow
url = https://github.com/tensorflow/tensorflow.git
22 changes: 13 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
cmake_minimum_required(VERSION 3.5)

project(tflite_interpreter CXX)
project(tflite CXX)

add_library(tflite_proxy INTERFACE)
target_include_directories(tflite_proxy INTERFACE include)
target_link_libraries(tflite_proxy INTERFACE ${CMAKE_SOURCE_DIR}/lib/libtensorflow-lite.a pthread dl)
set(TENSORFLOW_SRC_DIR "${CMAKE_SOURCE_DIR}/external/tensorflow")

add_executable(minimal examples/minimal/minimal.cc)
target_link_libraries(minimal PRIVATE tflite_proxy)
add_library(tflite INTERFACE)
target_include_directories(tflite INTERFACE ${TENSORFLOW_SRC_DIR})
target_link_libraries(tflite INTERFACE "${TENSORFLOW_SRC_DIR}/tensorflow/contrib/lite/tools/make/gen/linux_x86_64/lib/libtensorflow-lite.a" pthread dl)

add_executable(label_image examples/label_image/label_image.cc examples/label_image/bitmap_helpers.cc)
target_include_directories(label_image PRIVATE examples)
target_link_libraries(label_image PRIVATE tflite_proxy)
add_executable(minimal "${TENSORFLOW_SRC_DIR}/tensorflow/contrib/lite/examples/minimal/minimal.cc")
target_link_libraries(minimal PRIVATE tflite)

add_executable(label_image
"${TENSORFLOW_SRC_DIR}/tensorflow/contrib/lite/examples/label_image/label_image.cc"
"${TENSORFLOW_SRC_DIR}/tensorflow/contrib/lite/examples/label_image/bitmap_helpers.cc"
)
target_link_libraries(label_image PRIVATE tflite)
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "tflite-rs"
version = "0.1.0"
authors = ["Boncheol Gu <boncheol.gu@gmail.com>"]

[dependencies]
24 changes: 24 additions & 0 deletions build_x86_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -x
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

set -e

# SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# cd "$SCRIPT_DIR/../../../../.."

cd external/tensorflow
tensorflow/contrib/lite/tools/make/download_dependencies.sh
make -j 3 -f tensorflow/contrib/lite/tools/make/Makefile
121 changes: 0 additions & 121 deletions examples/label_image/bitmap_helpers.cc

This file was deleted.

42 changes: 0 additions & 42 deletions examples/label_image/bitmap_helpers.h

This file was deleted.

97 changes: 0 additions & 97 deletions examples/label_image/bitmap_helpers_impl.h

This file was deleted.

38 changes: 0 additions & 38 deletions examples/label_image/get_top_n.h

This file was deleted.

Loading

0 comments on commit f61aa7e

Please sign in to comment.