├── .gitattributes ├── .gitignore ├── .vscode └── settings.json ├── LICENSE ├── README.md └── tensorflow └── tensorflow └── lite └── tools └── make ├── Makefile ├── Makefile.1.10.0 ├── Makefile.1.14.0 ├── build_rpi_armv6_label_image.sh ├── build_rpi_armv6_lib.sh ├── gen └── rpi_armv6 │ └── bin │ ├── detect.tflite │ ├── grace_hopper.bmp │ ├── labels.txt │ └── mobilenet_quant_v1_224.tflite └── target └── rpi_makefile.inc /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | native_build.txt 2 | .vscode 3 | *.code-workspace 4 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cmake.configureOnOpen": false 3 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 cloudwise 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ### TensorFlow Lite : native compilation on Raspberry Pi Zero W 4 | 5 | An addendum to the native compile section of https://www.tensorflow.org/lite/guide/build_rpi for building Tensorflow Lite 1.14.0 on a Raspberry Pi Zero W arm6 target. 6 | 7 | Clone this repo and move the files to the relevant paths on the Raspiberry Pi Zero as shown below with the `scp` commands 8 | 9 | ```sh 10 | # From https://www.tensorflow.org/lite/guide/build_rpi > "Compile natively on Raspberry Pi" section... 11 | (rpi) $ sudo apt-get install build-essential 12 | 13 | # Clone the repo onto the Pi Zero 14 | (rpi) $ cd ~ 15 | (rpi) $ git clone https://github.com/tensorflow/tensorflow.git 16 | (rpi) $ git checkout v1.14.0 17 | (rpi) $ cd ./tensorflow 18 | or download it directly from https://github.com/tensorflow/tensorflow/releases/tag/v1.14.0 19 | 20 | # Install the dependencies 21 | (rpi) $ ./tensorflow/lite/tools/make/download_dependencies.sh 22 | 23 | # FTP/scp the arm6 build script to /home/pi/tensorflow/tensorflow/lite/tools/make 24 | (host)$ scp /build_rpi_armv6_lib.sh pi@[pi's ip]:/tensorflow/tensorflow/lite/tools/make 25 | 26 | # FTP/scp the updated Makefile that builds the label_image example as well 27 | (rpi) $ cd /tensorflow/tensorflow/lite/tools/make 28 | (rpi) $ mv Makefile Makefile.orig 29 | (host)$ scp /Makefile pi@[pi's ip]:/tensorflow/tensorflow/lite/tools/make 30 | (rpi) $ cd /tensorflow/tensorflow/lite/tools/make/target 31 | (rpi) $ mv rpi_makefile.inc rpi_makefile.inc.orig 32 | (host)$ scp /rpi_makefile.inc pi@[pi's ip]:/tensorflow/tensorflow/lite/tools/make/target 33 | 34 | # FTP/scp the updated that builds the label_image example as well 35 | (host)$ scp /Makefile pi@[pi's ip]:/tensorflow/tensorflow/lite/tools/make 36 | # Increase the RPi swap size otherwise 'make' will fail 37 | (rpi) $ sudo nano /etc/dphys-swapfile 38 | ...CONF_SWAPSIZE=100 --> CONF_SWAPSIZE=2048 39 | 40 | (rpi) $ sudo /etc/init.d/dphys-swapfile stop 41 | (rpi) $ sudo /etc/init.d/dphys-swapfile start 42 | 43 | # Build...allow ~6 hours on a RPi Zero W...often needing restarts! 44 | (rpi) $ cd /home/pi/tensorflow 45 | (rpi) $ ./tensorflow/lite/tools/make/build_rpi_armv6_lib.sh 46 | 47 | # Change the swap size back to the default setting 48 | (rpi) $ sudo nano /etc/dphys-swapfile 49 | ...CONF_SWAPSIZE=2048 --> CONF_SWAPSIZE=100 50 | 51 | (rpi) $ sudo /etc/init.d/dphys-swapfile stop 52 | (rpi) $ sudo /etc/init.d/dphys-swapfile start 53 | ``` 54 | 55 | The output from the above should be error-free and result in `minimal`, `benchmark` and `label_image` executables placed in `../tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin` ...plus `libtensorflow-lite.a` and ` benchmark-lib.a` placed in `../tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/lib` 56 | 57 | Test the build using a `.tflite` model (see https://www.tensorflow.org/lite/models/object_detection/overview) by running `./minimal .tflite` 58 | 59 | This should generate a summary of the model architecture on stdout. If this isn't the case, check the build output for errors. 60 | 61 | Assuming `./minimal` produces the expected output, run the `label_image` example as below... 62 | 63 | ```sh 64 | # Copy required files for the label_image example to the Rasperry Pi Zero 65 | (host)$ scp /labels.txt pi@:/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin 66 | (host)$ scp /mobilenet_quant_v1_224.tflite pi@:/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin 67 | (host)$ scp /grace_hopper.bmp pi@:/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin 68 | 69 | # if you need to (re)build the label_image example... 70 | (rpi) $ ./tensorflow/lite/tools/make/build_rpi_armv6_label_image.sh 71 | 72 | # Run the example : defaults to the image, tflite model and labels files downloaded above 73 | (rpi) $ ./label_image 74 | ``` 75 | 76 | This will run the Mobilenet-based object classifier on the image of Grace Hopper and return the top 5 list of detected objects with a confidence value plus the overall inference time. 77 | Use `./label_image --help` to see the command line options. 78 | 79 | Happy TensorFlow-Lite-development-on-arm6-devices! 80 | -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/Makefile: -------------------------------------------------------------------------------- 1 | # Make uses /bin/sh by default, which is incompatible with the bashisms seen 2 | # below. 3 | SHELL := /bin/bash 4 | 5 | # Find where we're running from, so we can store generated files here. 6 | ifeq ($(origin MAKEFILE_DIR), undefined) 7 | MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 8 | endif 9 | 10 | # Try to figure out the host system 11 | HOST_OS := 12 | ifeq ($(OS),Windows_NT) 13 | HOST_OS = windows 14 | else 15 | UNAME_S := $(shell uname -s) 16 | ifeq ($(UNAME_S),Linux) 17 | HOST_OS := linux 18 | endif 19 | ifeq ($(UNAME_S),Darwin) 20 | HOST_OS := osx 21 | endif 22 | endif 23 | 24 | HOST_ARCH := $(shell if uname -m | grep -q i[345678]86; then echo x86_32; else uname -m; fi) 25 | 26 | # Override these on the make command line to target a specific architecture. For example: 27 | # make -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv7l 28 | TARGET := $(HOST_OS) 29 | TARGET_ARCH := $(HOST_ARCH) 30 | 31 | INCLUDES := \ 32 | -I. \ 33 | -I$(MAKEFILE_DIR)/../../../../../ \ 34 | -I$(MAKEFILE_DIR)/../../../../../../ \ 35 | -I$(MAKEFILE_DIR)/downloads/ \ 36 | -I$(MAKEFILE_DIR)/downloads/eigen \ 37 | -I$(MAKEFILE_DIR)/downloads/absl \ 38 | -I$(MAKEFILE_DIR)/downloads/gemmlowp \ 39 | -I$(MAKEFILE_DIR)/downloads/neon_2_sse \ 40 | -I$(MAKEFILE_DIR)/downloads/farmhash/src \ 41 | -I$(MAKEFILE_DIR)/downloads/flatbuffers/include \ 42 | -I$(OBJDIR) 43 | # This is at the end so any globally-installed frameworks like protobuf don't 44 | # override local versions in the source tree. 45 | INCLUDES += -I/usr/local/include 46 | 47 | # These are the default libraries needed, but they can be added to or 48 | # overridden by the platform-specific settings in target makefiles. 49 | LIBS := \ 50 | -lstdc++ \ 51 | -latomic \ 52 | -lpthread \ 53 | -lm \ 54 | -lz 55 | 56 | # There are no rules for compiling objects for the host system (since we don't 57 | # generate things like the protobuf compiler that require that), so all of 58 | # these settings are for the target compiler. 59 | CXXFLAGS := -O3 -DNDEBUG -fPIC 60 | CXXFLAGS += $(EXTRA_CXXFLAGS) 61 | CFLAGS := ${CXXFLAGS} 62 | CXXFLAGS += --std=c++11 63 | LDOPTS := -L/usr/local/lib 64 | ARFLAGS := -r 65 | TARGET_TOOLCHAIN_PREFIX := 66 | CC_PREFIX := 67 | 68 | ifeq ($(HOST_OS),windows) 69 | CXXFLAGS += -fext-numeric-literals -D__LITTLE_ENDIAN__ 70 | endif 71 | 72 | # This library is the main target for this makefile. It will contain a minimal 73 | # runtime that can be linked in to other programs. 74 | LIB_NAME := libtensorflow-lite.a 75 | 76 | # Benchmark static library and binary 77 | BENCHMARK_LIB_NAME := benchmark-lib.a 78 | BENCHMARK_BINARY_NAME := benchmark_model 79 | 80 | # A small example program that shows how to link against the library. 81 | MINIMAL_SRCS := \ 82 | tensorflow/lite/examples/minimal/minimal.cc 83 | 84 | # An example program that shows how to run a tflite graph with the library. 85 | LABEL_IMAGE_SRCS := \ 86 | tensorflow/lite/examples/label_image/label_image.cc \ 87 | tensorflow/lite/examples/label_image/bitmap_helpers.cc \ 88 | tensorflow/lite/tools/evaluation/utils.cc 89 | 90 | # What sources we want to compile, must be kept in sync with the main Bazel 91 | # build files. 92 | 93 | PROFILER_SRCS := \ 94 | tensorflow/lite/profiling/time.cc 95 | PROFILE_SUMMARIZER_SRCS := \ 96 | tensorflow/lite/profiling/profile_summarizer.cc \ 97 | tensorflow/core/util/stats_calculator.cc 98 | 99 | CMD_LINE_TOOLS_SRCS := \ 100 | tensorflow/lite/tools/command_line_flags.cc 101 | 102 | CORE_CC_ALL_SRCS := \ 103 | $(wildcard tensorflow/lite/*.cc) \ 104 | $(wildcard tensorflow/lite/*.c) \ 105 | $(wildcard tensorflow/lite/c/*.c) \ 106 | $(wildcard tensorflow/lite/core/*.cc) \ 107 | $(wildcard tensorflow/lite/core/api/*.cc) \ 108 | $(wildcard tensorflow/lite/experimental/resource_variable/*.cc) \ 109 | tensorflow/lite/experimental/ruy/allocator.cc \ 110 | tensorflow/lite/experimental/ruy/block_map.cc \ 111 | tensorflow/lite/experimental/ruy/blocking_counter.cc \ 112 | tensorflow/lite/experimental/ruy/context.cc \ 113 | tensorflow/lite/experimental/ruy/kernel.cc \ 114 | tensorflow/lite/experimental/ruy/pack.cc \ 115 | tensorflow/lite/experimental/ruy/pmu.cc \ 116 | tensorflow/lite/experimental/ruy/thread_pool.cc \ 117 | tensorflow/lite/experimental/ruy/trace.cc \ 118 | tensorflow/lite/experimental/ruy/trmul.cc \ 119 | tensorflow/lite/experimental/ruy/tune.cc 120 | 121 | ifneq ($(BUILD_TYPE),micro) 122 | CORE_CC_ALL_SRCS += \ 123 | $(wildcard tensorflow/lite/kernels/*.cc) \ 124 | $(wildcard tensorflow/lite/kernels/internal/*.cc) \ 125 | $(wildcard tensorflow/lite/kernels/internal/optimized/*.cc) \ 126 | $(wildcard tensorflow/lite/kernels/internal/reference/*.cc) \ 127 | $(PROFILER_SRCS) \ 128 | tensorflow/lite/tools/make/downloads/farmhash/src/farmhash.cc \ 129 | tensorflow/lite/tools/make/downloads/fft2d/fftsg.c \ 130 | tensorflow/lite/tools/make/downloads/flatbuffers/src/util.cpp 131 | CORE_CC_ALL_SRCS += \ 132 | $(shell find tensorflow/lite/tools/make/downloads/absl/absl/ \ 133 | -type f -name \*.cc | grep -v test | grep -v benchmark | grep -v synchronization) 134 | endif 135 | # Remove any duplicates. 136 | CORE_CC_ALL_SRCS := $(sort $(CORE_CC_ALL_SRCS)) 137 | CORE_CC_EXCLUDE_SRCS := \ 138 | $(wildcard tensorflow/lite/*test.cc) \ 139 | $(wildcard tensorflow/lite/*/*test.cc) \ 140 | $(wildcard tensorflow/lite/*/*/*test.cc) \ 141 | $(wildcard tensorflow/lite/*/*/*/*test.cc) \ 142 | $(wildcard tensorflow/lite/kernels/*test_main.cc) \ 143 | $(wildcard tensorflow/lite/kernels/*test_util*.cc) \ 144 | $(MINIMAL_SRCS) \ 145 | $(LABEL_IMAGE_SRCS) 146 | 147 | BUILD_WITH_MMAP ?= true 148 | ifeq ($(BUILD_TYPE),micro) 149 | BUILD_WITH_MMAP=false 150 | endif 151 | ifeq ($(BUILD_TYPE),windows) 152 | BUILD_WITH_MMAP=false 153 | endif 154 | ifeq ($(BUILD_WITH_MMAP),true) 155 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/mmap_allocation.cc 156 | else 157 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/mmap_allocation_disabled.cc 158 | endif 159 | 160 | BUILD_WITH_NNAPI ?= true 161 | ifeq ($(BUILD_TYPE),micro) 162 | BUILD_WITH_NNAPI=false 163 | endif 164 | ifeq ($(TARGET),windows) 165 | BUILD_WITH_NNAPI=false 166 | endif 167 | ifeq ($(TARGET),ios) 168 | BUILD_WITH_NNAPI=false 169 | endif 170 | ifeq ($(TARGET),rpi) 171 | BUILD_WITH_NNAPI=false 172 | endif 173 | ifeq ($(TARGET),generic-aarch64) 174 | BUILD_WITH_NNAPI=false 175 | endif 176 | ifeq ($(BUILD_WITH_NNAPI),true) 177 | CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/nnapi_delegate.cc 178 | CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/quant_lstm_sup.cc 179 | CORE_CC_ALL_SRCS += tensorflow/lite/nnapi/nnapi_implementation.cc 180 | LIBS += -lrt 181 | else 182 | CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/nnapi_delegate_disabled.cc 183 | CORE_CC_ALL_SRCS += tensorflow/lite/nnapi/nnapi_implementation_disabled.cc 184 | endif 185 | 186 | ifeq ($(TARGET),ios) 187 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_android.cc 188 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_default.cc 189 | else 190 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_android.cc 191 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_ios.cc 192 | endif 193 | 194 | 195 | # Filter out all the excluded files. 196 | TF_LITE_CC_SRCS := $(filter-out $(CORE_CC_EXCLUDE_SRCS), $(CORE_CC_ALL_SRCS)) 197 | 198 | # Benchmark sources 199 | BENCHMARK_SRCS_DIR := tensorflow/lite/tools/benchmark 200 | EVALUATION_UTILS_SRCS := \ 201 | tensorflow/lite/tools/evaluation/utils.cc 202 | BENCHMARK_ALL_SRCS := $(TF_LITE_CC_SRCS) \ 203 | $(wildcard $(BENCHMARK_SRCS_DIR)/*.cc) \ 204 | $(PROFILE_SUMMARIZER_SRCS) \ 205 | $(CMD_LINE_TOOLS_SRCS) \ 206 | $(EVALUATION_UTILS_SRCS) 207 | 208 | BENCHMARK_SRCS := $(filter-out \ 209 | $(wildcard $(BENCHMARK_SRCS_DIR)/*_test.cc) \ 210 | $(BENCHMARK_SRCS_DIR)/benchmark_plus_flex_main.cc, \ 211 | $(BENCHMARK_ALL_SRCS)) 212 | 213 | # These target-specific makefiles should modify or replace options like 214 | # CXXFLAGS or LIBS to work for a specific targetted architecture. All logic 215 | # based on platforms or architectures should happen within these files, to 216 | # keep this main makefile focused on the sources and dependencies. 217 | include $(wildcard $(MAKEFILE_DIR)/targets/*_makefile.inc) 218 | 219 | ALL_SRCS := \ 220 | $(MINIMAL_SRCS) \ 221 | $(PROFILER_SRCS) \ 222 | $(PROFILER_SUMMARIZER_SRCS) \ 223 | $(TF_LITE_CC_SRCS) \ 224 | $(BENCHMARK_SRCS) \ 225 | $(CMD_LINE_TOOLS_SRCS) \ 226 | $(LABEL_IMAGE_SRCS) 227 | 228 | # Where compiled objects are stored. 229 | GENDIR := $(MAKEFILE_DIR)/gen/$(TARGET)_$(TARGET_ARCH)/ 230 | OBJDIR := $(GENDIR)obj/ 231 | BINDIR := $(GENDIR)bin/ 232 | LIBDIR := $(GENDIR)lib/ 233 | 234 | LIB_PATH := $(LIBDIR)$(LIB_NAME) 235 | BENCHMARK_LIB := $(LIBDIR)$(BENCHMARK_LIB_NAME) 236 | BENCHMARK_BINARY := $(BINDIR)$(BENCHMARK_BINARY_NAME) 237 | MINIMAL_BINARY := $(BINDIR)minimal 238 | LABEL_IMAGE_BINARY := $(BINDIR)label_image 239 | 240 | CXX := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}g++ 241 | CC := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}gcc 242 | AR := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}ar 243 | 244 | MINIMAL_OBJS := $(addprefix $(OBJDIR), \ 245 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(MINIMAL_SRCS)))) 246 | 247 | LIB_OBJS := $(addprefix $(OBJDIR), \ 248 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(TF_LITE_CC_SRCS))))) 249 | 250 | BENCHMARK_OBJS := $(addprefix $(OBJDIR), \ 251 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(BENCHMARK_SRCS))))) 252 | 253 | LABEL_IMAGE_OBJS := $(addprefix $(OBJDIR), \ 254 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(LABEL_IMAGE_SRCS)))) 255 | 256 | # For normal manually-created TensorFlow Lite C++ source files. 257 | $(OBJDIR)%.o: %.cc 258 | @mkdir -p $(dir $@) 259 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ 260 | # For normal manually-created TensorFlow Lite C source files. 261 | $(OBJDIR)%.o: %.c 262 | @mkdir -p $(dir $@) 263 | $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ 264 | $(OBJDIR)%.o: %.cpp 265 | @mkdir -p $(dir $@) 266 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ 267 | 268 | # The target that's compiled if there's no command-line arguments. 269 | all: $(LIB_PATH) $(MINIMAL_BINARY) $(BENCHMARK_BINARY) $(LABEL_IMAGE_BINARY) 270 | 271 | # The target that's compiled for micro-controllers 272 | micro: $(LIB_PATH) 273 | 274 | # Hack for generating schema file bypassing flatbuffer parsing 275 | tensorflow/lite/schema/schema_generated.h: 276 | @cp -u tensorflow/lite/schema/schema_generated.h.OPENSOURCE tensorflow/lite/schema/schema_generated.h 277 | 278 | # Gathers together all the objects we've compiled into a single '.a' archive. 279 | $(LIB_PATH): tensorflow/lite/schema/schema_generated.h $(LIB_OBJS) 280 | @mkdir -p $(dir $@) 281 | $(AR) $(ARFLAGS) $(LIB_PATH) $(LIB_OBJS) 282 | 283 | lib: $(LIB_PATH) 284 | 285 | $(MINIMAL_BINARY): $(MINIMAL_OBJS) $(LIB_PATH) 286 | @mkdir -p $(dir $@) 287 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 288 | -o $(MINIMAL_BINARY) $(MINIMAL_OBJS) \ 289 | $(LIBFLAGS) $(LIB_PATH) $(LDFLAGS) $(LIBS) 290 | 291 | minimal: $(MINIMAL_BINARY) 292 | 293 | $(BENCHMARK_LIB) : $(LIB_PATH) $(BENCHMARK_OBJS) 294 | @mkdir -p $(dir $@) 295 | $(AR) $(ARFLAGS) $(BENCHMARK_LIB) $(LIB_OBJS) $(BENCHMARK_OBJS) 296 | 297 | benchmark_lib: $(BENCHMARK_LIB) 298 | 299 | $(BENCHMARK_BINARY) : $(BENCHMARK_LIB) 300 | @mkdir -p $(dir $@) 301 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 302 | -o $(BENCHMARK_BINARY) \ 303 | $(LIBFLAGS) $(BENCHMARK_LIB) $(LDFLAGS) $(LIBS) 304 | 305 | benchmark: $(BENCHMARK_BINARY) 306 | 307 | $(LABEL_IMAGE_BINARY): $(LABEL_IMAGE_OBJS) $(LIB_PATH) 308 | @mkdir -p $(dir $@) 309 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 310 | -o $(LABEL_IMAGE_BINARY) $(LABEL_IMAGE_OBJS) \ 311 | $(LIBFLAGS) $(LIB_PATH) $(LDFLAGS) $(LIBS) 312 | 313 | label_image: $(LABEL_IMAGE_BINARY) 314 | 315 | libdir: 316 | @echo $(LIBDIR) 317 | 318 | # Gets rid of all generated files. 319 | clean: 320 | rm -rf $(MAKEFILE_DIR)/gen 321 | 322 | # Gets rid of target files only, leaving the host alone. Also leaves the lib 323 | # directory untouched deliberately, so we can persist multiple architectures 324 | # across builds for iOS and Android. 325 | cleantarget: 326 | rm -rf $(OBJDIR) 327 | rm -rf $(BINDIR) 328 | 329 | $(DEPDIR)/%.d: ; 330 | .PRECIOUS: $(DEPDIR)/%.d 331 | 332 | -include $(patsubst %,$(DEPDIR)/%.d,$(basename $(ALL_SRCS))) 333 | -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/Makefile.1.10.0: -------------------------------------------------------------------------------- 1 | # Make uses /bin/sh by default, which is incompatible with the bashisms seen 2 | # below. 3 | SHELL := /bin/bash 4 | 5 | # Find where we're running from, so we can store generated files here. 6 | ifeq ($(origin MAKEFILE_DIR), undefined) 7 | MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 8 | endif 9 | 10 | # Try to figure out the host system 11 | HOST_OS := 12 | ifeq ($(OS),Windows_NT) 13 | HOST_OS = windows 14 | else 15 | UNAME_S := $(shell uname -s) 16 | ifeq ($(UNAME_S),Linux) 17 | HOST_OS := linux 18 | endif 19 | ifeq ($(UNAME_S),Darwin) 20 | HOST_OS := osx 21 | endif 22 | endif 23 | 24 | HOST_ARCH := $(shell if [[ $(shell uname -m) =~ i[345678]86 ]]; then echo x86_32; else echo $(shell uname -m); fi) 25 | 26 | # Override these on the make command line to target a specific architecture. For example: 27 | # make -f tensorflow/lite/Makefile TARGET=rpi TARGET_ARCH=armv7l 28 | TARGET := $(HOST_OS) 29 | TARGET_ARCH := $(HOST_ARCH) 30 | 31 | INCLUDES := \ 32 | -I. \ 33 | -I$(MAKEFILE_DIR)/../../../../../ \ 34 | -I$(MAKEFILE_DIR)/../../../../../../ \ 35 | -I$(MAKEFILE_DIR)/downloads/ \ 36 | -I$(MAKEFILE_DIR)/downloads/eigen \ 37 | -I$(MAKEFILE_DIR)/downloads/absl \ 38 | -I$(MAKEFILE_DIR)/downloads/gemmlowp \ 39 | -I$(MAKEFILE_DIR)/downloads/neon_2_sse \ 40 | -I$(MAKEFILE_DIR)/downloads/farmhash/src \ 41 | -I$(MAKEFILE_DIR)/downloads/flatbuffers/include \ 42 | -I$(OBJDIR) 43 | # This is at the end so any globally-installed frameworks like protobuf don't 44 | # override local versions in the source tree. 45 | INCLUDES += -I/usr/local/include 46 | 47 | # These are the default libraries needed, but they can be added to or 48 | # overridden by the platform-specific settings in target makefiles. 49 | LIBS := \ 50 | -lstdc++ \ 51 | -lpthread \ 52 | -lm \ 53 | -lz 54 | 55 | # There are no rules for compiling objects for the host system (since we don't 56 | # generate things like the protobuf compiler that require that), so all of 57 | # these settings are for the target compiler. 58 | CXXFLAGS := -O3 -DNDEBUG -fPIC 59 | CXXFLAGS += $(EXTRA_CXXFLAGS) 60 | CCFLAGS := ${CXXFLAGS} 61 | CXXFLAGS += --std=c++11 62 | CFLAGS := 63 | LDOPTS := -L/usr/local/lib 64 | ARFLAGS := -r 65 | TARGET_TOOLCHAIN_PREFIX := 66 | CC_PREFIX := 67 | 68 | # This library is the main target for this makefile. It will contain a minimal 69 | # runtime that can be linked in to other programs. 70 | LIB_NAME := libtensorflow-lite.a 71 | 72 | # Benchmark static library and binary 73 | BENCHMARK_LIB_NAME := benchmark-lib.a 74 | BENCHMARK_BINARY_NAME := benchmark_model 75 | 76 | # A small example program that shows how to link against the library. 77 | MINIMAL_SRCS := \ 78 | tensorflow/lite/examples/minimal/minimal.cc 79 | 80 | # An example program that shows how to run a tflite graph with the library. 81 | LABEL_IMAGE_SRCS := \ 82 | tensorflow/lite/examples/label_image/label_image.cc \ 83 | tensorflow/lite/examples/label_image/bitmap_helpers.cc 84 | 85 | # What sources we want to compile, must be kept in sync with the main Bazel 86 | # build files. 87 | 88 | PROFILER_SRCS := \ 89 | tensorflow/lite/profiling/time.cc 90 | PROFILE_SUMMARIZER_SRCS := \ 91 | tensorflow/lite/profiling/profile_summarizer.cc \ 92 | tensorflow/core/util/stats_calculator.cc 93 | 94 | CORE_CC_ALL_SRCS := \ 95 | $(wildcard tensorflow/lite/*.cc) \ 96 | $(wildcard tensorflow/lite/*.c) \ 97 | $(wildcard tensorflow/lite/c/*.c) \ 98 | $(wildcard tensorflow/lite/experimental/c/*.c) \ 99 | $(wildcard tensorflow/lite/experimental/c/*.cc) \ 100 | $(wildcard tensorflow/lite/core/*.cc) \ 101 | $(wildcard tensorflow/lite/core/api/*.cc) 102 | ifneq ($(BUILD_TYPE),micro) 103 | CORE_CC_ALL_SRCS += \ 104 | $(wildcard tensorflow/lite/kernels/*.cc) \ 105 | $(wildcard tensorflow/lite/kernels/internal/*.cc) \ 106 | $(wildcard tensorflow/lite/kernels/internal/optimized/*.cc) \ 107 | $(wildcard tensorflow/lite/kernels/internal/reference/*.cc) \ 108 | $(PROFILER_SRCS) \ 109 | $(wildcard tensorflow/lite/kernels/*.c) \ 110 | $(wildcard tensorflow/lite/kernels/internal/*.c) \ 111 | $(wildcard tensorflow/lite/kernels/internal/optimized/*.c) \ 112 | $(wildcard tensorflow/lite/kernels/internal/reference/*.c) \ 113 | $(wildcard tensorflow/lite/tools/make/downloads/farmhash/src/farmhash.cc) \ 114 | $(wildcard tensorflow/lite/tools/make/downloads/fft2d/fftsg.c) 115 | endif 116 | # Remove any duplicates. 117 | CORE_CC_ALL_SRCS := $(sort $(CORE_CC_ALL_SRCS)) 118 | CORE_CC_EXCLUDE_SRCS := \ 119 | $(wildcard tensorflow/lite/*test.cc) \ 120 | $(wildcard tensorflow/lite/*/*test.cc) \ 121 | $(wildcard tensorflow/lite/*/*/*test.cc) \ 122 | $(wildcard tensorflow/lite/*/*/*/*test.cc) \ 123 | $(wildcard tensorflow/lite/kernels/*test_util.cc) \ 124 | $(MINIMAL_SRCS) \ 125 | $(LABEL_IMAGE_SRCS) 126 | 127 | ifeq ($(BUILD_TYPE),micro) 128 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/mmap_allocation.cc 129 | else 130 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/mmap_allocation_disabled.cc 131 | endif 132 | 133 | BUILD_WITH_NNAPI=true 134 | ifeq ($(BUILD_TYPE),micro) 135 | BUILD_WITH_NNAPI=false 136 | endif 137 | ifeq ($(TARGET),ios) 138 | BUILD_WITH_NNAPI=false 139 | endif 140 | # Added for RPi target 141 | ifeq ($(TARGET),rpi) 142 | BUILD_WITH_NNAPI=false 143 | endif 144 | ifeq ($(BUILD_WITH_NNAPI),true) 145 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/nnapi_delegate_disabled.cc 146 | else 147 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/nnapi_delegate.cc 148 | endif 149 | 150 | ifeq ($(TARGET),ios) 151 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_android.cc 152 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_default.cc 153 | else 154 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_android.cc 155 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_ios.cc 156 | endif 157 | 158 | 159 | # Filter out all the excluded files. 160 | TF_LITE_CC_SRCS := $(filter-out $(CORE_CC_EXCLUDE_SRCS), $(CORE_CC_ALL_SRCS)) 161 | 162 | # Benchmark sources 163 | BENCHMARK_SRCS_DIR := tensorflow/lite/tools/benchmark 164 | BENCHMARK_ALL_SRCS := $(TFLITE_CC_SRCS) \ 165 | $(wildcard $(BENCHMARK_SRCS_DIR)/*.cc) \ 166 | $(PROFILE_SUMMARIZER_SRCS) 167 | 168 | BENCHMARK_SRCS := $(filter-out \ 169 | $(wildcard $(BENCHMARK_SRCS_DIR)/*_test.cc), \ 170 | $(BENCHMARK_ALL_SRCS)) 171 | 172 | # These target-specific makefiles should modify or replace options like 173 | # CXXFLAGS or LIBS to work for a specific targetted architecture. All logic 174 | # based on platforms or architectures should happen within these files, to 175 | # keep this main makefile focused on the sources and dependencies. 176 | include $(wildcard $(MAKEFILE_DIR)/targets/*_makefile.inc) 177 | 178 | ALL_SRCS := \ 179 | $(MINIMAL_SRCS) \ 180 | $(PROFILER_SRCS) \ 181 | $(PROFILER_SUMMARY_SRCS) \ 182 | $(TF_LITE_CC_SRCS) \ 183 | $(BENCHMARK_SRCS) \ 184 | $(LABEL_IMAGE_SRCS) 185 | 186 | # Where compiled objects are stored. 187 | GENDIR := $(MAKEFILE_DIR)/gen/$(TARGET)_$(TARGET_ARCH)/ 188 | OBJDIR := $(GENDIR)obj/ 189 | BINDIR := $(GENDIR)bin/ 190 | LIBDIR := $(GENDIR)lib/ 191 | 192 | LIB_PATH := $(LIBDIR)$(LIB_NAME) 193 | BENCHMARK_LIB := $(LIBDIR)$(BENCHMARK_LIB_NAME) 194 | BENCHMARK_BINARY := $(BINDIR)$(BENCHMARK_BINARY_NAME) 195 | MINIMAL_BINARY := $(BINDIR)minimal 196 | LABEL_IMAGE_BINARY := $(BINDIR)label_image 197 | 198 | CXX := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}g++ 199 | CC := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}gcc 200 | AR := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}ar 201 | 202 | MINIMAL_OBJS := $(addprefix $(OBJDIR), \ 203 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(MINIMAL_SRCS)))) 204 | 205 | LIB_OBJS := $(addprefix $(OBJDIR), \ 206 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(TF_LITE_CC_SRCS)))) 207 | 208 | BENCHMARK_OBJS := $(addprefix $(OBJDIR), \ 209 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(BENCHMARK_SRCS)))) 210 | 211 | LABEL_IMAGE_OBJS := $(addprefix $(OBJDIR), \ 212 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(LABEL_IMAGE_SRCS)))) 213 | 214 | # For normal manually-created TensorFlow C++ source files. 215 | $(OBJDIR)%.o: %.cc 216 | @mkdir -p $(dir $@) 217 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ 218 | # For normal manually-created TensorFlow C source files. 219 | $(OBJDIR)%.o: %.c 220 | @mkdir -p $(dir $@) 221 | $(CC) $(CCFLAGS) $(INCLUDES) -c $< -o $@ 222 | 223 | # The target that's compiled if there's no command-line arguments. 224 | all: $(LIB_PATH) $(MINIMAL_BINARY) $(BENCHMARK_BINARY) $(LABEL_IMAGE_BINARY) 225 | 226 | # The target that's compiled for micro-controllers 227 | micro: $(LIB_PATH) 228 | 229 | # Hack for generating schema file bypassing flatbuffer parsing 230 | tensorflow/lite/schema/schema_generated.h: 231 | @cp -u tensorflow/lite/schema/schema_generated.h.OPENSOURCE tensorflow/lite/schema/schema_generated.h 232 | 233 | # Gathers together all the objects we've compiled into a single '.a' archive. 234 | $(LIB_PATH): tensorflow/lite/schema/schema_generated.h $(LIB_OBJS) 235 | @mkdir -p $(dir $@) 236 | $(AR) $(ARFLAGS) $(LIB_PATH) $(LIB_OBJS) 237 | 238 | $(MINIMAL_BINARY): $(MINIMAL_OBJS) $(LIB_PATH) 239 | @mkdir -p $(dir $@) 240 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 241 | -o $(MINIMAL_BINARY) $(MINIMAL_OBJS) \ 242 | $(LIBFLAGS) $(LIB_PATH) $(LDFLAGS) $(LIBS) 243 | 244 | $(BENCHMARK_LIB) : $(LIB_PATH) $(BENCHMARK_OBJS) 245 | @mkdir -p $(dir $@) 246 | $(AR) $(ARFLAGS) $(BENCHMARK_LIB) $(LIB_OBJS) $(BENCHMARK_OBJS) 247 | 248 | benchmark_lib: $(BENCHMARK_LIB) 249 | 250 | $(BENCHMARK_BINARY) : $(BENCHMARK_LIB) 251 | @mkdir -p $(dir $@) 252 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 253 | -o $(BENCHMARK_BINARY) \ 254 | $(LIBFLAGS) $(BENCHMARK_LIB) $(LDFLAGS) $(LIBS) 255 | 256 | benchmark: $(BENCHMARK_BINARY) 257 | 258 | $(LABEL_IMAGE_BINARY): $(LABEL_IMAGE_OBJS) $(LIB_PATH) 259 | @mkdir -p $(dir $@) 260 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 261 | -o $(LABEL_IMAGE_BINARY) $(LABEL_IMAGE_OBJS) \ 262 | $(LIBFLAGS) $(LIB_PATH) $(LDFLAGS) $(LIBS) 263 | 264 | label_image: $(LABEL_IMAGE_BINARY) 265 | 266 | libdir: 267 | @echo $(LIBDIR) 268 | 269 | # Gets rid of all generated files. 270 | clean: 271 | rm -rf $(MAKEFILE_DIR)/gen 272 | 273 | # Gets rid of target files only, leaving the host alone. Also leaves the lib 274 | # directory untouched deliberately, so we can persist multiple architectures 275 | # across builds for iOS and Android. 276 | cleantarget: 277 | rm -rf $(OBJDIR) 278 | rm -rf $(BINDIR) 279 | 280 | $(DEPDIR)/%.d: ; 281 | .PRECIOUS: $(DEPDIR)/%.d 282 | 283 | -include $(patsubst %,$(DEPDIR)/%.d,$(basename $(ALL_SRCS))) 284 | -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/Makefile.1.14.0: -------------------------------------------------------------------------------- 1 | # Make uses /bin/sh by default, which is incompatible with the bashisms seen 2 | # below. 3 | SHELL := /bin/bash 4 | 5 | # Find where we're running from, so we can store generated files here. 6 | ifeq ($(origin MAKEFILE_DIR), undefined) 7 | MAKEFILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) 8 | endif 9 | 10 | # Try to figure out the host system 11 | HOST_OS := 12 | ifeq ($(OS),Windows_NT) 13 | HOST_OS = windows 14 | else 15 | UNAME_S := $(shell uname -s) 16 | ifeq ($(UNAME_S),Linux) 17 | HOST_OS := linux 18 | endif 19 | ifeq ($(UNAME_S),Darwin) 20 | HOST_OS := osx 21 | endif 22 | endif 23 | 24 | HOST_ARCH := $(shell if uname -m | grep -q i[345678]86; then echo x86_32; else uname -m; fi) 25 | 26 | # Override these on the make command line to target a specific architecture. For example: 27 | # make -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv7l 28 | TARGET := $(HOST_OS) 29 | TARGET_ARCH := $(HOST_ARCH) 30 | 31 | INCLUDES := \ 32 | -I. \ 33 | -I$(MAKEFILE_DIR)/../../../../../ \ 34 | -I$(MAKEFILE_DIR)/../../../../../../ \ 35 | -I$(MAKEFILE_DIR)/downloads/ \ 36 | -I$(MAKEFILE_DIR)/downloads/eigen \ 37 | -I$(MAKEFILE_DIR)/downloads/absl \ 38 | -I$(MAKEFILE_DIR)/downloads/gemmlowp \ 39 | -I$(MAKEFILE_DIR)/downloads/neon_2_sse \ 40 | -I$(MAKEFILE_DIR)/downloads/farmhash/src \ 41 | -I$(MAKEFILE_DIR)/downloads/flatbuffers/include \ 42 | -I$(OBJDIR) 43 | # This is at the end so any globally-installed frameworks like protobuf don't 44 | # override local versions in the source tree. 45 | INCLUDES += -I/usr/local/include 46 | 47 | # These are the default libraries needed, but they can be added to or 48 | # overridden by the platform-specific settings in target makefiles. 49 | LIBS := \ 50 | -lstdc++ \ 51 | -lpthread \ 52 | -lm \ 53 | -lz 54 | 55 | # There are no rules for compiling objects for the host system (since we don't 56 | # generate things like the protobuf compiler that require that), so all of 57 | # these settings are for the target compiler. 58 | CXXFLAGS := -O3 -DNDEBUG -fPIC 59 | CXXFLAGS += $(EXTRA_CXXFLAGS) 60 | CFLAGS := ${CXXFLAGS} 61 | CXXFLAGS += --std=c++11 62 | LDOPTS := -L/usr/local/lib 63 | ARFLAGS := -r 64 | TARGET_TOOLCHAIN_PREFIX := 65 | CC_PREFIX := 66 | 67 | ifeq ($(HOST_OS),windows) 68 | CXXFLAGS += -fext-numeric-literals -D__LITTLE_ENDIAN__ 69 | endif 70 | 71 | # This library is the main target for this makefile. It will contain a minimal 72 | # runtime that can be linked in to other programs. 73 | LIB_NAME := libtensorflow-lite.a 74 | 75 | # Benchmark static library and binary 76 | BENCHMARK_LIB_NAME := benchmark-lib.a 77 | BENCHMARK_BINARY_NAME := benchmark_model 78 | 79 | # A small example program that shows how to link against the library. 80 | MINIMAL_SRCS := \ 81 | tensorflow/lite/examples/minimal/minimal.cc 82 | 83 | # What sources we want to compile, must be kept in sync with the main Bazel 84 | # build files. 85 | 86 | PROFILER_SRCS := \ 87 | tensorflow/lite/profiling/time.cc 88 | PROFILE_SUMMARIZER_SRCS := \ 89 | tensorflow/lite/profiling/profile_summarizer.cc \ 90 | tensorflow/core/util/stats_calculator.cc 91 | 92 | CMD_LINE_TOOLS_SRCS := \ 93 | tensorflow/lite/tools/command_line_flags.cc 94 | 95 | CORE_CC_ALL_SRCS := \ 96 | $(wildcard tensorflow/lite/*.cc) \ 97 | $(wildcard tensorflow/lite/*.c) \ 98 | $(wildcard tensorflow/lite/c/*.c) \ 99 | $(wildcard tensorflow/lite/core/*.cc) \ 100 | $(wildcard tensorflow/lite/core/api/*.cc) \ 101 | $(wildcard tensorflow/lite/experimental/resource_variable/*.cc) \ 102 | tensorflow/lite/experimental/ruy/allocator.cc \ 103 | tensorflow/lite/experimental/ruy/block_map.cc \ 104 | tensorflow/lite/experimental/ruy/blocking_counter.cc \ 105 | tensorflow/lite/experimental/ruy/context.cc \ 106 | tensorflow/lite/experimental/ruy/detect_arm.cc \ 107 | tensorflow/lite/experimental/ruy/have_built_path_for_avx2.cc \ 108 | tensorflow/lite/experimental/ruy/have_built_path_for_avx512.cc \ 109 | tensorflow/lite/experimental/ruy/kernel_arm32.cc \ 110 | tensorflow/lite/experimental/ruy/kernel_arm64.cc \ 111 | tensorflow/lite/experimental/ruy/kernel_avx2.cc \ 112 | tensorflow/lite/experimental/ruy/kernel_avx512.cc \ 113 | tensorflow/lite/experimental/ruy/pack_arm.cc \ 114 | tensorflow/lite/experimental/ruy/pack_avx2.cc \ 115 | tensorflow/lite/experimental/ruy/pack_avx512.cc \ 116 | tensorflow/lite/experimental/ruy/pmu.cc \ 117 | tensorflow/lite/experimental/ruy/thread_pool.cc \ 118 | tensorflow/lite/experimental/ruy/trace.cc \ 119 | tensorflow/lite/experimental/ruy/trmul.cc \ 120 | tensorflow/lite/experimental/ruy/tune.cc \ 121 | tensorflow/lite/experimental/ruy/wait.cc 122 | ifneq ($(BUILD_TYPE),micro) 123 | CORE_CC_ALL_SRCS += \ 124 | $(wildcard tensorflow/lite/kernels/*.cc) \ 125 | $(wildcard tensorflow/lite/kernels/internal/*.cc) \ 126 | $(wildcard tensorflow/lite/kernels/internal/optimized/*.cc) \ 127 | $(wildcard tensorflow/lite/kernels/internal/reference/*.cc) \ 128 | $(PROFILER_SRCS) \ 129 | tensorflow/lite/tools/make/downloads/farmhash/src/farmhash.cc \ 130 | tensorflow/lite/tools/make/downloads/fft2d/fftsg.c \ 131 | tensorflow/lite/tools/make/downloads/flatbuffers/src/util.cpp 132 | CORE_CC_ALL_SRCS += \ 133 | $(shell find tensorflow/lite/tools/make/downloads/absl/absl/ \ 134 | -type f -name \*.cc | grep -v test | grep -v benchmark | grep -v synchronization) 135 | endif 136 | # Remove any duplicates. 137 | CORE_CC_ALL_SRCS := $(sort $(CORE_CC_ALL_SRCS)) 138 | CORE_CC_EXCLUDE_SRCS := \ 139 | $(wildcard tensorflow/lite/*test.cc) \ 140 | $(wildcard tensorflow/lite/*/*test.cc) \ 141 | $(wildcard tensorflow/lite/*/*/*test.cc) \ 142 | $(wildcard tensorflow/lite/*/*/*/*test.cc) \ 143 | $(wildcard tensorflow/lite/kernels/*test_main.cc) \ 144 | $(wildcard tensorflow/lite/kernels/*test_util*.cc) \ 145 | $(MINIMAL_SRCS) 146 | 147 | BUILD_WITH_MMAP ?= true 148 | ifeq ($(BUILD_TYPE),micro) 149 | BUILD_WITH_MMAP=false 150 | endif 151 | ifeq ($(BUILD_TYPE),windows) 152 | BUILD_WITH_MMAP=false 153 | endif 154 | ifeq ($(BUILD_WITH_MMAP),true) 155 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/mmap_allocation.cc 156 | else 157 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/mmap_allocation_disabled.cc 158 | endif 159 | 160 | BUILD_WITH_NNAPI ?= true 161 | ifeq ($(BUILD_TYPE),micro) 162 | BUILD_WITH_NNAPI=false 163 | endif 164 | ifeq ($(TARGET),windows) 165 | BUILD_WITH_NNAPI=false 166 | endif 167 | ifeq ($(TARGET),ios) 168 | BUILD_WITH_NNAPI=false 169 | endif 170 | ifeq ($(TARGET),rpi) 171 | BUILD_WITH_NNAPI=false 172 | endif 173 | ifeq ($(TARGET),generic-aarch64) 174 | BUILD_WITH_NNAPI=false 175 | endif 176 | ifeq ($(BUILD_WITH_NNAPI),true) 177 | CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/nnapi_delegate.cc 178 | CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/quant_lstm_sup.cc 179 | CORE_CC_ALL_SRCS += tensorflow/lite/nnapi/nnapi_implementation.cc 180 | LIBS += -lrt 181 | else 182 | CORE_CC_ALL_SRCS += tensorflow/lite/delegates/nnapi/nnapi_delegate_disabled.cc 183 | CORE_CC_ALL_SRCS += tensorflow/lite/nnapi/nnapi_implementation_disabled.cc 184 | endif 185 | 186 | ifeq ($(TARGET),ios) 187 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_android.cc 188 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_default.cc 189 | else 190 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_android.cc 191 | CORE_CC_EXCLUDE_SRCS += tensorflow/lite/minimal_logging_ios.cc 192 | endif 193 | 194 | 195 | # Filter out all the excluded files. 196 | TF_LITE_CC_SRCS := $(filter-out $(CORE_CC_EXCLUDE_SRCS), $(CORE_CC_ALL_SRCS)) 197 | 198 | # Benchmark sources 199 | BENCHMARK_SRCS_DIR := tensorflow/lite/tools/benchmark 200 | EVALUATION_UTILS_SRCS := \ 201 | tensorflow/lite/tools/evaluation/utils.cc 202 | BENCHMARK_ALL_SRCS := $(TF_LITE_CC_SRCS) \ 203 | $(wildcard $(BENCHMARK_SRCS_DIR)/*.cc) \ 204 | $(PROFILE_SUMMARIZER_SRCS) \ 205 | $(CMD_LINE_TOOLS_SRCS) \ 206 | $(EVALUATION_UTILS_SRCS) 207 | 208 | BENCHMARK_SRCS := $(filter-out \ 209 | $(wildcard $(BENCHMARK_SRCS_DIR)/*_test.cc) \ 210 | $(BENCHMARK_SRCS_DIR)/benchmark_plus_flex_main.cc, \ 211 | $(BENCHMARK_ALL_SRCS)) 212 | 213 | # These target-specific makefiles should modify or replace options like 214 | # CXXFLAGS or LIBS to work for a specific targetted architecture. All logic 215 | # based on platforms or architectures should happen within these files, to 216 | # keep this main makefile focused on the sources and dependencies. 217 | include $(wildcard $(MAKEFILE_DIR)/targets/*_makefile.inc) 218 | 219 | ALL_SRCS := \ 220 | $(MINIMAL_SRCS) \ 221 | $(PROFILER_SRCS) \ 222 | $(PROFILER_SUMMARIZER_SRCS) \ 223 | $(TF_LITE_CC_SRCS) \ 224 | $(BENCHMARK_SRCS) \ 225 | $(CMD_LINE_TOOLS_SRCS) 226 | 227 | # Where compiled objects are stored. 228 | GENDIR := $(MAKEFILE_DIR)/gen/$(TARGET)_$(TARGET_ARCH)/ 229 | OBJDIR := $(GENDIR)obj/ 230 | BINDIR := $(GENDIR)bin/ 231 | LIBDIR := $(GENDIR)lib/ 232 | 233 | LIB_PATH := $(LIBDIR)$(LIB_NAME) 234 | BENCHMARK_LIB := $(LIBDIR)$(BENCHMARK_LIB_NAME) 235 | BENCHMARK_BINARY := $(BINDIR)$(BENCHMARK_BINARY_NAME) 236 | MINIMAL_BINARY := $(BINDIR)minimal 237 | 238 | CXX := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}g++ 239 | CC := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}gcc 240 | AR := $(CC_PREFIX)${TARGET_TOOLCHAIN_PREFIX}ar 241 | 242 | MINIMAL_OBJS := $(addprefix $(OBJDIR), \ 243 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(MINIMAL_SRCS)))) 244 | 245 | LIB_OBJS := $(addprefix $(OBJDIR), \ 246 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(TF_LITE_CC_SRCS))))) 247 | 248 | BENCHMARK_OBJS := $(addprefix $(OBJDIR), \ 249 | $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(BENCHMARK_SRCS))))) 250 | 251 | # For normal manually-created TensorFlow Lite C++ source files. 252 | $(OBJDIR)%.o: %.cc 253 | @mkdir -p $(dir $@) 254 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ 255 | # For normal manually-created TensorFlow Lite C source files. 256 | $(OBJDIR)%.o: %.c 257 | @mkdir -p $(dir $@) 258 | $(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@ 259 | $(OBJDIR)%.o: %.cpp 260 | @mkdir -p $(dir $@) 261 | $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@ 262 | 263 | # The target that's compiled if there's no command-line arguments. 264 | all: $(LIB_PATH) $(MINIMAL_BINARY) $(BENCHMARK_BINARY) 265 | 266 | # The target that's compiled for micro-controllers 267 | micro: $(LIB_PATH) 268 | 269 | # Hack for generating schema file bypassing flatbuffer parsing 270 | tensorflow/lite/schema/schema_generated.h: 271 | @cp -u tensorflow/lite/schema/schema_generated.h.OPENSOURCE tensorflow/lite/schema/schema_generated.h 272 | 273 | # Gathers together all the objects we've compiled into a single '.a' archive. 274 | $(LIB_PATH): tensorflow/lite/schema/schema_generated.h $(LIB_OBJS) 275 | @mkdir -p $(dir $@) 276 | $(AR) $(ARFLAGS) $(LIB_PATH) $(LIB_OBJS) 277 | 278 | lib: $(LIB_PATH) 279 | 280 | $(MINIMAL_BINARY): $(MINIMAL_OBJS) $(LIB_PATH) 281 | @mkdir -p $(dir $@) 282 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 283 | -o $(MINIMAL_BINARY) $(MINIMAL_OBJS) \ 284 | $(LIBFLAGS) $(LIB_PATH) $(LDFLAGS) $(LIBS) 285 | 286 | minimal: $(MINIMAL_BINARY) 287 | 288 | $(BENCHMARK_LIB) : $(LIB_PATH) $(BENCHMARK_OBJS) 289 | @mkdir -p $(dir $@) 290 | $(AR) $(ARFLAGS) $(BENCHMARK_LIB) $(LIB_OBJS) $(BENCHMARK_OBJS) 291 | 292 | benchmark_lib: $(BENCHMARK_LIB) 293 | 294 | $(BENCHMARK_BINARY) : $(BENCHMARK_LIB) 295 | @mkdir -p $(dir $@) 296 | $(CXX) $(CXXFLAGS) $(INCLUDES) \ 297 | -o $(BENCHMARK_BINARY) \ 298 | $(LIBFLAGS) $(BENCHMARK_LIB) $(LDFLAGS) $(LIBS) 299 | 300 | benchmark: $(BENCHMARK_BINARY) 301 | 302 | libdir: 303 | @echo $(LIBDIR) 304 | 305 | # Gets rid of all generated files. 306 | clean: 307 | rm -rf $(MAKEFILE_DIR)/gen 308 | 309 | # Gets rid of target files only, leaving the host alone. Also leaves the lib 310 | # directory untouched deliberately, so we can persist multiple architectures 311 | # across builds for iOS and Android. 312 | cleantarget: 313 | rm -rf $(OBJDIR) 314 | rm -rf $(BINDIR) 315 | 316 | $(DEPDIR)/%.d: ; 317 | .PRECIOUS: $(DEPDIR)/%.d 318 | 319 | -include $(patsubst %,$(DEPDIR)/%.d,$(basename $(ALL_SRCS))) 320 | -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/build_rpi_armv6_label_image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | 19 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 20 | cd "$SCRIPT_DIR/../../../.." 21 | 22 | # Add "--dry-run" flag for debugging 23 | CC_PREFIX=arm-linux-gnueabihf- make -j 3 -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv6 label_image 24 | -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/build_rpi_armv6_lib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================== 16 | 17 | set -e 18 | 19 | SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 20 | cd "$SCRIPT_DIR/../../../.." 21 | 22 | CC_PREFIX=arm-linux-gnueabihf- make -j 3 -f tensorflow/lite/tools/make/Makefile TARGET=rpi TARGET_ARCH=armv6 23 | -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/detect.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudwiser/TensorFlowLiteRPIZero/b1d571aab2ff3eab1ed9c66ebeb6c5b9c835fa12/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/detect.tflite -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/grace_hopper.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudwiser/TensorFlowLiteRPIZero/b1d571aab2ff3eab1ed9c66ebeb6c5b9c835fa12/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/grace_hopper.bmp -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/labels.txt: -------------------------------------------------------------------------------- 1 | background 2 | tench 3 | goldfish 4 | great white shark 5 | tiger shark 6 | hammerhead 7 | electric ray 8 | stingray 9 | cock 10 | hen 11 | ostrich 12 | brambling 13 | goldfinch 14 | house finch 15 | junco 16 | indigo bunting 17 | robin 18 | bulbul 19 | jay 20 | magpie 21 | chickadee 22 | water ouzel 23 | kite 24 | bald eagle 25 | vulture 26 | great grey owl 27 | European fire salamander 28 | common newt 29 | eft 30 | spotted salamander 31 | axolotl 32 | bullfrog 33 | tree frog 34 | tailed frog 35 | loggerhead 36 | leatherback turtle 37 | mud turtle 38 | terrapin 39 | box turtle 40 | banded gecko 41 | common iguana 42 | American chameleon 43 | whiptail 44 | agama 45 | frilled lizard 46 | alligator lizard 47 | Gila monster 48 | green lizard 49 | African chameleon 50 | Komodo dragon 51 | African crocodile 52 | American alligator 53 | triceratops 54 | thunder snake 55 | ringneck snake 56 | hognose snake 57 | green snake 58 | king snake 59 | garter snake 60 | water snake 61 | vine snake 62 | night snake 63 | boa constrictor 64 | rock python 65 | Indian cobra 66 | green mamba 67 | sea snake 68 | horned viper 69 | diamondback 70 | sidewinder 71 | trilobite 72 | harvestman 73 | scorpion 74 | black and gold garden spider 75 | barn spider 76 | garden spider 77 | black widow 78 | tarantula 79 | wolf spider 80 | tick 81 | centipede 82 | black grouse 83 | ptarmigan 84 | ruffed grouse 85 | prairie chicken 86 | peacock 87 | quail 88 | partridge 89 | African grey 90 | macaw 91 | sulphur-crested cockatoo 92 | lorikeet 93 | coucal 94 | bee eater 95 | hornbill 96 | hummingbird 97 | jacamar 98 | toucan 99 | drake 100 | red-breasted merganser 101 | goose 102 | black swan 103 | tusker 104 | echidna 105 | platypus 106 | wallaby 107 | koala 108 | wombat 109 | jellyfish 110 | sea anemone 111 | brain coral 112 | flatworm 113 | nematode 114 | conch 115 | snail 116 | slug 117 | sea slug 118 | chiton 119 | chambered nautilus 120 | Dungeness crab 121 | rock crab 122 | fiddler crab 123 | king crab 124 | American lobster 125 | spiny lobster 126 | crayfish 127 | hermit crab 128 | isopod 129 | white stork 130 | black stork 131 | spoonbill 132 | flamingo 133 | little blue heron 134 | American egret 135 | bittern 136 | crane 137 | limpkin 138 | European gallinule 139 | American coot 140 | bustard 141 | ruddy turnstone 142 | red-backed sandpiper 143 | redshank 144 | dowitcher 145 | oystercatcher 146 | pelican 147 | king penguin 148 | albatross 149 | grey whale 150 | killer whale 151 | dugong 152 | sea lion 153 | Chihuahua 154 | Japanese spaniel 155 | Maltese dog 156 | Pekinese 157 | Shih-Tzu 158 | Blenheim spaniel 159 | papillon 160 | toy terrier 161 | Rhodesian ridgeback 162 | Afghan hound 163 | basset 164 | beagle 165 | bloodhound 166 | bluetick 167 | black-and-tan coonhound 168 | Walker hound 169 | English foxhound 170 | redbone 171 | borzoi 172 | Irish wolfhound 173 | Italian greyhound 174 | whippet 175 | Ibizan hound 176 | Norwegian elkhound 177 | otterhound 178 | Saluki 179 | Scottish deerhound 180 | Weimaraner 181 | Staffordshire bullterrier 182 | American Staffordshire terrier 183 | Bedlington terrier 184 | Border terrier 185 | Kerry blue terrier 186 | Irish terrier 187 | Norfolk terrier 188 | Norwich terrier 189 | Yorkshire terrier 190 | wire-haired fox terrier 191 | Lakeland terrier 192 | Sealyham terrier 193 | Airedale 194 | cairn 195 | Australian terrier 196 | Dandie Dinmont 197 | Boston bull 198 | miniature schnauzer 199 | giant schnauzer 200 | standard schnauzer 201 | Scotch terrier 202 | Tibetan terrier 203 | silky terrier 204 | soft-coated wheaten terrier 205 | West Highland white terrier 206 | Lhasa 207 | flat-coated retriever 208 | curly-coated retriever 209 | golden retriever 210 | Labrador retriever 211 | Chesapeake Bay retriever 212 | German short-haired pointer 213 | vizsla 214 | English setter 215 | Irish setter 216 | Gordon setter 217 | Brittany spaniel 218 | clumber 219 | English springer 220 | Welsh springer spaniel 221 | cocker spaniel 222 | Sussex spaniel 223 | Irish water spaniel 224 | kuvasz 225 | schipperke 226 | groenendael 227 | malinois 228 | briard 229 | kelpie 230 | komondor 231 | Old English sheepdog 232 | Shetland sheepdog 233 | collie 234 | Border collie 235 | Bouvier des Flandres 236 | Rottweiler 237 | German shepherd 238 | Doberman 239 | miniature pinscher 240 | Greater Swiss Mountain dog 241 | Bernese mountain dog 242 | Appenzeller 243 | EntleBucher 244 | boxer 245 | bull mastiff 246 | Tibetan mastiff 247 | French bulldog 248 | Great Dane 249 | Saint Bernard 250 | Eskimo dog 251 | malamute 252 | Siberian husky 253 | dalmatian 254 | affenpinscher 255 | basenji 256 | pug 257 | Leonberg 258 | Newfoundland 259 | Great Pyrenees 260 | Samoyed 261 | Pomeranian 262 | chow 263 | keeshond 264 | Brabancon griffon 265 | Pembroke 266 | Cardigan 267 | toy poodle 268 | miniature poodle 269 | standard poodle 270 | Mexican hairless 271 | timber wolf 272 | white wolf 273 | red wolf 274 | coyote 275 | dingo 276 | dhole 277 | African hunting dog 278 | hyena 279 | red fox 280 | kit fox 281 | Arctic fox 282 | grey fox 283 | tabby 284 | tiger cat 285 | Persian cat 286 | Siamese cat 287 | Egyptian cat 288 | cougar 289 | lynx 290 | leopard 291 | snow leopard 292 | jaguar 293 | lion 294 | tiger 295 | cheetah 296 | brown bear 297 | American black bear 298 | ice bear 299 | sloth bear 300 | mongoose 301 | meerkat 302 | tiger beetle 303 | ladybug 304 | ground beetle 305 | long-horned beetle 306 | leaf beetle 307 | dung beetle 308 | rhinoceros beetle 309 | weevil 310 | fly 311 | bee 312 | ant 313 | grasshopper 314 | cricket 315 | walking stick 316 | cockroach 317 | mantis 318 | cicada 319 | leafhopper 320 | lacewing 321 | dragonfly 322 | damselfly 323 | admiral 324 | ringlet 325 | monarch 326 | cabbage butterfly 327 | sulphur butterfly 328 | lycaenid 329 | starfish 330 | sea urchin 331 | sea cucumber 332 | wood rabbit 333 | hare 334 | Angora 335 | hamster 336 | porcupine 337 | fox squirrel 338 | marmot 339 | beaver 340 | guinea pig 341 | sorrel 342 | zebra 343 | hog 344 | wild boar 345 | warthog 346 | hippopotamus 347 | ox 348 | water buffalo 349 | bison 350 | ram 351 | bighorn 352 | ibex 353 | hartebeest 354 | impala 355 | gazelle 356 | Arabian camel 357 | llama 358 | weasel 359 | mink 360 | polecat 361 | black-footed ferret 362 | otter 363 | skunk 364 | badger 365 | armadillo 366 | three-toed sloth 367 | orangutan 368 | gorilla 369 | chimpanzee 370 | gibbon 371 | siamang 372 | guenon 373 | patas 374 | baboon 375 | macaque 376 | langur 377 | colobus 378 | proboscis monkey 379 | marmoset 380 | capuchin 381 | howler monkey 382 | titi 383 | spider monkey 384 | squirrel monkey 385 | Madagascar cat 386 | indri 387 | Indian elephant 388 | African elephant 389 | lesser panda 390 | giant panda 391 | barracouta 392 | eel 393 | coho 394 | rock beauty 395 | anemone fish 396 | sturgeon 397 | gar 398 | lionfish 399 | puffer 400 | abacus 401 | abaya 402 | academic gown 403 | accordion 404 | acoustic guitar 405 | aircraft carrier 406 | airliner 407 | airship 408 | altar 409 | ambulance 410 | amphibian 411 | analog clock 412 | apiary 413 | apron 414 | ashcan 415 | assault rifle 416 | backpack 417 | bakery 418 | balance beam 419 | balloon 420 | ballpoint 421 | Band Aid 422 | banjo 423 | bannister 424 | barbell 425 | barber chair 426 | barbershop 427 | barn 428 | barometer 429 | barrel 430 | barrow 431 | baseball 432 | basketball 433 | bassinet 434 | bassoon 435 | bathing cap 436 | bath towel 437 | bathtub 438 | beach wagon 439 | beacon 440 | beaker 441 | bearskin 442 | beer bottle 443 | beer glass 444 | bell cote 445 | bib 446 | bicycle-built-for-two 447 | bikini 448 | binder 449 | binoculars 450 | birdhouse 451 | boathouse 452 | bobsled 453 | bolo tie 454 | bonnet 455 | bookcase 456 | bookshop 457 | bottlecap 458 | bow 459 | bow tie 460 | brass 461 | brassiere 462 | breakwater 463 | breastplate 464 | broom 465 | bucket 466 | buckle 467 | bulletproof vest 468 | bullet train 469 | butcher shop 470 | cab 471 | caldron 472 | candle 473 | cannon 474 | canoe 475 | can opener 476 | cardigan 477 | car mirror 478 | carousel 479 | carpenter's kit 480 | carton 481 | car wheel 482 | cash machine 483 | cassette 484 | cassette player 485 | castle 486 | catamaran 487 | CD player 488 | cello 489 | cellular telephone 490 | chain 491 | chainlink fence 492 | chain mail 493 | chain saw 494 | chest 495 | chiffonier 496 | chime 497 | china cabinet 498 | Christmas stocking 499 | church 500 | cinema 501 | cleaver 502 | cliff dwelling 503 | cloak 504 | clog 505 | cocktail shaker 506 | coffee mug 507 | coffeepot 508 | coil 509 | combination lock 510 | computer keyboard 511 | confectionery 512 | container ship 513 | convertible 514 | corkscrew 515 | cornet 516 | cowboy boot 517 | cowboy hat 518 | cradle 519 | crane 520 | crash helmet 521 | crate 522 | crib 523 | Crock Pot 524 | croquet ball 525 | crutch 526 | cuirass 527 | dam 528 | desk 529 | desktop computer 530 | dial telephone 531 | diaper 532 | digital clock 533 | digital watch 534 | dining table 535 | dishrag 536 | dishwasher 537 | disk brake 538 | dock 539 | dogsled 540 | dome 541 | doormat 542 | drilling platform 543 | drum 544 | drumstick 545 | dumbbell 546 | Dutch oven 547 | electric fan 548 | electric guitar 549 | electric locomotive 550 | entertainment center 551 | envelope 552 | espresso maker 553 | face powder 554 | feather boa 555 | file 556 | fireboat 557 | fire engine 558 | fire screen 559 | flagpole 560 | flute 561 | folding chair 562 | football helmet 563 | forklift 564 | fountain 565 | fountain pen 566 | four-poster 567 | freight car 568 | French horn 569 | frying pan 570 | fur coat 571 | garbage truck 572 | gasmask 573 | gas pump 574 | goblet 575 | go-kart 576 | golf ball 577 | golfcart 578 | gondola 579 | gong 580 | gown 581 | grand piano 582 | greenhouse 583 | grille 584 | grocery store 585 | guillotine 586 | hair slide 587 | hair spray 588 | half track 589 | hammer 590 | hamper 591 | hand blower 592 | hand-held computer 593 | handkerchief 594 | hard disc 595 | harmonica 596 | harp 597 | harvester 598 | hatchet 599 | holster 600 | home theater 601 | honeycomb 602 | hook 603 | hoopskirt 604 | horizontal bar 605 | horse cart 606 | hourglass 607 | iPod 608 | iron 609 | jack-o'-lantern 610 | jean 611 | jeep 612 | jersey 613 | jigsaw puzzle 614 | jinrikisha 615 | joystick 616 | kimono 617 | knee pad 618 | knot 619 | lab coat 620 | ladle 621 | lampshade 622 | laptop 623 | lawn mower 624 | lens cap 625 | letter opener 626 | library 627 | lifeboat 628 | lighter 629 | limousine 630 | liner 631 | lipstick 632 | Loafer 633 | lotion 634 | loudspeaker 635 | loupe 636 | lumbermill 637 | magnetic compass 638 | mailbag 639 | mailbox 640 | maillot 641 | maillot 642 | manhole cover 643 | maraca 644 | marimba 645 | mask 646 | matchstick 647 | maypole 648 | maze 649 | measuring cup 650 | medicine chest 651 | megalith 652 | microphone 653 | microwave 654 | military uniform 655 | milk can 656 | minibus 657 | miniskirt 658 | minivan 659 | missile 660 | mitten 661 | mixing bowl 662 | mobile home 663 | Model T 664 | modem 665 | monastery 666 | monitor 667 | moped 668 | mortar 669 | mortarboard 670 | mosque 671 | mosquito net 672 | motor scooter 673 | mountain bike 674 | mountain tent 675 | mouse 676 | mousetrap 677 | moving van 678 | muzzle 679 | nail 680 | neck brace 681 | necklace 682 | nipple 683 | notebook 684 | obelisk 685 | oboe 686 | ocarina 687 | odometer 688 | oil filter 689 | organ 690 | oscilloscope 691 | overskirt 692 | oxcart 693 | oxygen mask 694 | packet 695 | paddle 696 | paddlewheel 697 | padlock 698 | paintbrush 699 | pajama 700 | palace 701 | panpipe 702 | paper towel 703 | parachute 704 | parallel bars 705 | park bench 706 | parking meter 707 | passenger car 708 | patio 709 | pay-phone 710 | pedestal 711 | pencil box 712 | pencil sharpener 713 | perfume 714 | Petri dish 715 | photocopier 716 | pick 717 | pickelhaube 718 | picket fence 719 | pickup 720 | pier 721 | piggy bank 722 | pill bottle 723 | pillow 724 | ping-pong ball 725 | pinwheel 726 | pirate 727 | pitcher 728 | plane 729 | planetarium 730 | plastic bag 731 | plate rack 732 | plow 733 | plunger 734 | Polaroid camera 735 | pole 736 | police van 737 | poncho 738 | pool table 739 | pop bottle 740 | pot 741 | potter's wheel 742 | power drill 743 | prayer rug 744 | printer 745 | prison 746 | projectile 747 | projector 748 | puck 749 | punching bag 750 | purse 751 | quill 752 | quilt 753 | racer 754 | racket 755 | radiator 756 | radio 757 | radio telescope 758 | rain barrel 759 | recreational vehicle 760 | reel 761 | reflex camera 762 | refrigerator 763 | remote control 764 | restaurant 765 | revolver 766 | rifle 767 | rocking chair 768 | rotisserie 769 | rubber eraser 770 | rugby ball 771 | rule 772 | running shoe 773 | safe 774 | safety pin 775 | saltshaker 776 | sandal 777 | sarong 778 | sax 779 | scabbard 780 | scale 781 | school bus 782 | schooner 783 | scoreboard 784 | screen 785 | screw 786 | screwdriver 787 | seat belt 788 | sewing machine 789 | shield 790 | shoe shop 791 | shoji 792 | shopping basket 793 | shopping cart 794 | shovel 795 | shower cap 796 | shower curtain 797 | ski 798 | ski mask 799 | sleeping bag 800 | slide rule 801 | sliding door 802 | slot 803 | snorkel 804 | snowmobile 805 | snowplow 806 | soap dispenser 807 | soccer ball 808 | sock 809 | solar dish 810 | sombrero 811 | soup bowl 812 | space bar 813 | space heater 814 | space shuttle 815 | spatula 816 | speedboat 817 | spider web 818 | spindle 819 | sports car 820 | spotlight 821 | stage 822 | steam locomotive 823 | steel arch bridge 824 | steel drum 825 | stethoscope 826 | stole 827 | stone wall 828 | stopwatch 829 | stove 830 | strainer 831 | streetcar 832 | stretcher 833 | studio couch 834 | stupa 835 | submarine 836 | suit 837 | sundial 838 | sunglass 839 | sunglasses 840 | sunscreen 841 | suspension bridge 842 | swab 843 | sweatshirt 844 | swimming trunks 845 | swing 846 | switch 847 | syringe 848 | table lamp 849 | tank 850 | tape player 851 | teapot 852 | teddy 853 | television 854 | tennis ball 855 | thatch 856 | theater curtain 857 | thimble 858 | thresher 859 | throne 860 | tile roof 861 | toaster 862 | tobacco shop 863 | toilet seat 864 | torch 865 | totem pole 866 | tow truck 867 | toyshop 868 | tractor 869 | trailer truck 870 | tray 871 | trench coat 872 | tricycle 873 | trimaran 874 | tripod 875 | triumphal arch 876 | trolleybus 877 | trombone 878 | tub 879 | turnstile 880 | typewriter keyboard 881 | umbrella 882 | unicycle 883 | upright 884 | vacuum 885 | vase 886 | vault 887 | velvet 888 | vending machine 889 | vestment 890 | viaduct 891 | violin 892 | volleyball 893 | waffle iron 894 | wall clock 895 | wallet 896 | wardrobe 897 | warplane 898 | washbasin 899 | washer 900 | water bottle 901 | water jug 902 | water tower 903 | whiskey jug 904 | whistle 905 | wig 906 | window screen 907 | window shade 908 | Windsor tie 909 | wine bottle 910 | wing 911 | wok 912 | wooden spoon 913 | wool 914 | worm fence 915 | wreck 916 | yawl 917 | yurt 918 | web site 919 | comic book 920 | crossword puzzle 921 | street sign 922 | traffic light 923 | book jacket 924 | menu 925 | plate 926 | guacamole 927 | consomme 928 | hot pot 929 | trifle 930 | ice cream 931 | ice lolly 932 | French loaf 933 | bagel 934 | pretzel 935 | cheeseburger 936 | hotdog 937 | mashed potato 938 | head cabbage 939 | broccoli 940 | cauliflower 941 | zucchini 942 | spaghetti squash 943 | acorn squash 944 | butternut squash 945 | cucumber 946 | artichoke 947 | bell pepper 948 | cardoon 949 | mushroom 950 | Granny Smith 951 | strawberry 952 | orange 953 | lemon 954 | fig 955 | pineapple 956 | banana 957 | jackfruit 958 | custard apple 959 | pomegranate 960 | hay 961 | carbonara 962 | chocolate sauce 963 | dough 964 | meat loaf 965 | pizza 966 | potpie 967 | burrito 968 | red wine 969 | espresso 970 | cup 971 | eggnog 972 | alp 973 | bubble 974 | cliff 975 | coral reef 976 | geyser 977 | lakeside 978 | promontory 979 | sandbar 980 | seashore 981 | valley 982 | volcano 983 | ballplayer 984 | groom 985 | scuba diver 986 | rapeseed 987 | daisy 988 | yellow lady's slipper 989 | corn 990 | acorn 991 | hip 992 | buckeye 993 | coral fungus 994 | agaric 995 | gyromitra 996 | stinkhorn 997 | earthstar 998 | hen-of-the-woods 999 | bolete 1000 | ear 1001 | toilet tissue -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/mobilenet_quant_v1_224.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cloudwiser/TensorFlowLiteRPIZero/b1d571aab2ff3eab1ed9c66ebeb6c5b9c835fa12/tensorflow/tensorflow/lite/tools/make/gen/rpi_armv6/bin/mobilenet_quant_v1_224.tflite -------------------------------------------------------------------------------- /tensorflow/tensorflow/lite/tools/make/target/rpi_makefile.inc: -------------------------------------------------------------------------------- 1 | # Settings for Raspberry Pi. 2 | ifeq ($(TARGET),rpi) 3 | # Default to the architecture used on the Pi Two/Three (ArmV7), but override this 4 | # with TARGET_ARCH=armv6 to build for the Pi Zero or One. 5 | TARGET_ARCH := armv7l 6 | TARGET_TOOLCHAIN_PREFIX := arm-linux-gnueabihf- 7 | 8 | ifeq ($(TARGET_ARCH), armv7l) 9 | CXXFLAGS += \ 10 | -march=armv7-a \ 11 | -mfpu=neon-vfpv4 \ 12 | -funsafe-math-optimizations \ 13 | -ftree-vectorize \ 14 | -fPIC 15 | 16 | CFLAGS += \ 17 | -march=armv7-a \ 18 | -mfpu=neon-vfpv4 \ 19 | -funsafe-math-optimizations \ 20 | -ftree-vectorize \ 21 | -fPIC 22 | 23 | LDFLAGS := \ 24 | -Wl,--no-export-dynamic \ 25 | -Wl,--exclude-libs,ALL \ 26 | -Wl,--gc-sections \ 27 | -Wl,--as-needed 28 | endif 29 | 30 | # TODO(petewarden) In the future, we'll want to use OpenBLAS as a faster 31 | # alternative to Eigen on non-NEON ARM hardware like armv6. 32 | ifeq ($(TARGET_ARCH), armv6) 33 | CXXFLAGS += \ 34 | -march=armv6 \ 35 | -mfpu=vfp \ 36 | -funsafe-math-optimizations \ 37 | -ftree-vectorize \ 38 | -fPIC 39 | 40 | CFLAGS += \ 41 | -march=armv6 \ 42 | -mfpu=vfp \ 43 | -funsafe-math-optimizations \ 44 | -ftree-vectorize \ 45 | -fPIC 46 | 47 | LDFLAGS := \ 48 | -Wl,--no-export-dynamic \ 49 | -Wl,--exclude-libs,ALL \ 50 | -Wl,--gc-sections \ 51 | -Wl,--as-needed 52 | endif 53 | 54 | LIBS := \ 55 | -lstdc++ \ 56 | -latomic \ 57 | -lpthread \ 58 | -lm \ 59 | -ldl 60 | 61 | endif 62 | --------------------------------------------------------------------------------