File tree Expand file tree Collapse file tree 3 files changed +33
-5
lines changed
examples/person_detection/esp Expand file tree Collapse file tree 3 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,27 @@ tensorflow/lite/micro/examples/person_detection/esp/app_camera_esp.c
55ESP_PERSON_DETECTION_HDRS := \
66tensorflow/lite/micro/examples/person_detection/esp/app_camera_esp.h
77
8- CCFLAGS += -Wno-nonnull
9- CXXFLAGS += -Wno-return-type -Wno-strict-aliasing
108person_detection_SRCS += $(ESP_PERSON_DETECTION_SRCS )
119person_detection_HDRS += $(ESP_PERSON_DETECTION_HDRS )
1210MAIN_SRCS += $(ESP_PERSON_DETECTION_SRCS )
13- GRAYSCALE_SRCS := tensorflow/lite/micro/tools/make/downloads/person_model_grayscale/person_detect_model_data.cc
14- person_detection_SRCS := $(filter-out $(GRAYSCALE_SRCS ) , $(person_detection_SRCS ) )
15- MICROLITE_CC_SRCS += $(GRAYSCALE_SRCS )
11+
12+ # ESP specific flags and files
13+ CCFLAGS += -Wno-nonnull
14+ CXXFLAGS += -Wno-return-type -Wno-strict-aliasing
15+ ESP_PROJECT_FILES += \
16+ sdkconfig.defaults \
17+ main/Kconfig.projbuild
18+
19+ # Remap downloaded model files as if they were in tensorflow/lite/micro/examples/..
20+ MODEL_DOWNLOADS_DIR := tensorflow/lite/micro/tools/make/downloads/person_model_grayscale
21+ MODEL_EXAMPLES_DIR := tensorflow/lite/micro/examples/person_detection/person_model_grayscale
22+ person_detection_SRCS := $(patsubst $(MODEL_DOWNLOADS_DIR ) /% ,$(MODEL_EXAMPLES_DIR ) /% ,$(person_detection_SRCS ) )
23+
24+ # Custom rule to transform downloaded model files
25+ $(PRJDIR ) person_detection/esp-idf/main/person_model_grayscale/% : $(MODEL_DOWNLOADS_DIR ) /%
26+ @mkdir -p $(dir $@ )
27+ @python tensorflow/lite/micro/tools/make/transform_source.py \
28+ --platform =esp \
29+ --is_example_source \
30+ --source_path="$(patsubst $(MODEL_DOWNLOADS_DIR ) /% ,$(MODEL_EXAMPLES_DIR ) /% ,$< ) " \
31+ < $< > $@
File renamed without changes.
Original file line number Diff line number Diff line change @@ -293,6 +293,10 @@ $(PRJDIR)$(2)/esp-idf/LICENSE: LICENSE
293293 @mkdir -p $$(dir $$@)
294294 @cp $$< $$@
295295
296+ $(PRJDIR )$(2 )/esp -idf /%: tensorflow /lite /micro /examples /$(2 )/esp /%
297+ @mkdir -p $$(dir $$@)
298+ @cp $$< $$@
299+
296300$(PRJDIR )$(2 )/esp -idf /main /%. cc : tensorflow /lite /micro /examples /$(2 )/%. cc
297301 @mkdir -p $$(dir $$@)
298302 @python tensorflow /lite /micro /tools /make /transform_source . py \
@@ -309,6 +313,14 @@ $(PRJDIR)$(2)/esp-idf/main/%.h: tensorflow/lite/micro/examples/$(2)/%.h
309313 --source_path = "$$<" \
310314 < $$< > $$@
311315
316+ $(PRJDIR )$(2 )/esp -idf /main /%. h : tensorflow /lite /micro /examples /$(2 )/%. h
317+ @mkdir -p $$(dir $$@)
318+ @python tensorflow /lite /micro /tools /make /transform_source . py \
319+ --platform = esp \
320+ --is_example_source \
321+ --source_path = "$$<" \
322+ < $$< > $$@
323+
312324$(PRJDIR )$(2 )/esp -idf /main /%: tensorflow /lite /micro /examples /$(2 )/%
313325 @mkdir -p $$(dir $$@)
314326 @cp $$< $$@
You can’t perform that action at this time.
0 commit comments