├── CONTRIBUTE.md ├── FAQ.md ├── LICENSE.md ├── README.md ├── documentation ├── README.md └── docker-guide │ ├── README.md │ ├── build.md │ └── setup.md ├── giveaways ├── README.md └── remoticon2020 │ └── README.md ├── poc ├── README.md └── TEMPLATE.md └── projects ├── README.md ├── intruder_detection ├── LICENSE ├── README.md ├── main.py ├── main_functions.cpp ├── pico.png ├── rpi4.py └── startup_script.py ├── multi_domain_pico ├── .gitignore ├── CMakeLists.txt ├── Dockerfile ├── LICENSE ├── Makefile ├── bin │ ├── mult_domain.uf2 │ └── single_core.uf2 ├── imgs │ ├── A-multiple-neural-networks.png │ ├── pico-board3.png │ └── screen-screenshot.png ├── mult_domain │ ├── CMakeLists.txt │ ├── audio_model.cc │ ├── audio_model.h │ ├── audio_model.tflite │ ├── main.cc │ ├── main_functions.cc │ ├── main_functions.h │ ├── tensorflow │ │ ├── core │ │ │ └── public │ │ │ │ └── version.h │ │ └── lite │ │ │ ├── c │ │ │ ├── builtin_op_data.h │ │ │ ├── c_api_types.h │ │ │ ├── common.c │ │ │ └── common.h │ │ │ ├── core │ │ │ └── api │ │ │ │ ├── error_reporter.cc │ │ │ │ ├── error_reporter.h │ │ │ │ ├── flatbuffer_conversions.cc │ │ │ │ ├── flatbuffer_conversions.h │ │ │ │ ├── op_resolver.cc │ │ │ │ ├── op_resolver.h │ │ │ │ ├── tensor_utils.cc │ │ │ │ └── tensor_utils.h │ │ │ ├── kernels │ │ │ ├── internal │ │ │ │ ├── common.h │ │ │ │ ├── compatibility.h │ │ │ │ ├── cppmath.h │ │ │ │ ├── max.h │ │ │ │ ├── min.h │ │ │ │ ├── optimized │ │ │ │ │ └── neon_check.h │ │ │ │ ├── portable_tensor.h │ │ │ │ ├── quantization_util.cc │ │ │ │ ├── quantization_util.h │ │ │ │ ├── reference │ │ │ │ │ ├── add.h │ │ │ │ │ ├── arg_min_max.h │ │ │ │ │ ├── batch_to_space_nd.h │ │ │ │ │ ├── binary_function.h │ │ │ │ │ ├── ceil.h │ │ │ │ │ ├── comparisons.h │ │ │ │ │ ├── concatenation.h │ │ │ │ │ ├── conv.h │ │ │ │ │ ├── depthwiseconv_float.h │ │ │ │ │ ├── depthwiseconv_uint8.h │ │ │ │ │ ├── dequantize.h │ │ │ │ │ ├── exp.h │ │ │ │ │ ├── floor.h │ │ │ │ │ ├── fully_connected.h │ │ │ │ │ ├── hard_swish.h │ │ │ │ │ ├── integer_ops │ │ │ │ │ │ ├── add.h │ │ │ │ │ │ ├── conv.h │ │ │ │ │ │ ├── depthwise_conv.h │ │ │ │ │ │ ├── fully_connected.h │ │ │ │ │ │ ├── l2normalization.h │ │ │ │ │ │ ├── logistic.h │ │ │ │ │ │ ├── mean.h │ │ │ │ │ │ ├── mul.h │ │ │ │ │ │ ├── pooling.h │ │ │ │ │ │ ├── tanh.h │ │ │ │ │ │ └── transpose_conv.h │ │ │ │ │ ├── l2normalization.h │ │ │ │ │ ├── logistic.h │ │ │ │ │ ├── maximum_minimum.h │ │ │ │ │ ├── mul.h │ │ │ │ │ ├── neg.h │ │ │ │ │ ├── pad.h │ │ │ │ │ ├── pooling.h │ │ │ │ │ ├── prelu.h │ │ │ │ │ ├── process_broadcast_shapes.h │ │ │ │ │ ├── quantize.h │ │ │ │ │ ├── reduce.h │ │ │ │ │ ├── requantize.h │ │ │ │ │ ├── resize_nearest_neighbor.h │ │ │ │ │ ├── round.h │ │ │ │ │ ├── softmax.h │ │ │ │ │ ├── space_to_batch_nd.h │ │ │ │ │ ├── strided_slice.h │ │ │ │ │ ├── sub.h │ │ │ │ │ ├── tanh.h │ │ │ │ │ └── transpose_conv.h │ │ │ │ ├── strided_slice_logic.h │ │ │ │ ├── tensor_ctypes.h │ │ │ │ └── types.h │ │ │ ├── kernel_util.cc │ │ │ ├── kernel_util.h │ │ │ ├── op_macros.h │ │ │ └── padding.h │ │ │ ├── micro │ │ │ ├── all_ops_resolver.cc │ │ │ ├── all_ops_resolver.h │ │ │ ├── benchmarks │ │ │ │ └── keyword_scrambled_model_data.h │ │ │ ├── compatibility.h │ │ │ ├── debug_log.cc │ │ │ ├── debug_log.h │ │ │ ├── kernels │ │ │ │ ├── activation_utils.h │ │ │ │ ├── activations.cc │ │ │ │ ├── arg_min_max.cc │ │ │ │ ├── batch_to_space_nd.cc │ │ │ │ ├── cast.cc │ │ │ │ ├── ceil.cc │ │ │ │ ├── circular_buffer.cc │ │ │ │ ├── cmsis_nn │ │ │ │ │ ├── add.cc │ │ │ │ │ ├── conv.cc │ │ │ │ │ ├── depthwise_conv.cc │ │ │ │ │ ├── fully_connected.cc │ │ │ │ │ ├── mul.cc │ │ │ │ │ ├── pooling.cc │ │ │ │ │ ├── softmax.cc │ │ │ │ │ └── svdf.cc │ │ │ │ ├── comparisons.cc │ │ │ │ ├── concatenation.cc │ │ │ │ ├── conv_test.h │ │ │ │ ├── conv_test_common.cc │ │ │ │ ├── dequantize.cc │ │ │ │ ├── detection_postprocess.cc │ │ │ │ ├── elementwise.cc │ │ │ │ ├── ethosu.cc │ │ │ │ ├── ethosu.h │ │ │ │ ├── exp.cc │ │ │ │ ├── flexbuffers_generated_data.cc │ │ │ │ ├── flexbuffers_generated_data.h │ │ │ │ ├── floor.cc │ │ │ │ ├── fully_connected.h │ │ │ │ ├── fully_connected_common.cc │ │ │ │ ├── hard_swish.cc │ │ │ │ ├── kernel_runner.cc │ │ │ │ ├── kernel_runner.h │ │ │ │ ├── kernel_util.cc │ │ │ │ ├── kernel_util.h │ │ │ │ ├── l2norm.cc │ │ │ │ ├── logical.cc │ │ │ │ ├── logistic.cc │ │ │ │ ├── maximum_minimum.cc │ │ │ │ ├── micro_ops.h │ │ │ │ ├── micro_utils.h │ │ │ │ ├── neg.cc │ │ │ │ ├── pack.cc │ │ │ │ ├── pad.cc │ │ │ │ ├── prelu.cc │ │ │ │ ├── quantize.cc │ │ │ │ ├── quantize.h │ │ │ │ ├── quantize_common.cc │ │ │ │ ├── reduce.cc │ │ │ │ ├── reshape.cc │ │ │ │ ├── resize_nearest_neighbor.cc │ │ │ │ ├── round.cc │ │ │ │ ├── shape.cc │ │ │ │ ├── softmax.h │ │ │ │ ├── softmax_common.cc │ │ │ │ ├── space_to_batch_nd.cc │ │ │ │ ├── split.cc │ │ │ │ ├── split_v.cc │ │ │ │ ├── strided_slice.cc │ │ │ │ ├── sub.cc │ │ │ │ ├── svdf.h │ │ │ │ ├── svdf_common.cc │ │ │ │ ├── tanh.cc │ │ │ │ ├── transpose_conv.cc │ │ │ │ ├── unpack.cc │ │ │ │ └── zeros_like.cc │ │ │ ├── memory_helpers.cc │ │ │ ├── memory_helpers.h │ │ │ ├── memory_planner │ │ │ │ ├── greedy_memory_planner.cc │ │ │ │ ├── greedy_memory_planner.h │ │ │ │ ├── linear_memory_planner.cc │ │ │ │ ├── linear_memory_planner.h │ │ │ │ └── memory_planner.h │ │ │ ├── micro_allocator.cc │ │ │ ├── micro_allocator.h │ │ │ ├── micro_error_reporter.cc │ │ │ ├── micro_error_reporter.h │ │ │ ├── micro_interpreter.cc │ │ │ ├── micro_interpreter.h │ │ │ ├── micro_mutable_op_resolver.h │ │ │ ├── micro_op_resolver.h │ │ │ ├── micro_profiler.cc │ │ │ ├── micro_profiler.h │ │ │ ├── micro_string.cc │ │ │ ├── micro_string.h │ │ │ ├── micro_time.cc │ │ │ ├── micro_time.h │ │ │ ├── micro_utils.cc │ │ │ ├── micro_utils.h │ │ │ ├── recording_micro_allocator.cc │ │ │ ├── recording_micro_allocator.h │ │ │ ├── recording_micro_interpreter.h │ │ │ ├── recording_simple_memory_allocator.cc │ │ │ ├── recording_simple_memory_allocator.h │ │ │ ├── simple_memory_allocator.cc │ │ │ ├── simple_memory_allocator.h │ │ │ ├── system_setup.cc │ │ │ ├── system_setup.h │ │ │ ├── test_helpers.cc │ │ │ ├── test_helpers.h │ │ │ └── testing │ │ │ │ ├── micro_test.h │ │ │ │ └── test_conv_model.h │ │ │ ├── portable_type_to_tflitetype.h │ │ │ ├── schema │ │ │ ├── schema_generated.h │ │ │ ├── schema_utils.cc │ │ │ └── schema_utils.h │ │ │ ├── string_type.h │ │ │ ├── string_util.h │ │ │ ├── type_to_tflitetype.h │ │ │ └── version.h │ ├── test.cc │ ├── test_audio_model.cc │ ├── test_image_model.cc │ ├── third_party │ │ ├── cmsis │ │ │ ├── CMSIS │ │ │ │ ├── Core │ │ │ │ │ └── Include │ │ │ │ │ │ ├── cmsis_armclang.h │ │ │ │ │ │ ├── cmsis_compiler.h │ │ │ │ │ │ └── cmsis_gcc.h │ │ │ │ ├── DSP │ │ │ │ │ └── Include │ │ │ │ │ │ ├── arm_common_tables.h │ │ │ │ │ │ ├── arm_helium_utils.h │ │ │ │ │ │ ├── arm_math.h │ │ │ │ │ │ ├── arm_math_memory.h │ │ │ │ │ │ ├── arm_math_types.h │ │ │ │ │ │ └── dsp │ │ │ │ │ │ ├── basic_math_functions.h │ │ │ │ │ │ ├── bayes_functions.h │ │ │ │ │ │ ├── complex_math_functions.h │ │ │ │ │ │ ├── controller_functions.h │ │ │ │ │ │ ├── distance_functions.h │ │ │ │ │ │ ├── fast_math_functions.h │ │ │ │ │ │ ├── filtering_functions.h │ │ │ │ │ │ ├── interpolation_functions.h │ │ │ │ │ │ ├── matrix_functions.h │ │ │ │ │ │ ├── none.h │ │ │ │ │ │ ├── statistics_functions.h │ │ │ │ │ │ ├── support_functions.h │ │ │ │ │ │ ├── svm_defines.h │ │ │ │ │ │ ├── svm_functions.h │ │ │ │ │ │ ├── transform_functions.h │ │ │ │ │ │ └── utils.h │ │ │ │ └── NN │ │ │ │ │ ├── Include │ │ │ │ │ ├── arm_nn_tables.h │ │ │ │ │ ├── arm_nn_types.h │ │ │ │ │ ├── arm_nnfunctions.h │ │ │ │ │ └── arm_nnsupportfunctions.h │ │ │ │ │ └── Source │ │ │ │ │ ├── ActivationFunctions │ │ │ │ │ ├── arm_nn_activations_q15.c │ │ │ │ │ ├── arm_nn_activations_q7.c │ │ │ │ │ ├── arm_relu6_s8.c │ │ │ │ │ ├── arm_relu_q15.c │ │ │ │ │ └── arm_relu_q7.c │ │ │ │ │ ├── BasicMathFunctions │ │ │ │ │ ├── arm_elementwise_add_s8.c │ │ │ │ │ └── arm_elementwise_mul_s8.c │ │ │ │ │ ├── ConcatenationFunctions │ │ │ │ │ ├── arm_concatenation_s8_w.c │ │ │ │ │ ├── arm_concatenation_s8_x.c │ │ │ │ │ ├── arm_concatenation_s8_y.c │ │ │ │ │ └── arm_concatenation_s8_z.c │ │ │ │ │ ├── ConvolutionFunctions │ │ │ │ │ ├── arm_convolve_1_x_n_s8.c │ │ │ │ │ ├── arm_convolve_1x1_HWC_q7_fast_nonsquare.c │ │ │ │ │ ├── arm_convolve_1x1_s8_fast.c │ │ │ │ │ ├── arm_convolve_HWC_q15_basic.c │ │ │ │ │ ├── arm_convolve_HWC_q15_fast.c │ │ │ │ │ ├── arm_convolve_HWC_q15_fast_nonsquare.c │ │ │ │ │ ├── arm_convolve_HWC_q7_RGB.c │ │ │ │ │ ├── arm_convolve_HWC_q7_basic.c │ │ │ │ │ ├── arm_convolve_HWC_q7_basic_nonsquare.c │ │ │ │ │ ├── arm_convolve_HWC_q7_fast.c │ │ │ │ │ ├── arm_convolve_HWC_q7_fast_nonsquare.c │ │ │ │ │ ├── arm_convolve_s8.c │ │ │ │ │ ├── arm_convolve_wrapper_s8.c │ │ │ │ │ ├── arm_depthwise_conv_3x3_s8.c │ │ │ │ │ ├── arm_depthwise_conv_s8.c │ │ │ │ │ ├── arm_depthwise_conv_s8_opt.c │ │ │ │ │ ├── arm_depthwise_conv_u8_basic_ver1.c │ │ │ │ │ ├── arm_depthwise_conv_wrapper_s8.c │ │ │ │ │ ├── arm_depthwise_separable_conv_HWC_q7.c │ │ │ │ │ ├── arm_depthwise_separable_conv_HWC_q7_nonsquare.c │ │ │ │ │ ├── arm_nn_depthwise_conv_s8_core.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_q7_q15.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_q7_q15_reordered.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_s8_s16.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_s8_s16_reordered.c │ │ │ │ │ └── arm_nn_mat_mult_s8.c │ │ │ │ │ ├── FullyConnectedFunctions │ │ │ │ │ ├── arm_fully_connected_mat_q7_vec_q15.c │ │ │ │ │ ├── arm_fully_connected_mat_q7_vec_q15_opt.c │ │ │ │ │ ├── arm_fully_connected_q15.c │ │ │ │ │ ├── arm_fully_connected_q15_opt.c │ │ │ │ │ ├── arm_fully_connected_q7.c │ │ │ │ │ ├── arm_fully_connected_q7_opt.c │ │ │ │ │ └── arm_fully_connected_s8.c │ │ │ │ │ ├── NNSupportFunctions │ │ │ │ │ ├── arm_nn_accumulate_q7_to_q15.c │ │ │ │ │ ├── arm_nn_add_q7.c │ │ │ │ │ ├── arm_nn_depthwise_conv_nt_t_padded_s8.c │ │ │ │ │ ├── arm_nn_depthwise_conv_nt_t_s8.c │ │ │ │ │ ├── arm_nn_mat_mul_core_1x_s8.c │ │ │ │ │ ├── arm_nn_mat_mul_core_4x_s8.c │ │ │ │ │ ├── arm_nn_mat_mult_nt_t_s8.c │ │ │ │ │ ├── arm_nn_mult_q15.c │ │ │ │ │ ├── arm_nn_mult_q7.c │ │ │ │ │ ├── arm_nn_vec_mat_mult_t_s8.c │ │ │ │ │ ├── arm_nntables.c │ │ │ │ │ ├── arm_q7_to_q15_no_shift.c │ │ │ │ │ ├── arm_q7_to_q15_reordered_no_shift.c │ │ │ │ │ ├── arm_q7_to_q15_reordered_with_offset.c │ │ │ │ │ └── arm_q7_to_q15_with_offset.c │ │ │ │ │ ├── PoolingFunctions │ │ │ │ │ ├── arm_avgpool_s8.c │ │ │ │ │ ├── arm_max_pool_s8.c │ │ │ │ │ └── arm_pool_q7_HWC.c │ │ │ │ │ ├── ReshapeFunctions │ │ │ │ │ └── arm_reshape_s8.c │ │ │ │ │ ├── SVDFunctions │ │ │ │ │ └── arm_svdf_s8.c │ │ │ │ │ └── SoftmaxFunctions │ │ │ │ │ ├── arm_softmax_q15.c │ │ │ │ │ ├── arm_softmax_q7.c │ │ │ │ │ ├── arm_softmax_s8.c │ │ │ │ │ ├── arm_softmax_u8.c │ │ │ │ │ └── arm_softmax_with_batch_q7.c │ │ │ ├── LICENSE.txt │ │ │ └── README.md │ │ ├── flatbuffers │ │ │ ├── LICENSE.txt │ │ │ └── include │ │ │ │ └── flatbuffers │ │ │ │ ├── base.h │ │ │ │ ├── flatbuffers.h │ │ │ │ ├── flexbuffers.h │ │ │ │ ├── stl_emulation.h │ │ │ │ └── util.h │ │ ├── gemmlowp │ │ │ ├── LICENSE │ │ │ ├── fixedpoint │ │ │ │ ├── fixedpoint.h │ │ │ │ ├── fixedpoint_neon.h │ │ │ │ └── fixedpoint_sse.h │ │ │ └── internal │ │ │ │ └── detect_platform.h │ │ ├── kissfft │ │ │ ├── COPYING │ │ │ ├── _kiss_fft_guts.h │ │ │ ├── kiss_fft.h │ │ │ └── tools │ │ │ │ └── kiss_fftr.h │ │ └── ruy │ │ │ └── ruy │ │ │ └── profiler │ │ │ └── instrumentation.h │ ├── video_model.cc │ ├── video_model.h │ ├── video_model.tflite │ ├── video_model_mobilenet.cc │ ├── video_model_mobilenet.h │ ├── video_model_mobilenet.tflite │ ├── video_model_mobilenet_new.tflite │ ├── video_model_mobilenet_old.tflite │ ├── x_test_audio1.cc │ ├── x_test_audio1.h │ ├── x_test_audio2.cc │ ├── x_test_audio2.h │ ├── x_test_video1.cc │ ├── x_test_video1.h │ ├── x_test_video2.cc │ └── x_test_video2.h ├── pico_sdk_import.cmake ├── readme.md ├── single_core │ ├── CMakeLists.txt │ ├── audio_model.cc │ ├── audio_model.h │ ├── audio_model.tflite │ ├── main.cc │ ├── main_functions.cc │ ├── main_functions.h │ ├── tensorflow │ │ ├── core │ │ │ └── public │ │ │ │ └── version.h │ │ └── lite │ │ │ ├── c │ │ │ ├── builtin_op_data.h │ │ │ ├── c_api_types.h │ │ │ ├── common.c │ │ │ └── common.h │ │ │ ├── core │ │ │ └── api │ │ │ │ ├── error_reporter.cc │ │ │ │ ├── error_reporter.h │ │ │ │ ├── flatbuffer_conversions.cc │ │ │ │ ├── flatbuffer_conversions.h │ │ │ │ ├── op_resolver.cc │ │ │ │ ├── op_resolver.h │ │ │ │ ├── tensor_utils.cc │ │ │ │ └── tensor_utils.h │ │ │ ├── kernels │ │ │ ├── internal │ │ │ │ ├── common.h │ │ │ │ ├── compatibility.h │ │ │ │ ├── cppmath.h │ │ │ │ ├── max.h │ │ │ │ ├── min.h │ │ │ │ ├── optimized │ │ │ │ │ └── neon_check.h │ │ │ │ ├── portable_tensor.h │ │ │ │ ├── quantization_util.cc │ │ │ │ ├── quantization_util.h │ │ │ │ ├── reference │ │ │ │ │ ├── add.h │ │ │ │ │ ├── arg_min_max.h │ │ │ │ │ ├── batch_to_space_nd.h │ │ │ │ │ ├── binary_function.h │ │ │ │ │ ├── ceil.h │ │ │ │ │ ├── comparisons.h │ │ │ │ │ ├── concatenation.h │ │ │ │ │ ├── conv.h │ │ │ │ │ ├── depthwiseconv_float.h │ │ │ │ │ ├── depthwiseconv_uint8.h │ │ │ │ │ ├── dequantize.h │ │ │ │ │ ├── exp.h │ │ │ │ │ ├── floor.h │ │ │ │ │ ├── fully_connected.h │ │ │ │ │ ├── hard_swish.h │ │ │ │ │ ├── integer_ops │ │ │ │ │ │ ├── add.h │ │ │ │ │ │ ├── conv.h │ │ │ │ │ │ ├── depthwise_conv.h │ │ │ │ │ │ ├── fully_connected.h │ │ │ │ │ │ ├── l2normalization.h │ │ │ │ │ │ ├── logistic.h │ │ │ │ │ │ ├── mean.h │ │ │ │ │ │ ├── mul.h │ │ │ │ │ │ ├── pooling.h │ │ │ │ │ │ ├── tanh.h │ │ │ │ │ │ └── transpose_conv.h │ │ │ │ │ ├── l2normalization.h │ │ │ │ │ ├── logistic.h │ │ │ │ │ ├── maximum_minimum.h │ │ │ │ │ ├── mul.h │ │ │ │ │ ├── neg.h │ │ │ │ │ ├── pad.h │ │ │ │ │ ├── pooling.h │ │ │ │ │ ├── prelu.h │ │ │ │ │ ├── process_broadcast_shapes.h │ │ │ │ │ ├── quantize.h │ │ │ │ │ ├── reduce.h │ │ │ │ │ ├── requantize.h │ │ │ │ │ ├── resize_nearest_neighbor.h │ │ │ │ │ ├── round.h │ │ │ │ │ ├── softmax.h │ │ │ │ │ ├── space_to_batch_nd.h │ │ │ │ │ ├── strided_slice.h │ │ │ │ │ ├── sub.h │ │ │ │ │ ├── tanh.h │ │ │ │ │ └── transpose_conv.h │ │ │ │ ├── strided_slice_logic.h │ │ │ │ ├── tensor_ctypes.h │ │ │ │ └── types.h │ │ │ ├── kernel_util.cc │ │ │ ├── kernel_util.h │ │ │ ├── op_macros.h │ │ │ └── padding.h │ │ │ ├── micro │ │ │ ├── all_ops_resolver.cc │ │ │ ├── all_ops_resolver.h │ │ │ ├── benchmarks │ │ │ │ └── keyword_scrambled_model_data.h │ │ │ ├── compatibility.h │ │ │ ├── debug_log.cc │ │ │ ├── debug_log.h │ │ │ ├── kernels │ │ │ │ ├── activation_utils.h │ │ │ │ ├── activations.cc │ │ │ │ ├── arg_min_max.cc │ │ │ │ ├── batch_to_space_nd.cc │ │ │ │ ├── cast.cc │ │ │ │ ├── ceil.cc │ │ │ │ ├── circular_buffer.cc │ │ │ │ ├── cmsis_nn │ │ │ │ │ ├── add.cc │ │ │ │ │ ├── conv.cc │ │ │ │ │ ├── depthwise_conv.cc │ │ │ │ │ ├── fully_connected.cc │ │ │ │ │ ├── mul.cc │ │ │ │ │ ├── pooling.cc │ │ │ │ │ ├── softmax.cc │ │ │ │ │ └── svdf.cc │ │ │ │ ├── comparisons.cc │ │ │ │ ├── concatenation.cc │ │ │ │ ├── conv_test.h │ │ │ │ ├── conv_test_common.cc │ │ │ │ ├── dequantize.cc │ │ │ │ ├── detection_postprocess.cc │ │ │ │ ├── elementwise.cc │ │ │ │ ├── ethosu.cc │ │ │ │ ├── ethosu.h │ │ │ │ ├── exp.cc │ │ │ │ ├── flexbuffers_generated_data.cc │ │ │ │ ├── flexbuffers_generated_data.h │ │ │ │ ├── floor.cc │ │ │ │ ├── fully_connected.h │ │ │ │ ├── fully_connected_common.cc │ │ │ │ ├── hard_swish.cc │ │ │ │ ├── kernel_runner.cc │ │ │ │ ├── kernel_runner.h │ │ │ │ ├── kernel_util.cc │ │ │ │ ├── kernel_util.h │ │ │ │ ├── l2norm.cc │ │ │ │ ├── logical.cc │ │ │ │ ├── logistic.cc │ │ │ │ ├── maximum_minimum.cc │ │ │ │ ├── micro_ops.h │ │ │ │ ├── micro_utils.h │ │ │ │ ├── neg.cc │ │ │ │ ├── pack.cc │ │ │ │ ├── pad.cc │ │ │ │ ├── prelu.cc │ │ │ │ ├── quantize.cc │ │ │ │ ├── quantize.h │ │ │ │ ├── quantize_common.cc │ │ │ │ ├── reduce.cc │ │ │ │ ├── reshape.cc │ │ │ │ ├── resize_nearest_neighbor.cc │ │ │ │ ├── round.cc │ │ │ │ ├── shape.cc │ │ │ │ ├── softmax.h │ │ │ │ ├── softmax_common.cc │ │ │ │ ├── space_to_batch_nd.cc │ │ │ │ ├── split.cc │ │ │ │ ├── split_v.cc │ │ │ │ ├── strided_slice.cc │ │ │ │ ├── sub.cc │ │ │ │ ├── svdf.h │ │ │ │ ├── svdf_common.cc │ │ │ │ ├── tanh.cc │ │ │ │ ├── transpose_conv.cc │ │ │ │ ├── unpack.cc │ │ │ │ └── zeros_like.cc │ │ │ ├── memory_helpers.cc │ │ │ ├── memory_helpers.h │ │ │ ├── memory_planner │ │ │ │ ├── greedy_memory_planner.cc │ │ │ │ ├── greedy_memory_planner.h │ │ │ │ ├── linear_memory_planner.cc │ │ │ │ ├── linear_memory_planner.h │ │ │ │ └── memory_planner.h │ │ │ ├── micro_allocator.cc │ │ │ ├── micro_allocator.h │ │ │ ├── micro_error_reporter.cc │ │ │ ├── micro_error_reporter.h │ │ │ ├── micro_interpreter.cc │ │ │ ├── micro_interpreter.h │ │ │ ├── micro_mutable_op_resolver.h │ │ │ ├── micro_op_resolver.h │ │ │ ├── micro_profiler.cc │ │ │ ├── micro_profiler.h │ │ │ ├── micro_string.cc │ │ │ ├── micro_string.h │ │ │ ├── micro_time.cc │ │ │ ├── micro_time.h │ │ │ ├── micro_utils.cc │ │ │ ├── micro_utils.h │ │ │ ├── recording_micro_allocator.cc │ │ │ ├── recording_micro_allocator.h │ │ │ ├── recording_micro_interpreter.h │ │ │ ├── recording_simple_memory_allocator.cc │ │ │ ├── recording_simple_memory_allocator.h │ │ │ ├── simple_memory_allocator.cc │ │ │ ├── simple_memory_allocator.h │ │ │ ├── system_setup.cc │ │ │ ├── system_setup.h │ │ │ ├── test_helpers.cc │ │ │ ├── test_helpers.h │ │ │ └── testing │ │ │ │ ├── micro_test.h │ │ │ │ └── test_conv_model.h │ │ │ ├── portable_type_to_tflitetype.h │ │ │ ├── schema │ │ │ ├── schema_generated.h │ │ │ ├── schema_utils.cc │ │ │ └── schema_utils.h │ │ │ ├── string_type.h │ │ │ ├── string_util.h │ │ │ ├── type_to_tflitetype.h │ │ │ └── version.h │ ├── test.cc │ ├── test_audio_model.cc │ ├── test_image_model.cc │ ├── third_party │ │ ├── cmsis │ │ │ ├── CMSIS │ │ │ │ ├── Core │ │ │ │ │ └── Include │ │ │ │ │ │ ├── cmsis_armclang.h │ │ │ │ │ │ ├── cmsis_compiler.h │ │ │ │ │ │ └── cmsis_gcc.h │ │ │ │ ├── DSP │ │ │ │ │ └── Include │ │ │ │ │ │ ├── arm_common_tables.h │ │ │ │ │ │ ├── arm_helium_utils.h │ │ │ │ │ │ ├── arm_math.h │ │ │ │ │ │ ├── arm_math_memory.h │ │ │ │ │ │ ├── arm_math_types.h │ │ │ │ │ │ └── dsp │ │ │ │ │ │ ├── basic_math_functions.h │ │ │ │ │ │ ├── bayes_functions.h │ │ │ │ │ │ ├── complex_math_functions.h │ │ │ │ │ │ ├── controller_functions.h │ │ │ │ │ │ ├── distance_functions.h │ │ │ │ │ │ ├── fast_math_functions.h │ │ │ │ │ │ ├── filtering_functions.h │ │ │ │ │ │ ├── interpolation_functions.h │ │ │ │ │ │ ├── matrix_functions.h │ │ │ │ │ │ ├── none.h │ │ │ │ │ │ ├── statistics_functions.h │ │ │ │ │ │ ├── support_functions.h │ │ │ │ │ │ ├── svm_defines.h │ │ │ │ │ │ ├── svm_functions.h │ │ │ │ │ │ ├── transform_functions.h │ │ │ │ │ │ └── utils.h │ │ │ │ └── NN │ │ │ │ │ ├── Include │ │ │ │ │ ├── arm_nn_tables.h │ │ │ │ │ ├── arm_nn_types.h │ │ │ │ │ ├── arm_nnfunctions.h │ │ │ │ │ └── arm_nnsupportfunctions.h │ │ │ │ │ └── Source │ │ │ │ │ ├── ActivationFunctions │ │ │ │ │ ├── arm_nn_activations_q15.c │ │ │ │ │ ├── arm_nn_activations_q7.c │ │ │ │ │ ├── arm_relu6_s8.c │ │ │ │ │ ├── arm_relu_q15.c │ │ │ │ │ └── arm_relu_q7.c │ │ │ │ │ ├── BasicMathFunctions │ │ │ │ │ ├── arm_elementwise_add_s8.c │ │ │ │ │ └── arm_elementwise_mul_s8.c │ │ │ │ │ ├── ConcatenationFunctions │ │ │ │ │ ├── arm_concatenation_s8_w.c │ │ │ │ │ ├── arm_concatenation_s8_x.c │ │ │ │ │ ├── arm_concatenation_s8_y.c │ │ │ │ │ └── arm_concatenation_s8_z.c │ │ │ │ │ ├── ConvolutionFunctions │ │ │ │ │ ├── arm_convolve_1_x_n_s8.c │ │ │ │ │ ├── arm_convolve_1x1_HWC_q7_fast_nonsquare.c │ │ │ │ │ ├── arm_convolve_1x1_s8_fast.c │ │ │ │ │ ├── arm_convolve_HWC_q15_basic.c │ │ │ │ │ ├── arm_convolve_HWC_q15_fast.c │ │ │ │ │ ├── arm_convolve_HWC_q15_fast_nonsquare.c │ │ │ │ │ ├── arm_convolve_HWC_q7_RGB.c │ │ │ │ │ ├── arm_convolve_HWC_q7_basic.c │ │ │ │ │ ├── arm_convolve_HWC_q7_basic_nonsquare.c │ │ │ │ │ ├── arm_convolve_HWC_q7_fast.c │ │ │ │ │ ├── arm_convolve_HWC_q7_fast_nonsquare.c │ │ │ │ │ ├── arm_convolve_s8.c │ │ │ │ │ ├── arm_convolve_wrapper_s8.c │ │ │ │ │ ├── arm_depthwise_conv_3x3_s8.c │ │ │ │ │ ├── arm_depthwise_conv_s8.c │ │ │ │ │ ├── arm_depthwise_conv_s8_opt.c │ │ │ │ │ ├── arm_depthwise_conv_u8_basic_ver1.c │ │ │ │ │ ├── arm_depthwise_conv_wrapper_s8.c │ │ │ │ │ ├── arm_depthwise_separable_conv_HWC_q7.c │ │ │ │ │ ├── arm_depthwise_separable_conv_HWC_q7_nonsquare.c │ │ │ │ │ ├── arm_nn_depthwise_conv_s8_core.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_q7_q15.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_q7_q15_reordered.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_s8_s16.c │ │ │ │ │ ├── arm_nn_mat_mult_kernel_s8_s16_reordered.c │ │ │ │ │ └── arm_nn_mat_mult_s8.c │ │ │ │ │ ├── FullyConnectedFunctions │ │ │ │ │ ├── arm_fully_connected_mat_q7_vec_q15.c │ │ │ │ │ ├── arm_fully_connected_mat_q7_vec_q15_opt.c │ │ │ │ │ ├── arm_fully_connected_q15.c │ │ │ │ │ ├── arm_fully_connected_q15_opt.c │ │ │ │ │ ├── arm_fully_connected_q7.c │ │ │ │ │ ├── arm_fully_connected_q7_opt.c │ │ │ │ │ └── arm_fully_connected_s8.c │ │ │ │ │ ├── NNSupportFunctions │ │ │ │ │ ├── arm_nn_accumulate_q7_to_q15.c │ │ │ │ │ ├── arm_nn_add_q7.c │ │ │ │ │ ├── arm_nn_depthwise_conv_nt_t_padded_s8.c │ │ │ │ │ ├── arm_nn_depthwise_conv_nt_t_s8.c │ │ │ │ │ ├── arm_nn_mat_mul_core_1x_s8.c │ │ │ │ │ ├── arm_nn_mat_mul_core_4x_s8.c │ │ │ │ │ ├── arm_nn_mat_mult_nt_t_s8.c │ │ │ │ │ ├── arm_nn_mult_q15.c │ │ │ │ │ ├── arm_nn_mult_q7.c │ │ │ │ │ ├── arm_nn_vec_mat_mult_t_s8.c │ │ │ │ │ ├── arm_nntables.c │ │ │ │ │ ├── arm_q7_to_q15_no_shift.c │ │ │ │ │ ├── arm_q7_to_q15_reordered_no_shift.c │ │ │ │ │ ├── arm_q7_to_q15_reordered_with_offset.c │ │ │ │ │ └── arm_q7_to_q15_with_offset.c │ │ │ │ │ ├── PoolingFunctions │ │ │ │ │ ├── arm_avgpool_s8.c │ │ │ │ │ ├── arm_max_pool_s8.c │ │ │ │ │ └── arm_pool_q7_HWC.c │ │ │ │ │ ├── ReshapeFunctions │ │ │ │ │ └── arm_reshape_s8.c │ │ │ │ │ ├── SVDFunctions │ │ │ │ │ └── arm_svdf_s8.c │ │ │ │ │ └── SoftmaxFunctions │ │ │ │ │ ├── arm_softmax_q15.c │ │ │ │ │ ├── arm_softmax_q7.c │ │ │ │ │ ├── arm_softmax_s8.c │ │ │ │ │ ├── arm_softmax_u8.c │ │ │ │ │ └── arm_softmax_with_batch_q7.c │ │ │ ├── LICENSE.txt │ │ │ └── README.md │ │ ├── flatbuffers │ │ │ ├── LICENSE.txt │ │ │ └── include │ │ │ │ └── flatbuffers │ │ │ │ ├── base.h │ │ │ │ ├── flatbuffers.h │ │ │ │ ├── flexbuffers.h │ │ │ │ ├── stl_emulation.h │ │ │ │ └── util.h │ │ ├── gemmlowp │ │ │ ├── LICENSE │ │ │ ├── fixedpoint │ │ │ │ ├── fixedpoint.h │ │ │ │ ├── fixedpoint_neon.h │ │ │ │ └── fixedpoint_sse.h │ │ │ └── internal │ │ │ │ └── detect_platform.h │ │ ├── kissfft │ │ │ ├── COPYING │ │ │ ├── _kiss_fft_guts.h │ │ │ ├── kiss_fft.h │ │ │ └── tools │ │ │ │ └── kiss_fftr.h │ │ └── ruy │ │ │ └── ruy │ │ │ └── profiler │ │ │ └── instrumentation.h │ ├── video_model.cc │ ├── video_model.h │ ├── video_model.tflite │ ├── video_model_mobilenet.cc │ ├── video_model_mobilenet.h │ ├── video_model_mobilenet.tflite │ ├── video_model_mobilenet_new.tflite │ ├── video_model_mobilenet_old.tflite │ ├── x_test_audio1.cc │ ├── x_test_audio1.h │ ├── x_test_audio2.cc │ ├── x_test_audio2.h │ ├── x_test_video1.cc │ ├── x_test_video1.h │ ├── x_test_video2.cc │ └── x_test_video2.h └── training │ ├── audio_train.ipynb │ └── video_train.ipynb ├── pico ├── .DS_Store ├── README.md ├── _config.yml ├── deployment │ ├── README.md │ ├── objects │ │ ├── .ipynb_checkpoints │ │ │ ├── Untitled-checkpoint.ipynb │ │ │ ├── aws_objects-checkpoint.ipynb │ │ │ ├── consumer-checkpoint.ipynb │ │ │ ├── image_processor-checkpoint.ipynb │ │ │ └── producer_camera-checkpoint.ipynb │ │ ├── Dockerfile │ │ ├── Untitled.ipynb │ │ ├── aws_objects.ipynb │ │ ├── consumer.ipynb │ │ ├── consumer.py │ │ ├── image-processor.json │ │ ├── image_processor.ipynb │ │ ├── image_processor.json │ │ ├── image_processor.py │ │ ├── person.jpg │ │ ├── pet.jpg │ │ ├── pico-consumer.sh │ │ ├── producer_camera.ipynb │ │ ├── producer_camera.py │ │ ├── producer_camera1.py │ │ ├── rasp_cluster.jpg │ │ └── templates │ │ │ └── index.html │ ├── plates │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── plates-consumer.py │ │ └── plates-producer.py │ └── raspbi │ │ ├── Dockerfile │ │ ├── README.md │ │ ├── consumer.py │ │ ├── producer.py │ │ └── templates │ │ └── index.html ├── docs │ └── README.md ├── getting-started │ └── README.md ├── images │ ├── README.md │ ├── Screenshot 2020-08-20 at 6.33.02 PM.png │ ├── Screenshot 2020-08-20 at 6.33.37 PM.png │ ├── arch_pico.png │ ├── image-9.png │ ├── install1.png │ ├── install2.png │ ├── install3.png │ ├── install4.png │ ├── install5.png │ ├── install6.png │ ├── install8.png │ ├── pibox.png │ ├── pibox3.png │ ├── picbox2.png │ ├── pico-project-arch.png │ ├── pico2.png │ ├── pico_in_3_steps.png │ ├── rasp_cluster.jpg │ └── thepicoproject1.png ├── kafka │ ├── README.md │ ├── aws │ │ └── credentials │ ├── bin │ │ └── debug.sh │ ├── config │ │ ├── AwsLambdaSinkConnector.properties │ │ ├── connect-avro-docker.properties │ │ └── connect-json-docker.properties │ ├── consumer.py │ ├── docker-compose.yml │ ├── kafka-common.env │ ├── producer-consumer.md │ ├── producer.py │ ├── src │ │ ├── main │ │ │ ├── assembly │ │ │ │ └── package.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── tm │ │ │ │ │ └── kafka │ │ │ │ │ └── connect │ │ │ │ │ └── aws │ │ │ │ │ └── lambda │ │ │ │ │ ├── AwsLambdaSinkConnector.java │ │ │ │ │ ├── AwsLambdaSinkConnectorConfig.java │ │ │ │ │ ├── AwsLambdaSinkTask.java │ │ │ │ │ ├── ConfigurationAWSCredentialsProvider.java │ │ │ │ │ ├── VersionUtil.java │ │ │ │ │ └── converter │ │ │ │ │ ├── DefaultPayloadConverter.java │ │ │ │ │ ├── JsonPayloadConverter.java │ │ │ │ │ └── SinkRecordToPayloadConverter.java │ │ │ └── resources │ │ │ │ └── logback.xml │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── tm │ │ │ │ └── kafka │ │ │ │ └── connect │ │ │ │ └── aws │ │ │ │ └── lambda │ │ │ │ ├── AwsLambdaSinkConnectorConfigTest.java │ │ │ │ ├── AwsLambdaSinkConnectorTest.java │ │ │ │ └── AwsLambdaSinkTaskTest.java │ │ │ └── resources │ │ │ └── logback.xml │ ├── templates │ │ └── index.html │ └── zk-common.env ├── lambda │ ├── README.md │ ├── Screen Shot 2019-07-01 at 3.31.58 PM.png │ ├── Screen Shot 2019-07-01 at 3.32.15 PM.png │ └── function.py ├── onprem │ └── yolo │ │ └── README.md ├── producer-rpi │ └── Dockerfile ├── raspbi │ ├── README.md │ ├── consumer-test.py │ ├── consumer.py │ └── producer.py ├── rtmp │ ├── Dockerfile │ ├── README.md │ ├── images │ │ ├── README.md │ │ └── pico2.0.jpeg │ └── nginx.conf ├── sample │ └── producer-consumer │ │ └── Dockerfile ├── testing │ ├── .ipynb_checkpoints │ │ ├── consumer-test-checkpoint.ipynb │ │ └── producer-test-checkpoint.ipynb │ ├── consumer-test.ipynb │ ├── producer-test.ipynb │ └── templates │ │ └── index.html └── workshop │ ├── README.md │ ├── images │ ├── README.md │ └── pico123.png │ ├── installing-docker.md │ ├── performing-object-detection.md │ ├── preparing-raspberrypi.md │ ├── running-consumer-script.md │ ├── running-kafka-on-swarm-cluster.md │ ├── running-producer-script-on-pi.md │ ├── setting-up-docker-swarm-on-aws.md │ └── turn-your-raspberrypi-into-camera.md ├── portenta_person_detection ├── .gitignore ├── README.md ├── image-server │ ├── .env │ ├── .gitignore │ ├── README.md │ ├── generate_image.js │ ├── main.py │ ├── requirements.txt │ ├── robots.txt │ ├── static │ │ └── site-images │ │ │ ├── Arm_logo_blue_150MD.png │ │ │ └── placeholder.png │ ├── templates │ │ └── viewer.html │ ├── test.raw │ └── wsgi.py └── person_detection │ ├── .gitignore │ ├── ImageCropper.cpp │ ├── ImageCropper.h │ ├── ImageScaler.cpp │ ├── ImageScaler.h │ ├── ImageSender.cpp │ ├── ImageSender.h │ ├── arduino_detection_responder.cpp │ ├── arduino_image_provider.cpp │ ├── cmake-build-debug │ └── CMakeFiles │ │ └── clion-log.txt │ ├── config.h.template │ ├── detection_responder.h │ ├── image_provider.h │ ├── main_functions.h │ ├── model_settings.cpp │ ├── model_settings.h │ ├── person_detect_model_data.cpp │ ├── person_detect_model_data.h │ └── person_detection.ino ├── python-wheels ├── README.md └── multi-platform.md ├── redis_benchmark ├── README.md ├── create_cluster.sh ├── download_bench_files.sh ├── redis_benchmark_cluster.tf ├── ssh_redis_memtier.sh ├── ssh_redis_server.sh └── terraform_variables.sh └── splunk_edge_demo ├── .gitignore ├── Arm_Splunk_Diagram.jpg ├── Partial_Dashboard.jpg ├── README.md ├── enterprise ├── README.md ├── ansible │ └── splunk_ent_setup.yml ├── splunk_apps │ └── edge_sensor_demo │ │ ├── appserver │ │ └── static │ │ │ ├── Arm_logo_blue_150MN.png │ │ │ ├── appLogo_allblack.png │ │ │ ├── appLogo_allwhite.png │ │ │ ├── appLogo_black.gif │ │ │ ├── appLogo_black.png │ │ │ ├── appLogo_white.gif │ │ │ ├── appLogo_white.png │ │ │ ├── application.css │ │ │ ├── bg_hash_grey.gif │ │ │ ├── loader.gif │ │ │ ├── overlay_bottomgradient_10.png │ │ │ ├── overlay_bottomgradient_18.png │ │ │ ├── overlay_bottomgradient_large.png │ │ │ ├── overlay_bottomgradient_soft.png │ │ │ ├── overlay_glass_28.png │ │ │ ├── overlay_gloss_28.png │ │ │ ├── overlay_gradient.png │ │ │ ├── overlay_gradient_25.png │ │ │ ├── overlay_gradient_28.png │ │ │ ├── overlay_gradient_4.png │ │ │ ├── overlay_gradient_50.png │ │ │ ├── overlay_innerleftshadow.png │ │ │ ├── overlay_innershadow_4.png │ │ │ ├── overlay_reversegradient_28.png │ │ │ ├── overlay_reversegradient_4.png │ │ │ ├── overlay_reversegradient_light_28.png │ │ │ ├── overlay_reversegradientridge_28.png │ │ │ ├── overlay_softgradient_28.png │ │ │ ├── overlay_togradient_large.png │ │ │ ├── overlay_topInnerShadow_35.png │ │ │ ├── overlay_topgradient.png │ │ │ ├── overlay_topgradient_beige_soft.png │ │ │ ├── overlay_topgradient_soft.png │ │ │ ├── overlay_white_28.png │ │ │ ├── overlay_whiteridge_28.png │ │ │ └── splIcons.gif │ │ ├── bin │ │ └── readme.txt │ │ ├── default │ │ ├── app.conf │ │ └── savedsearches.conf │ │ ├── local │ │ ├── app.conf │ │ ├── data │ │ │ └── ui │ │ │ │ ├── nav │ │ │ │ └── default.xml │ │ │ │ └── views │ │ │ │ └── edge_sensor_demo_dash.xml │ │ └── readme.txt │ │ └── metadata │ │ ├── default.meta │ │ └── local.meta ├── splunk_config │ └── web.conf ├── splunk_deployment_apps │ ├── edge_array_input │ │ └── default │ │ │ └── inputs.conf │ └── edge_array_output │ │ └── default │ │ └── outputs.conf ├── splunk_inputs │ └── inputs.conf ├── splunk_user │ └── user-seed.conf └── terraform │ └── tf-compute │ ├── compute.tf │ ├── network.tf │ ├── output.tf │ ├── provider.tf │ ├── security_groups.tf │ └── variables.tf ├── fwd ├── README.md ├── ansible │ ├── hosts │ └── splunk_fwd_setup.yml └── local │ ├── deploymentclient.conf │ └── user-seed.conf └── python ├── README.md ├── bme680.py ├── read_sensors.py └── tsl2591.py /FAQ.md: -------------------------------------------------------------------------------- 1 | FAQ 2 | === 3 | 4 | #### 1. What kind of projects can be submitted to this repo? 5 | Ans: Projects to be submitted should be of good quality and it can fall under 6 | categories (but not limited to) IoT, Infrastructure, Cloud Native, Edge, Automotive, Agriculture, Machine 7 | learning, AR/VR, Software Port, etc... 8 | 9 | #### 2. How can an author update the repository once their project is accepted? 10 | Ans: Projects/submissions to the repo should be updated with a pull request. 11 | 12 | #### 3. How can the author advertise the project after submitting? 13 | Ans: Authors can promote their projects in various areas across the Arm ecosystem. The first stop 14 | should be the [devEco Community Discord server](https://discord.gg/deveco). From this server, you can communicate with members from the 15 | Arm and/or Arm Innovator teams to schedule a spot on the [InnovatorCoffee livestream](https://www.youtube.com/playlist?list=PLKjl7IFAwc4QPapH-4Up8irlI8kDGZoOR) and various other outlets. 16 | 17 | #### 4. Can we submit raw binary? 18 | Ans: Strictly NO. But if there are cases where the author doesn't have access to the 19 | source code like shared libraries, firmware blob etc... they will be considered 20 | after discussion. But we do encourage authors to post relevant and open source code. 21 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # Licence 2 | 3 | Unless otherwise specified, everything in this repository is covered by the following licence: 4 | 5 | [![Creative Commons Licence](https://licensebuttons.net/l/by-sa/4.0/88x31.png)](https://creativecommons.org/licenses/by/4.0/deed.ast) 6 | 7 | **Arm Software Developer** by [Arm](https://www.arm.com/) is licensed under a [Creative Commons Attribution 4.0 International Licence](https://creativecommons.org/licenses/by/4.0/deed.ast). 8 | 9 | Based on a work at https://github.com/arm-software/developer 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Arm Software Developers 2 | 3 | Welcome to the official Arm Software Developers Github repository. This is a community oriented and run repository, which is maintained by Arm DERt (Developer Evangelist Roundtable) and Innovators from the Arm Innovator Program. This is the perfect place to host projects, proofs of concept, documentation, and more... 4 | 5 | ## How can I submit the project? 6 | 7 | Please refer the [Contributing](CONTRIBUTE.md) guide for submission guidelines. 8 | 9 | ## Want to know more? 10 | 11 | Please see [FAQ](FAQ.md). 12 | 13 | ## Recent contributions 14 | 15 | - [Build Python software to target multiple platforms](projects/python-wheels/multi-platform.md) 16 | - [The Pico Project](projects/pico/README.md) 17 | 18 | ## Contributors 19 | 20 | - Robert Wolff, Maintainer 21 | - Richard Henwood, Maintainer 22 | - Ajeet Raina, Contributor 23 | -------------------------------------------------------------------------------- /documentation/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /giveaways/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /poc/README.md: -------------------------------------------------------------------------------- 1 | # Proof of Concepts 2 | -------------------------------------------------------------------------------- /poc/TEMPLATE.md: -------------------------------------------------------------------------------- 1 | # TEMPLATE 2 | 3 | 4 | 5 | *** 6 | 7 | # Insert Project or PoC name here 8 | 9 | 10 | 11 | ## Table of Contents 12 | 13 | ## Table of Contents 14 | - [1) Hardware](#1-hardware) 15 | - [2) Software Setup](#2-software-setup) 16 | - [3) Hardware Setup](#3-hardware-setup) 17 | - [4) References and Resources](#4-references-and-resources) 18 | 19 | ## 1) Hardware 20 | 21 | ### 1.1) Hardware Requirements 22 | 23 | ## 2) Software Setup 24 | 25 | ## 3) Hardware Setup 26 | 27 | # 4) References and Resources 28 | -------------------------------------------------------------------------------- /projects/README.md: -------------------------------------------------------------------------------- 1 | # Projects 2 | 3 | 4 | -------------------------------------------------------------------------------- /projects/intruder_detection/main.py: -------------------------------------------------------------------------------- 1 | """ 2 | * Copyright (C) 2010-2021 Arm Limited or its affiliates. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | * 18 | * Project: Intruder Detection 19 | * Title: main.py 20 | * Description: Basic Pico script to turn on an LED if motion sensor is activated 21 | * 22 | * $Date: 09. Feb 2021 23 | * 24 | * Target Processor: RP2040 25 | * 26 | """ 27 | 28 | from machine import Pin, Timer 29 | 30 | def check_sensor(timer): 31 | global sensor 32 | if sensor.value() == 1: 33 | gp1.value(1) 34 | else: 35 | gp1.value(0) 36 | 37 | #GP4 - 5v output 38 | gp4 = Pin(4,Pin.OUT) 39 | gp4.value(1) 40 | #GP1 - output for LED 41 | gp1= Pin(1,Pin.OUT) 42 | #GP5 - input from sensor 43 | sensor = Pin(5,Pin.IN) 44 | tim = Timer() 45 | tim.init(freq=1.5, mode=Timer.PERIODIC, callback=check_sensor) 46 | -------------------------------------------------------------------------------- /projects/intruder_detection/pico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/intruder_detection/pico.png -------------------------------------------------------------------------------- /projects/multi_domain_pico/.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | pico-sdk 3 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | 3 | # Pull in PICO SDK (must be before project) 4 | include(pico_sdk_import.cmake) 5 | 6 | project(mult_domain C CXX ASM) 7 | set(CMAKE_C_STANDARD 11) 8 | set(CMAKE_CXX_STANDARD 17) 9 | 10 | # Initialize the SDK 11 | pico_sdk_init() 12 | 13 | # add the directory containing the code 14 | add_subdirectory(mult_domain) 15 | 16 | add_subdirectory(single_core) 17 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/bin/mult_domain.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/bin/mult_domain.uf2 -------------------------------------------------------------------------------- /projects/multi_domain_pico/bin/single_core.uf2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/bin/single_core.uf2 -------------------------------------------------------------------------------- /projects/multi_domain_pico/imgs/A-multiple-neural-networks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/imgs/A-multiple-neural-networks.png -------------------------------------------------------------------------------- /projects/multi_domain_pico/imgs/pico-board3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/imgs/pico-board3.png -------------------------------------------------------------------------------- /projects/multi_domain_pico/imgs/screen-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/imgs/screen-screenshot.png -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/audio_model.h: -------------------------------------------------------------------------------- 1 | #ifndef AUDIO_MODEL_H_ 2 | #define AUDIO_MODEL_H_ 3 | 4 | extern unsigned char audio_model_tflite[]; 5 | extern unsigned int audio_model_tflite_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/audio_model.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/mult_domain/audio_model.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/main_functions.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_FUNCTIONS_H_ 2 | #define MAIN_FUNCTIONS_H_ 3 | // Expose a C friendly interface for main functions. 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | // Initializes all data needed for the example. The name is important, and needs 9 | // to be setup() for Arduino compatibility. 10 | void audio_setup(); 11 | void video_setup(); 12 | void run_video_model(unsigned int i); 13 | void run_audio_model(unsigned int i); 14 | void handle_output(unsigned int i, int audio_score); 15 | //void run_audio_model(); 16 | //void run_video_model(); 17 | // Runs one iteration of data gathering and inference. This should be called 18 | // repeatedly from the application code. The name needs to be loop() for Arduino 19 | // compatibility. 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/core/api/error_reporter.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #include "tensorflow/lite/core/api/error_reporter.h" 16 | #include 17 | 18 | namespace tflite { 19 | 20 | int ErrorReporter::Report(const char* format, ...) { 21 | va_list args; 22 | va_start(args, format); 23 | int code = Report(format, args); 24 | va_end(args); 25 | return code; 26 | } 27 | 28 | // TODO(aselle): Make the name of ReportError on context the same, so 29 | // we can use the ensure functions w/o a context and w/ a reporter. 30 | int ErrorReporter::ReportError(void*, const char* format, ...) { 31 | va_list args; 32 | va_start(args, format); 33 | int code = Report(format, args); 34 | va_end(args); 35 | return code; 36 | } 37 | 38 | } // namespace tflite 39 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/core/api/tensor_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 17 | #define TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 18 | 19 | #include "tensorflow/lite/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | // Resets a variable tensor to the default value. 24 | TfLiteStatus ResetVariableTensor(TfLiteTensor* tensor); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 29 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/cppmath.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_CPPMATH_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_CPPMATH_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_CMATH_FUNCTIONS) || \ 23 | (defined(__ANDROID__) && !defined(__NDK_MAJOR__)) || defined(ARDUINO) || \ 24 | defined(__ZEPHYR__) 25 | #define TF_LITE_GLOBAL_STD_PREFIX 26 | #else 27 | #define TF_LITE_GLOBAL_STD_PREFIX std 28 | #endif 29 | 30 | #define DECLARE_STD_GLOBAL_SWITCH1(tf_name, std_name) \ 31 | template \ 32 | inline T tf_name(const T x) { \ 33 | return TF_LITE_GLOBAL_STD_PREFIX::std_name(x); \ 34 | } 35 | 36 | DECLARE_STD_GLOBAL_SWITCH1(TfLiteRound, round); 37 | 38 | } // namespace tflite 39 | 40 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_CPPMATH_H_ 41 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/max.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_MAX) || defined(__ZEPHYR__) 23 | inline float TfLiteMax(const float& x, const float& y) { 24 | return std::max(x, y); 25 | } 26 | #else 27 | template 28 | inline T TfLiteMax(const T& x, const T& y) { 29 | return std::fmax(x, y); 30 | } 31 | #endif 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 36 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/min.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_MIN) || defined(__ZEPHYR__) 23 | inline float TfLiteMin(const float& x, const float& y) { 24 | return std::min(x, y); 25 | } 26 | #else 27 | template 28 | inline T TfLiteMin(const T& x, const T& y) { 29 | return std::fmin(x, y); 30 | } 31 | #endif 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 36 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/optimized/neon_check.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 17 | 18 | #if defined(__ARM_NEON__) || defined(__ARM_NEON) 19 | #define USE_NEON 20 | #include 21 | #endif 22 | 23 | #if defined __GNUC__ && defined __SSE4_1__ && !defined TF_LITE_DISABLE_X86_NEON 24 | #define USE_NEON 25 | #include "NEON_2_SSE.h" 26 | #endif 27 | 28 | // NEON_OR_PORTABLE(SomeFunc, args) calls NeonSomeFunc(args) if USE_NEON is 29 | // defined, PortableSomeFunc(args) otherwise. 30 | #ifdef USE_NEON 31 | // Always use Neon code 32 | #define NEON_OR_PORTABLE(funcname, ...) Neon##funcname(__VA_ARGS__) 33 | 34 | #else 35 | // No NEON available: Use Portable code 36 | #define NEON_OR_PORTABLE(funcname, ...) Portable##funcname(__VA_ARGS__) 37 | 38 | #endif // defined(USE_NEON) 39 | 40 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 41 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/reference/ceil.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_CEIL_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_CEIL_H_ 17 | 18 | #include 19 | 20 | #include "tensorflow/lite/kernels/internal/types.h" 21 | 22 | namespace tflite { 23 | 24 | namespace reference_ops { 25 | 26 | inline void Ceil(const RuntimeShape& input_shape, const float* input_data, 27 | const RuntimeShape& output_shape, float* output_data) { 28 | const int flat_size = MatchingFlatSize(input_shape, output_shape); 29 | 30 | for (int i = 0; i < flat_size; ++i) { 31 | output_data[i] = std::ceil(input_data[i]); 32 | } 33 | } 34 | 35 | } // namespace reference_ops 36 | } // namespace tflite 37 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_CEIL_H_ 38 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/reference/exp.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_EXP_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_EXP_H_ 17 | 18 | #include 19 | 20 | #include "ruy/profiler/instrumentation.h" // from @ruy 21 | #include "tensorflow/lite/kernels/internal/types.h" 22 | 23 | namespace tflite { 24 | namespace reference_ops { 25 | 26 | template 27 | inline void Exp(const T* input_data, const size_t num_elements, 28 | T* output_data) { 29 | ruy::profiler::ScopeLabel label("Exp"); 30 | for (size_t idx = 0; idx < num_elements; ++idx) { 31 | output_data[idx] = std::exp(input_data[idx]); 32 | } 33 | } 34 | 35 | } // namespace reference_ops 36 | } // namespace tflite 37 | 38 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_EXP_H_ 39 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/reference/floor.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_H_ 17 | 18 | #include 19 | 20 | #include "tensorflow/lite/kernels/internal/types.h" 21 | 22 | namespace tflite { 23 | 24 | namespace reference_ops { 25 | 26 | inline void Floor(const RuntimeShape& input_shape, const float* input_data, 27 | const RuntimeShape& output_shape, float* output_data) { 28 | const int flat_size = MatchingFlatSize(input_shape, output_shape); 29 | 30 | for (int i = 0; i < flat_size; i++) { 31 | int offset = i; 32 | output_data[offset] = std::floor(input_data[offset]); 33 | } 34 | } 35 | 36 | } // namespace reference_ops 37 | } // namespace tflite 38 | 39 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_H_ 40 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/kernels/internal/reference/neg.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_NEG_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_NEG_H_ 17 | 18 | #include "tensorflow/lite/kernels/internal/types.h" 19 | 20 | namespace tflite { 21 | 22 | namespace reference_ops { 23 | 24 | template 25 | inline void Negate(const RuntimeShape& input_shape, const T* input_data, 26 | const RuntimeShape& output_shape, T* output_data) { 27 | const int flat_size = MatchingFlatSize(input_shape, output_shape); 28 | 29 | for (int i = 0; i < flat_size; ++i) { 30 | output_data[i] = -input_data[i]; 31 | } 32 | } 33 | 34 | } // namespace reference_ops 35 | } // namespace tflite 36 | 37 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_NEG_H_ 38 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/all_ops_resolver.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ 16 | #define TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ 17 | 18 | #include "tensorflow/lite/micro/compatibility.h" 19 | #include "tensorflow/lite/micro/micro_mutable_op_resolver.h" 20 | 21 | namespace tflite { 22 | 23 | // The magic number in the template parameter is the maximum number of ops that 24 | // can be added to AllOpsResolver. It can be increased if needed. And most 25 | // applications that care about the memory footprint will want to directly use 26 | // MicroMutableOpResolver and have an application specific template parameter. 27 | // The examples directory has sample code for this. 28 | class AllOpsResolver : public MicroMutableOpResolver<128> { 29 | public: 30 | AllOpsResolver(); 31 | 32 | private: 33 | TF_LITE_REMOVE_VIRTUAL_DELETE 34 | }; 35 | 36 | } // namespace tflite 37 | 38 | #endif // TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ 39 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_BENCHMARKS_KEYWORD_SCRAMBLED_MODEL_DATA_H_ 17 | #define TENSORFLOW_LITE_MICRO_BENCHMARKS_KEYWORD_SCRAMBLED_MODEL_DATA_H_ 18 | 19 | extern const unsigned char g_keyword_scrambled_model_data[]; 20 | extern const unsigned int g_keyword_scrambled_model_data_length; 21 | 22 | #endif // TENSORFLOW_LITE_MICRO_BENCHMARKS_KEYWORD_SCRAMBLED_MODEL_DATA_H_ 23 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/compatibility.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_COMPATIBILITY_H_ 16 | #define TENSORFLOW_LITE_MICRO_COMPATIBILITY_H_ 17 | 18 | // C++ will automatically create class-specific delete operators for virtual 19 | // objects, which by default call the global delete function. For embedded 20 | // applications we want to avoid this, and won't be calling new/delete on these 21 | // objects, so we need to override the default implementation with one that does 22 | // nothing to avoid linking in ::delete(). 23 | // This macro needs to be included in all subclasses of a virtual base class in 24 | // the private section. 25 | #ifdef TF_LITE_STATIC_MEMORY 26 | #define TF_LITE_REMOVE_VIRTUAL_DELETE \ 27 | void operator delete(void* p) {} 28 | #else 29 | #define TF_LITE_REMOVE_VIRTUAL_DELETE 30 | #endif 31 | 32 | #endif // TENSORFLOW_LITE_MICRO_COMPATIBILITY_H_ 33 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/debug_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_DEBUG_LOG_H_ 16 | #define TENSORFLOW_LITE_MICRO_DEBUG_LOG_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif // __cplusplus 21 | 22 | // This function should be implemented by each target platform, and provide a 23 | // way for strings to be output to some text stream. For more information, see 24 | // tensorflow/lite/micro/debug_log.cc. 25 | void DebugLog(const char* s); 26 | 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif // __cplusplus 30 | 31 | #endif // TENSORFLOW_LITE_MICRO_DEBUG_LOG_H_ 32 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/ethosu.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // 17 | // This is a stub file for non-Ethos platforms 18 | // 19 | #include "tensorflow/lite/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | TfLiteRegistration* Register_ETHOSU() { return nullptr; } 24 | 25 | const char* GetString_ETHOSU() { return ""; } 26 | 27 | } // namespace tflite 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/ethosu.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TfLiteRegistration* Register_ETHOSU(); 23 | 24 | const char* GetString_ETHOSU(); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 29 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_none_regular_nms; 20 | extern const unsigned char g_gen_data_none_regular_nms[]; 21 | 22 | extern const int g_gen_data_size_regular_nms; 23 | extern const unsigned char g_gen_data_regular_nms[]; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/kernel_util.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/kernels/kernel_util.h" 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | namespace micro { 22 | 23 | bool HaveSameShapes(const TfLiteEvalTensor* input1, 24 | const TfLiteEvalTensor* input2) { 25 | TFLITE_DCHECK(input1 != nullptr); 26 | TFLITE_DCHECK(input2 != nullptr); 27 | return TfLiteIntArrayEqual(input1->dims, input2->dims); 28 | } 29 | 30 | const RuntimeShape GetTensorShape(const TfLiteEvalTensor* tensor) { 31 | if (tensor == nullptr || tensor->dims == nullptr) { 32 | return RuntimeShape(); 33 | } 34 | TfLiteIntArray* dims = tensor->dims; 35 | const int dims_size = dims->size; 36 | const int32_t* dims_data = reinterpret_cast(dims->data); 37 | return RuntimeShape(dims_size, dims_data); 38 | } 39 | 40 | } // namespace micro 41 | } // namespace tflite 42 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/micro_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_MICRO_UTILS_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_MICRO_UTILS_H_ 17 | namespace tflite { 18 | namespace ops { 19 | namespace micro { 20 | 21 | // Same as gtl::Greater but defined here to reduce dependencies and 22 | // binary size for micro environment. 23 | struct Greater { 24 | template 25 | bool operator()(const T& x, const T& y) const { 26 | return x > y; 27 | } 28 | }; 29 | 30 | struct Less { 31 | template 32 | bool operator()(const T& x, const T& y) const { 33 | return x < y; 34 | } 35 | }; 36 | 37 | } // namespace micro 38 | } // namespace ops 39 | } // namespace tflite 40 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_UTILS_H_ 41 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/quantize.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_QUANTIZE_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_QUANTIZE_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | #include "tensorflow/lite/kernels/internal/types.h" 20 | 21 | namespace tflite { 22 | 23 | struct OpDataQuantizeReference { 24 | tflite::QuantizationParams quantization_params; 25 | // The scaling factor from input to output (aka the 'real multiplier') can 26 | // be represented as a fixed point multiplier plus a left shift. 27 | int32_t requantize_output_multiplier; 28 | int requantize_output_shift; 29 | 30 | int32_t input_zero_point; 31 | }; 32 | 33 | TfLiteStatus EvalQuantizeReference(TfLiteContext* context, TfLiteNode* node); 34 | 35 | } // namespace tflite 36 | 37 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_QUANTIZE_H_ 38 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/kernels/softmax.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_ 17 | 18 | #include "tensorflow/lite/c/builtin_op_data.h" 19 | #include "tensorflow/lite/c/common.h" 20 | #include "tensorflow/lite/kernels/internal/types.h" 21 | 22 | namespace tflite { 23 | 24 | void* SoftmaxInit(TfLiteContext* context, const char* buffer, size_t length); 25 | 26 | TfLiteStatus SoftmaxPrepare(TfLiteContext* context, TfLiteNode* node); 27 | 28 | } // namespace tflite 29 | 30 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_ 31 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/micro_string.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_MICRO_STRING_H_ 16 | #define TENSORFLOW_LITE_MICRO_MICRO_STRING_H_ 17 | 18 | #include 19 | 20 | // Implements simple string formatting for numeric types. Returns the number of 21 | // bytes written to output. 22 | extern "C" { 23 | // Functionally equivalent to vsnprintf, trimmed down for TFLite Micro. 24 | // MicroSnprintf() is implemented using MicroVsnprintf(). 25 | int MicroVsnprintf(char* output, int len, const char* format, va_list args); 26 | // Functionally equavalent to snprintf, trimmed down for TFLite Micro. 27 | // For example, MicroSnprintf(buffer, 10, "int %d", 10) will put the string 28 | // "int 10" in the buffer. 29 | // Floating point values are logged in exponent notation (1.XXX*2^N). 30 | int MicroSnprintf(char* output, int len, const char* format, ...); 31 | } 32 | 33 | #endif // TENSORFLOW_LITE_MICRO_MICRO_STRING_H_ 34 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/micro_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_MICRO_TIME_H_ 16 | #define TENSORFLOW_LITE_MICRO_MICRO_TIME_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | // These functions should be implemented by each target platform, and provide an 23 | // accurate tick count along with how many ticks there are per second. 24 | int32_t ticks_per_second(); 25 | 26 | // Return time in ticks. The meaning of a tick varies per platform. 27 | int32_t GetCurrentTimeTicks(); 28 | 29 | inline int32_t TicksToMs(int32_t ticks) { 30 | return static_cast(1000.0f * static_cast(ticks) / 31 | static_cast(ticks_per_second())); 32 | } 33 | 34 | } // namespace tflite 35 | 36 | #endif // TENSORFLOW_LITE_MICRO_MICRO_TIME_H_ 37 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/system_setup.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/system_setup.h" 17 | 18 | namespace tflite { 19 | 20 | // To add an equivalent function for your own platform, create your own 21 | // implementation file, and place it in a subfolder named after the target. See 22 | // tensorflow/lite/micro/debug_log.cc for a similar example. 23 | void InitializeTarget() {} 24 | 25 | } // namespace tflite 26 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/system_setup.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 16 | #define TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 17 | 18 | namespace tflite { 19 | 20 | // This should called during initialization of TFLM binaries and tests. It can 21 | // be specialized if there is a need for custom target-specific intialization. 22 | // For more information, see tensorflow/lite/micro/system_setup.cc. 23 | void InitializeTarget(); 24 | 25 | } // namespace tflite 26 | 27 | #endif // TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/micro/testing/test_conv_model.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 17 | #define TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 18 | 19 | // See generate_test_models.py for updating the contents of this model: 20 | extern const unsigned char kTestConvModelData[]; 21 | extern const unsigned int kTestConvModelDataSize; 22 | 23 | #endif // TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 24 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/schema/schema_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 16 | #define TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 17 | 18 | #include "flatbuffers/flatbuffers.h" 19 | #include "tensorflow/lite/schema/schema_generated.h" 20 | 21 | namespace tflite { 22 | 23 | // The following methods are introduced to resolve op builtin code shortage 24 | // problem. The new builtin operator will be assigned to the extended builtin 25 | // code field in the flatbuffer schema. Those methods helps to hide builtin code 26 | // details. 27 | BuiltinOperator GetBuiltinCode(const OperatorCode *op_code); 28 | 29 | BuiltinOperator GetBuiltinCode(const OperatorCodeT *op_code); 30 | 31 | } // namespace tflite 32 | 33 | #endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 34 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/string_type.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // Abstract string. We don't want even absl at this level. 16 | #ifndef TENSORFLOW_LITE_STRING_TYPE_H_ 17 | #define TENSORFLOW_LITE_STRING_TYPE_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | 23 | using std::string; 24 | 25 | } // namespace tflite 26 | 27 | #endif // TENSORFLOW_LITE_STRING_TYPE_H_ 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/tensorflow/lite/version.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_VERSION_H_ 16 | #define TENSORFLOW_LITE_VERSION_H_ 17 | 18 | #include "tensorflow/core/public/version.h" 19 | 20 | // The version number of the Schema. Ideally all changes will be backward 21 | // compatible. If that ever changes, we must ensure that version is the first 22 | // entry in the new tflite root so that we can see that version is not 1. 23 | #define TFLITE_SCHEMA_VERSION (3) 24 | 25 | // TensorFlow Lite Runtime version. 26 | // This value is currently shared with that of TensorFlow. 27 | #define TFLITE_VERSION_STRING TF_VERSION_STRING 28 | 29 | #endif // TENSORFLOW_LITE_VERSION_H_ 30 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/third_party/cmsis/CMSIS/DSP/Include/dsp/svm_defines.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file svm_defines.h 3 | * @brief Public header file for CMSIS DSP Library 4 | ******************************************************************************/ 5 | /* 6 | * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | 24 | #ifndef _SVM_DEFINES_H_ 25 | #define _SVM_DEFINES_H_ 26 | 27 | /** 28 | * @brief Struct for specifying SVM Kernel 29 | */ 30 | typedef enum 31 | { 32 | ARM_ML_KERNEL_LINEAR = 0, 33 | /**< Linear kernel */ 34 | ARM_ML_KERNEL_POLYNOMIAL = 1, 35 | /**< Polynomial kernel */ 36 | ARM_ML_KERNEL_RBF = 2, 37 | /**< Radial Basis Function kernel */ 38 | ARM_ML_KERNEL_SIGMOID = 3 39 | /**< Sigmoid kernel */ 40 | } arm_ml_kernel_type; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/third_party/cmsis/CMSIS/NN/Source/ActivationFunctions/arm_relu6_s8.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* ---------------------------------------------------------------------- 20 | * Project: CMSIS NN Library 21 | * Title: arm_relu6_s8.c 22 | * Description: Basic s8 version of ReLU6 23 | * 24 | * $Date: Spetember 2019 25 | * $Revision: V.1.0.0 26 | * 27 | * Target Processor: Cortex-M cores 28 | * 29 | * -------------------------------------------------------------------- */ 30 | 31 | #include "arm_math.h" 32 | #include "arm_nnfunctions.h" 33 | 34 | /** 35 | * @ingroup groupNN 36 | */ 37 | 38 | /** 39 | * @addtogroup Acti 40 | * @{ 41 | */ 42 | 43 | /* 44 | * Basic ReLU6 function 45 | * 46 | * Refer to header file for details. 47 | * 48 | */ 49 | 50 | void arm_relu6_s8(q7_t *data, uint16_t size) 51 | { 52 | int32_t i; 53 | 54 | for (i = 0; i < size; i++) 55 | { 56 | int32_t ip = data[i]; 57 | 58 | ip = MAX(ip, 0); 59 | data[i] = MIN(ip, 6); 60 | } 61 | } 62 | 63 | /** 64 | * @} end of Acti group 65 | */ 66 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/third_party/cmsis/CMSIS/NN/Source/ReshapeFunctions/arm_reshape_s8.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* ---------------------------------------------------------------------- 20 | * Project: CMSIS NN Library 21 | * Title: arm_reshape_s8.c 22 | * Description: Reshape a s8 vector 23 | * 24 | * $Date: September 2019 25 | * $Revision: V.1.0.0 26 | * 27 | * Target Processor: Cortex-M cores 28 | * 29 | * -------------------------------------------------------------------- */ 30 | 31 | #include "arm_nnfunctions.h" 32 | 33 | /** 34 | * @ingroup groupNN 35 | */ 36 | 37 | /** 38 | * @addtogroup Reshape 39 | * @{ 40 | */ 41 | 42 | /** 43 | * Basic s8 reshape function. 44 | * 45 | * Refer header file for details. 46 | * 47 | */ 48 | 49 | void arm_reshape_s8(const int8_t *input, 50 | int8_t *output, 51 | const uint32_t total_size) 52 | { 53 | memcpy(output, input, total_size); 54 | } 55 | 56 | /** 57 | * @} end of Reshape group 58 | */ -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/third_party/kissfft/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2010 Mark Borgerding 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/third_party/kissfft/tools/kiss_fftr.h: -------------------------------------------------------------------------------- 1 | #ifndef KISS_FTR_H 2 | #define KISS_FTR_H 3 | 4 | #include "kiss_fft.h" 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | /* 11 | 12 | Real optimized version can save about 45% cpu time vs. complex fft of a real seq. 13 | 14 | 15 | 16 | */ 17 | 18 | typedef struct kiss_fftr_state *kiss_fftr_cfg; 19 | 20 | 21 | kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem); 22 | /* 23 | nfft must be even 24 | 25 | If you don't care to allocate space, use mem = lenmem = NULL 26 | */ 27 | 28 | 29 | void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata); 30 | /* 31 | input timedata has nfft scalar points 32 | output freqdata has nfft/2+1 complex points 33 | */ 34 | 35 | void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata); 36 | /* 37 | input freqdata has nfft/2+1 complex points 38 | output timedata has nfft scalar points 39 | */ 40 | 41 | #define kiss_fftr_free free 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/video_model.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEO_MODEL_H_ 2 | #define VIDEO_MODEL_H_ 3 | 4 | extern unsigned char video_model_tflite[]; 5 | extern unsigned int video_model_tflite_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/video_model.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/mult_domain/video_model.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/video_model_mobilenet.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEO_MODEL_MOBILENET_H_ 2 | #define VIDEO_MODEL_MOBILENET_H_ 3 | 4 | extern unsigned char video_model_mobilenet_tflite[]; 5 | extern unsigned int video_model_mobilenet_tflite_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/video_model_mobilenet.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/mult_domain/video_model_mobilenet.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/video_model_mobilenet_new.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/mult_domain/video_model_mobilenet_new.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/video_model_mobilenet_old.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/mult_domain/video_model_mobilenet_old.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/x_test_audio1.cc: -------------------------------------------------------------------------------- 1 | #include "x_test_audio1.h" 2 | 3 | unsigned char x_test_audio1_txt[] = { 4 | 0xdb, 0xde, 0xd6, 0xd0, 0xca, 0xbe, 0xaa, 0x96, 0x88, 0x82, 0x80, 0x81, 5 | 0x81, 0x85, 0x86, 0x82, 0x63, 0x63, 0x66, 0x70, 0x79, 0x7e, 0x7d, 0x75, 6 | 0x6c, 0x67, 0x64, 0x60, 0x5d, 0x58, 0x54, 0x55, 0x3a, 0x34, 0x31, 0x30, 7 | 0x33, 0x39, 0x3f, 0x42, 0x41, 0x42, 0x43, 0x44, 0x43, 0x44, 0x44, 0x43, 8 | 0x31, 0x2e, 0x2b, 0x29, 0x2b, 0x31, 0x3b, 0x41, 0x43, 0x46, 0x46, 0x44, 9 | 0x43, 0x44, 0x45, 0x44, 0x31, 0x35, 0x3a, 0x3b, 0x3b, 0x3a, 0x37, 0x39, 10 | 0x3b, 0x3e, 0x40, 0x3f, 0x3d, 0x3d, 0x3c, 0x3b, 0x40, 0x3f, 0x3e, 0x3b, 11 | 0x3a, 0x39, 0x36, 0x36, 0x38, 0x3a, 0x3c, 0x3f, 0x3f, 0x3e, 0x3f, 0x3f, 12 | 0x3c, 0x3a, 0x37, 0x37, 0x39, 0x39, 0x3c, 0x3d, 0x3b, 0x3b, 0x3c, 0x3b, 13 | 0x3c, 0x3d, 0x3d, 0x3c, 0x36, 0x37, 0x39, 0x3a, 0x3d, 0x3f, 0x3f, 0x41, 14 | 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x42, 0x41, 0x39, 0x3a, 0x3b, 0x3e, 15 | 0x3f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x42, 0x42, 0x40, 0x3e, 0x3f, 16 | 0x3d, 0x3b, 0x39, 0x3b, 0x3d, 0x3f, 0x40, 0x3f, 0x41, 0x41, 0x42, 0x40, 17 | 0x40, 0x43, 0x43, 0x44, 0x3b, 0x39, 0x39, 0x39, 0x37, 0x35, 0x39, 0x3c, 18 | 0x3d, 0x3d, 0x3e, 0x3f, 0x3f, 0x3e, 0x3d, 0x3d, 0x3d, 0x3f, 0x40, 0x41, 19 | 0x40, 0x3f, 0x3d, 0x3b, 0x3d, 0x3f, 0x3e, 0x3d, 0x3c, 0x3c, 0x3d, 0x3e, 20 | 0x42, 0x45, 0x45, 0x43, 0x41, 0x3f, 0x3c, 0x3b, 0x3e, 0x3f, 0x3e, 0x3e, 21 | 0x3f, 0x41, 0x43, 0x42, 0x40, 0x42, 0x44, 0x41, 0x3e, 0x3f, 0x3e, 0x3d, 22 | 0x3f, 0x40, 0x40, 0x41, 0x41, 0x40, 0x3f, 0x3f, 0x44, 0x45, 0x45, 0x41, 23 | 0x3d, 0x3d, 0x3e, 0x3e, 0x40, 0x41, 0x42, 0x41, 0x40, 0x3f, 0x40, 0x41, 24 | 0x49, 0x4a, 0x49, 0x45, 0x41, 0x3e, 0x3e, 0x3f, 0x40, 0x40, 0x40, 0x40, 25 | 0x41, 0x43, 0x43, 0x42 26 | }; 27 | unsigned int x_test_audio1_txt_len = 256; 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/x_test_audio1.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_AUDIO1_H_ 2 | #define X_TEST_AUDIO1_H_ 3 | 4 | extern unsigned char x_test_audio1_txt[]; 5 | extern unsigned int x_test_audio1_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/x_test_audio2.cc: -------------------------------------------------------------------------------- 1 | #include "x_test_audio2.h" 2 | 3 | unsigned char x_test_audio2_txt[] = { 4 | 0xce, 0xc3, 0xce, 0xe2, 0xe7, 0xe1, 0xde, 0xdf, 0xde, 0xd5, 0xc9, 0xc7, 5 | 0xc0, 0xb0, 0xb0, 0xc5, 0x50, 0x56, 0x57, 0x4f, 0x4b, 0x4d, 0x4e, 0x4f, 6 | 0x55, 0x58, 0x5b, 0x5c, 0x5e, 0x5d, 0x5e, 0x63, 0x54, 0x52, 0x45, 0x41, 7 | 0x41, 0x44, 0x40, 0x3a, 0x3b, 0x40, 0x47, 0x4b, 0x4e, 0x52, 0x48, 0x36, 8 | 0x30, 0x34, 0x38, 0x36, 0x33, 0x2f, 0x2f, 0x2b, 0x2a, 0x2e, 0x35, 0x38, 9 | 0x3b, 0x3e, 0x39, 0x2b, 0x2b, 0x2a, 0x2a, 0x29, 0x28, 0x27, 0x31, 0x3d, 10 | 0x43, 0x3f, 0x34, 0x30, 0x30, 0x36, 0x3e, 0x40, 0x3f, 0x3b, 0x39, 0x3e, 11 | 0x40, 0x3d, 0x34, 0x31, 0x2f, 0x32, 0x37, 0x39, 0x39, 0x36, 0x3c, 0x41, 12 | 0x30, 0x31, 0x39, 0x39, 0x39, 0x36, 0x32, 0x33, 0x33, 0x30, 0x30, 0x32, 13 | 0x35, 0x39, 0x38, 0x39, 0x3c, 0x3c, 0x35, 0x36, 0x37, 0x36, 0x3e, 0x45, 14 | 0x43, 0x3f, 0x3a, 0x37, 0x35, 0x36, 0x3a, 0x3d, 0x3d, 0x39, 0x3a, 0x3d, 15 | 0x40, 0x42, 0x42, 0x41, 0x3f, 0x40, 0x3c, 0x39, 0x3a, 0x3d, 0x3d, 0x3f, 16 | 0x3c, 0x3c, 0x3d, 0x3c, 0x3c, 0x3d, 0x38, 0x38, 0x37, 0x33, 0x34, 0x37, 17 | 0x3b, 0x3d, 0x3c, 0x3e, 0x45, 0x45, 0x44, 0x42, 0x41, 0x44, 0x45, 0x41, 18 | 0x3a, 0x38, 0x3e, 0x3e, 0x3d, 0x3d, 0x41, 0x3f, 0x40, 0x40, 0x41, 0x41, 19 | 0x43, 0x46, 0x4b, 0x4b, 0x47, 0x44, 0x42, 0x40, 0x40, 0x40, 0x42, 0x40, 20 | 0x4a, 0x4a, 0x49, 0x49, 0x4a, 0x4b, 0x4d, 0x50, 0x4d, 0x4a, 0x48, 0x43, 21 | 0x40, 0x40, 0x42, 0x41, 0x4d, 0x4c, 0x48, 0x46, 0x46, 0x46, 0x45, 0x48, 22 | 0x47, 0x48, 0x48, 0x47, 0x45, 0x44, 0x42, 0x43, 0x4a, 0x49, 0x49, 0x49, 23 | 0x49, 0x47, 0x44, 0x3f, 0x41, 0x42, 0x45, 0x47, 0x45, 0x43, 0x42, 0x43, 24 | 0x45, 0x45, 0x46, 0x46, 0x45, 0x42, 0x3f, 0x3c, 0x3e, 0x43, 0x46, 0x45, 25 | 0x44, 0x44, 0x46, 0x48 26 | }; 27 | unsigned int x_test_audio2_txt_len = 256; 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/x_test_audio2.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_AUDIO2_H_ 2 | #define X_TEST_AUDIO2_H_ 3 | 4 | extern unsigned char x_test_audio2_txt[]; 5 | extern unsigned int x_test_audio2_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/x_test_video1.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_VIDEO1_H_ 2 | #define X_TEST_VIDEO1_H_ 3 | 4 | extern unsigned char x_test_video1_txt[]; 5 | extern unsigned int x_test_video1_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/mult_domain/x_test_video2.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_VIDEO2_H_ 2 | #define X_TEST_VIDEO2_H_ 3 | 4 | extern unsigned char x_test_video2_txt[]; 5 | extern unsigned int x_test_video2_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/audio_model.h: -------------------------------------------------------------------------------- 1 | #ifndef AUDIO_MODEL_H_ 2 | #define AUDIO_MODEL_H_ 3 | 4 | extern unsigned char audio_model_tflite[]; 5 | extern unsigned int audio_model_tflite_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/audio_model.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/single_core/audio_model.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/main.cc: -------------------------------------------------------------------------------- 1 | #include "main_functions.h" 2 | #include "pico/stdlib.h" 3 | #include "pico/multicore.h" 4 | #include 5 | #include 6 | #include 7 | 8 | int main(int argc, char* argv[]) { 9 | //absolute_time_t hundred_loop_start; 10 | stdio_init_all(); 11 | 12 | sleep_ms(10000); 13 | printf("starting script \n"); 14 | sleep_ms(1000); 15 | 16 | audio_setup(); 17 | video_setup(); 18 | 19 | unsigned int i = 0; 20 | //int loop_num = 1; 21 | 22 | while (true) { 23 | //if (loop_num == 101) { 24 | // loop_num = 1; 25 | //} 26 | absolute_time_t loop_start = get_absolute_time(); 27 | //if (loop_num == 1) { 28 | // hundred_loop_start = get_absolute_time(); 29 | //} 30 | if (i == 2) { 31 | i = 0; 32 | } 33 | 34 | loop(i); 35 | 36 | i+= 1; 37 | 38 | //get time taken 39 | int64_t time_diff = absolute_time_diff_us(loop_start, get_absolute_time()); 40 | //if (loop_num == 100) { 41 | // int64_t hundred_loops_end = absolute_time_diff_us(hundred_loop_start, get_absolute_time()); 42 | // int64_t loops_average = (hundred_loops_end) / 100; 43 | // printf("100 loop average took %d microseconds \n", static_cast(loops_average)); 44 | //} 45 | printf("Loop took %e microseconds \n", static_cast(time_diff)); 46 | //loop_num += 1; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/main_functions.h: -------------------------------------------------------------------------------- 1 | #ifndef MAIN_FUNCTIONS_H_ 2 | #define MAIN_FUNCTIONS_H_ 3 | // Expose a C friendly interface for main functions. 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | // Initializes all data needed for the example. The name is important, and needs 9 | // to be setup() for Arduino compatibility. 10 | void audio_setup(); 11 | void video_setup(); 12 | int compute_average(int a, int b); 13 | void handle_output(unsigned int i, int audio_score, int video_score); 14 | void loop(unsigned int i); 15 | //void run_audio_model(); 16 | //void run_video_model(); 17 | // Runs one iteration of data gathering and inference. This should be called 18 | // repeatedly from the application code. The name needs to be loop() for Arduino 19 | // compatibility. 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/core/api/error_reporter.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #include "tensorflow/lite/core/api/error_reporter.h" 16 | #include 17 | 18 | namespace tflite { 19 | 20 | int ErrorReporter::Report(const char* format, ...) { 21 | va_list args; 22 | va_start(args, format); 23 | int code = Report(format, args); 24 | va_end(args); 25 | return code; 26 | } 27 | 28 | // TODO(aselle): Make the name of ReportError on context the same, so 29 | // we can use the ensure functions w/o a context and w/ a reporter. 30 | int ErrorReporter::ReportError(void*, const char* format, ...) { 31 | va_list args; 32 | va_start(args, format); 33 | int code = Report(format, args); 34 | va_end(args); 35 | return code; 36 | } 37 | 38 | } // namespace tflite 39 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/core/api/tensor_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 17 | #define TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 18 | 19 | #include "tensorflow/lite/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | // Resets a variable tensor to the default value. 24 | TfLiteStatus ResetVariableTensor(TfLiteTensor* tensor); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_CORE_API_TENSOR_UTILS_H_ 29 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/cppmath.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_CPPMATH_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_CPPMATH_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_CMATH_FUNCTIONS) || \ 23 | (defined(__ANDROID__) && !defined(__NDK_MAJOR__)) || defined(ARDUINO) || \ 24 | defined(__ZEPHYR__) 25 | #define TF_LITE_GLOBAL_STD_PREFIX 26 | #else 27 | #define TF_LITE_GLOBAL_STD_PREFIX std 28 | #endif 29 | 30 | #define DECLARE_STD_GLOBAL_SWITCH1(tf_name, std_name) \ 31 | template \ 32 | inline T tf_name(const T x) { \ 33 | return TF_LITE_GLOBAL_STD_PREFIX::std_name(x); \ 34 | } 35 | 36 | DECLARE_STD_GLOBAL_SWITCH1(TfLiteRound, round); 37 | 38 | } // namespace tflite 39 | 40 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_CPPMATH_H_ 41 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/max.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_MAX) || defined(__ZEPHYR__) 23 | inline float TfLiteMax(const float& x, const float& y) { 24 | return std::max(x, y); 25 | } 26 | #else 27 | template 28 | inline T TfLiteMax(const T& x, const T& y) { 29 | return std::fmax(x, y); 30 | } 31 | #endif 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_MAX_H_ 36 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/min.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | #if defined(TF_LITE_USE_GLOBAL_MIN) || defined(__ZEPHYR__) 23 | inline float TfLiteMin(const float& x, const float& y) { 24 | return std::min(x, y); 25 | } 26 | #else 27 | template 28 | inline T TfLiteMin(const T& x, const T& y) { 29 | return std::fmin(x, y); 30 | } 31 | #endif 32 | 33 | } // namespace tflite 34 | 35 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_MIN_H_ 36 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/optimized/neon_check.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 17 | 18 | #if defined(__ARM_NEON__) || defined(__ARM_NEON) 19 | #define USE_NEON 20 | #include 21 | #endif 22 | 23 | #if defined __GNUC__ && defined __SSE4_1__ && !defined TF_LITE_DISABLE_X86_NEON 24 | #define USE_NEON 25 | #include "NEON_2_SSE.h" 26 | #endif 27 | 28 | // NEON_OR_PORTABLE(SomeFunc, args) calls NeonSomeFunc(args) if USE_NEON is 29 | // defined, PortableSomeFunc(args) otherwise. 30 | #ifdef USE_NEON 31 | // Always use Neon code 32 | #define NEON_OR_PORTABLE(funcname, ...) Neon##funcname(__VA_ARGS__) 33 | 34 | #else 35 | // No NEON available: Use Portable code 36 | #define NEON_OR_PORTABLE(funcname, ...) Portable##funcname(__VA_ARGS__) 37 | 38 | #endif // defined(USE_NEON) 39 | 40 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_OPTIMIZED_NEON_CHECK_H_ 41 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/reference/ceil.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_CEIL_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_CEIL_H_ 17 | 18 | #include 19 | 20 | #include "tensorflow/lite/kernels/internal/types.h" 21 | 22 | namespace tflite { 23 | 24 | namespace reference_ops { 25 | 26 | inline void Ceil(const RuntimeShape& input_shape, const float* input_data, 27 | const RuntimeShape& output_shape, float* output_data) { 28 | const int flat_size = MatchingFlatSize(input_shape, output_shape); 29 | 30 | for (int i = 0; i < flat_size; ++i) { 31 | output_data[i] = std::ceil(input_data[i]); 32 | } 33 | } 34 | 35 | } // namespace reference_ops 36 | } // namespace tflite 37 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_CEIL_H_ 38 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/reference/exp.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_EXP_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_EXP_H_ 17 | 18 | #include 19 | 20 | #include "ruy/profiler/instrumentation.h" // from @ruy 21 | #include "tensorflow/lite/kernels/internal/types.h" 22 | 23 | namespace tflite { 24 | namespace reference_ops { 25 | 26 | template 27 | inline void Exp(const T* input_data, const size_t num_elements, 28 | T* output_data) { 29 | ruy::profiler::ScopeLabel label("Exp"); 30 | for (size_t idx = 0; idx < num_elements; ++idx) { 31 | output_data[idx] = std::exp(input_data[idx]); 32 | } 33 | } 34 | 35 | } // namespace reference_ops 36 | } // namespace tflite 37 | 38 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_EXP_H_ 39 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/reference/floor.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_H_ 17 | 18 | #include 19 | 20 | #include "tensorflow/lite/kernels/internal/types.h" 21 | 22 | namespace tflite { 23 | 24 | namespace reference_ops { 25 | 26 | inline void Floor(const RuntimeShape& input_shape, const float* input_data, 27 | const RuntimeShape& output_shape, float* output_data) { 28 | const int flat_size = MatchingFlatSize(input_shape, output_shape); 29 | 30 | for (int i = 0; i < flat_size; i++) { 31 | int offset = i; 32 | output_data[offset] = std::floor(input_data[offset]); 33 | } 34 | } 35 | 36 | } // namespace reference_ops 37 | } // namespace tflite 38 | 39 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_FLOOR_H_ 40 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/kernels/internal/reference/neg.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_NEG_H_ 16 | #define TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_NEG_H_ 17 | 18 | #include "tensorflow/lite/kernels/internal/types.h" 19 | 20 | namespace tflite { 21 | 22 | namespace reference_ops { 23 | 24 | template 25 | inline void Negate(const RuntimeShape& input_shape, const T* input_data, 26 | const RuntimeShape& output_shape, T* output_data) { 27 | const int flat_size = MatchingFlatSize(input_shape, output_shape); 28 | 29 | for (int i = 0; i < flat_size; ++i) { 30 | output_data[i] = -input_data[i]; 31 | } 32 | } 33 | 34 | } // namespace reference_ops 35 | } // namespace tflite 36 | 37 | #endif // TENSORFLOW_LITE_KERNELS_INTERNAL_REFERENCE_NEG_H_ 38 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/all_ops_resolver.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ 16 | #define TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ 17 | 18 | #include "tensorflow/lite/micro/compatibility.h" 19 | #include "tensorflow/lite/micro/micro_mutable_op_resolver.h" 20 | 21 | namespace tflite { 22 | 23 | // The magic number in the template parameter is the maximum number of ops that 24 | // can be added to AllOpsResolver. It can be increased if needed. And most 25 | // applications that care about the memory footprint will want to directly use 26 | // MicroMutableOpResolver and have an application specific template parameter. 27 | // The examples directory has sample code for this. 28 | class AllOpsResolver : public MicroMutableOpResolver<128> { 29 | public: 30 | AllOpsResolver(); 31 | 32 | private: 33 | TF_LITE_REMOVE_VIRTUAL_DELETE 34 | }; 35 | 36 | } // namespace tflite 37 | 38 | #endif // TENSORFLOW_LITE_MICRO_ALL_OPS_RESOLVER_H_ 39 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/benchmarks/keyword_scrambled_model_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_BENCHMARKS_KEYWORD_SCRAMBLED_MODEL_DATA_H_ 17 | #define TENSORFLOW_LITE_MICRO_BENCHMARKS_KEYWORD_SCRAMBLED_MODEL_DATA_H_ 18 | 19 | extern const unsigned char g_keyword_scrambled_model_data[]; 20 | extern const unsigned int g_keyword_scrambled_model_data_length; 21 | 22 | #endif // TENSORFLOW_LITE_MICRO_BENCHMARKS_KEYWORD_SCRAMBLED_MODEL_DATA_H_ 23 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/compatibility.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_COMPATIBILITY_H_ 16 | #define TENSORFLOW_LITE_MICRO_COMPATIBILITY_H_ 17 | 18 | // C++ will automatically create class-specific delete operators for virtual 19 | // objects, which by default call the global delete function. For embedded 20 | // applications we want to avoid this, and won't be calling new/delete on these 21 | // objects, so we need to override the default implementation with one that does 22 | // nothing to avoid linking in ::delete(). 23 | // This macro needs to be included in all subclasses of a virtual base class in 24 | // the private section. 25 | #ifdef TF_LITE_STATIC_MEMORY 26 | #define TF_LITE_REMOVE_VIRTUAL_DELETE \ 27 | void operator delete(void* p) {} 28 | #else 29 | #define TF_LITE_REMOVE_VIRTUAL_DELETE 30 | #endif 31 | 32 | #endif // TENSORFLOW_LITE_MICRO_COMPATIBILITY_H_ 33 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/debug_log.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_DEBUG_LOG_H_ 16 | #define TENSORFLOW_LITE_MICRO_DEBUG_LOG_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif // __cplusplus 21 | 22 | // This function should be implemented by each target platform, and provide a 23 | // way for strings to be output to some text stream. For more information, see 24 | // tensorflow/lite/micro/debug_log.cc. 25 | void DebugLog(const char* s); 26 | 27 | #ifdef __cplusplus 28 | } // extern "C" 29 | #endif // __cplusplus 30 | 31 | #endif // TENSORFLOW_LITE_MICRO_DEBUG_LOG_H_ 32 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/ethosu.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // 17 | // This is a stub file for non-Ethos platforms 18 | // 19 | #include "tensorflow/lite/c/common.h" 20 | 21 | namespace tflite { 22 | 23 | TfLiteRegistration* Register_ETHOSU() { return nullptr; } 24 | 25 | const char* GetString_ETHOSU() { return ""; } 26 | 27 | } // namespace tflite 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/ethosu.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | 22 | TfLiteRegistration* Register_ETHOSU(); 23 | 24 | const char* GetString_ETHOSU(); 25 | 26 | } // namespace tflite 27 | 28 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_ETHOSU_H_ 29 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/flexbuffers_generated_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 17 | #define TENSORFLOW_LITE_MICRO_KERNELS_FLEXBUFFERS_GENERATED_DATA_H 18 | 19 | extern const int g_gen_data_size_none_regular_nms; 20 | extern const unsigned char g_gen_data_none_regular_nms[]; 21 | 22 | extern const int g_gen_data_size_regular_nms; 23 | extern const unsigned char g_gen_data_regular_nms[]; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/kernel_util.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/kernels/kernel_util.h" 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | 20 | namespace tflite { 21 | namespace micro { 22 | 23 | bool HaveSameShapes(const TfLiteEvalTensor* input1, 24 | const TfLiteEvalTensor* input2) { 25 | TFLITE_DCHECK(input1 != nullptr); 26 | TFLITE_DCHECK(input2 != nullptr); 27 | return TfLiteIntArrayEqual(input1->dims, input2->dims); 28 | } 29 | 30 | const RuntimeShape GetTensorShape(const TfLiteEvalTensor* tensor) { 31 | if (tensor == nullptr || tensor->dims == nullptr) { 32 | return RuntimeShape(); 33 | } 34 | TfLiteIntArray* dims = tensor->dims; 35 | const int dims_size = dims->size; 36 | const int32_t* dims_data = reinterpret_cast(dims->data); 37 | return RuntimeShape(dims_size, dims_data); 38 | } 39 | 40 | } // namespace micro 41 | } // namespace tflite 42 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/micro_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_MICRO_UTILS_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_MICRO_UTILS_H_ 17 | namespace tflite { 18 | namespace ops { 19 | namespace micro { 20 | 21 | // Same as gtl::Greater but defined here to reduce dependencies and 22 | // binary size for micro environment. 23 | struct Greater { 24 | template 25 | bool operator()(const T& x, const T& y) const { 26 | return x > y; 27 | } 28 | }; 29 | 30 | struct Less { 31 | template 32 | bool operator()(const T& x, const T& y) const { 33 | return x < y; 34 | } 35 | }; 36 | 37 | } // namespace micro 38 | } // namespace ops 39 | } // namespace tflite 40 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_MICRO_UTILS_H_ 41 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/quantize.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_QUANTIZE_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_QUANTIZE_H_ 17 | 18 | #include "tensorflow/lite/c/common.h" 19 | #include "tensorflow/lite/kernels/internal/types.h" 20 | 21 | namespace tflite { 22 | 23 | struct OpDataQuantizeReference { 24 | tflite::QuantizationParams quantization_params; 25 | // The scaling factor from input to output (aka the 'real multiplier') can 26 | // be represented as a fixed point multiplier plus a left shift. 27 | int32_t requantize_output_multiplier; 28 | int requantize_output_shift; 29 | 30 | int32_t input_zero_point; 31 | }; 32 | 33 | TfLiteStatus EvalQuantizeReference(TfLiteContext* context, TfLiteNode* node); 34 | 35 | } // namespace tflite 36 | 37 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_QUANTIZE_H_ 38 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/kernels/softmax.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_ 16 | #define TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_ 17 | 18 | #include "tensorflow/lite/c/builtin_op_data.h" 19 | #include "tensorflow/lite/c/common.h" 20 | #include "tensorflow/lite/kernels/internal/types.h" 21 | 22 | namespace tflite { 23 | 24 | void* SoftmaxInit(TfLiteContext* context, const char* buffer, size_t length); 25 | 26 | TfLiteStatus SoftmaxPrepare(TfLiteContext* context, TfLiteNode* node); 27 | 28 | } // namespace tflite 29 | 30 | #endif // TENSORFLOW_LITE_MICRO_KERNELS_SOFTMAX_H_ 31 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/micro_string.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_MICRO_STRING_H_ 16 | #define TENSORFLOW_LITE_MICRO_MICRO_STRING_H_ 17 | 18 | #include 19 | 20 | // Implements simple string formatting for numeric types. Returns the number of 21 | // bytes written to output. 22 | extern "C" { 23 | // Functionally equivalent to vsnprintf, trimmed down for TFLite Micro. 24 | // MicroSnprintf() is implemented using MicroVsnprintf(). 25 | int MicroVsnprintf(char* output, int len, const char* format, va_list args); 26 | // Functionally equavalent to snprintf, trimmed down for TFLite Micro. 27 | // For example, MicroSnprintf(buffer, 10, "int %d", 10) will put the string 28 | // "int 10" in the buffer. 29 | // Floating point values are logged in exponent notation (1.XXX*2^N). 30 | int MicroSnprintf(char* output, int len, const char* format, ...); 31 | } 32 | 33 | #endif // TENSORFLOW_LITE_MICRO_MICRO_STRING_H_ 34 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/micro_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_MICRO_TIME_H_ 16 | #define TENSORFLOW_LITE_MICRO_MICRO_TIME_H_ 17 | 18 | #include 19 | 20 | namespace tflite { 21 | 22 | // These functions should be implemented by each target platform, and provide an 23 | // accurate tick count along with how many ticks there are per second. 24 | int32_t ticks_per_second(); 25 | 26 | // Return time in ticks. The meaning of a tick varies per platform. 27 | int32_t GetCurrentTimeTicks(); 28 | 29 | inline int32_t TicksToMs(int32_t ticks) { 30 | return static_cast(1000.0f * static_cast(ticks) / 31 | static_cast(ticks_per_second())); 32 | } 33 | 34 | } // namespace tflite 35 | 36 | #endif // TENSORFLOW_LITE_MICRO_MICRO_TIME_H_ 37 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/system_setup.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "tensorflow/lite/micro/system_setup.h" 17 | 18 | namespace tflite { 19 | 20 | // To add an equivalent function for your own platform, create your own 21 | // implementation file, and place it in a subfolder named after the target. See 22 | // tensorflow/lite/micro/debug_log.cc for a similar example. 23 | void InitializeTarget() {} 24 | 25 | } // namespace tflite 26 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/system_setup.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2021 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 16 | #define TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 17 | 18 | namespace tflite { 19 | 20 | // This should called during initialization of TFLM binaries and tests. It can 21 | // be specialized if there is a need for custom target-specific intialization. 22 | // For more information, see tensorflow/lite/micro/system_setup.cc. 23 | void InitializeTarget(); 24 | 25 | } // namespace tflite 26 | 27 | #endif // TENSORFLOW_LITE_MICRO_SYSTEM_SETUP_H_ 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/micro/testing/test_conv_model.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 17 | #define TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 18 | 19 | // See generate_test_models.py for updating the contents of this model: 20 | extern const unsigned char kTestConvModelData[]; 21 | extern const unsigned int kTestConvModelDataSize; 22 | 23 | #endif // TENSORFLOW_LITE_MICRO_TESTING_TEST_CONV_MODEL_H_ 24 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/schema/schema_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 16 | #define TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 17 | 18 | #include "flatbuffers/flatbuffers.h" 19 | #include "tensorflow/lite/schema/schema_generated.h" 20 | 21 | namespace tflite { 22 | 23 | // The following methods are introduced to resolve op builtin code shortage 24 | // problem. The new builtin operator will be assigned to the extended builtin 25 | // code field in the flatbuffer schema. Those methods helps to hide builtin code 26 | // details. 27 | BuiltinOperator GetBuiltinCode(const OperatorCode *op_code); 28 | 29 | BuiltinOperator GetBuiltinCode(const OperatorCodeT *op_code); 30 | 31 | } // namespace tflite 32 | 33 | #endif // TENSORFLOW_LITE_SCHEMA_SCHEMA_UTILS_H_ 34 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/string_type.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | // Abstract string. We don't want even absl at this level. 16 | #ifndef TENSORFLOW_LITE_STRING_TYPE_H_ 17 | #define TENSORFLOW_LITE_STRING_TYPE_H_ 18 | 19 | #include 20 | 21 | namespace tflite { 22 | 23 | using std::string; 24 | 25 | } // namespace tflite 26 | 27 | #endif // TENSORFLOW_LITE_STRING_TYPE_H_ 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/tensorflow/lite/version.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | #ifndef TENSORFLOW_LITE_VERSION_H_ 16 | #define TENSORFLOW_LITE_VERSION_H_ 17 | 18 | #include "tensorflow/core/public/version.h" 19 | 20 | // The version number of the Schema. Ideally all changes will be backward 21 | // compatible. If that ever changes, we must ensure that version is the first 22 | // entry in the new tflite root so that we can see that version is not 1. 23 | #define TFLITE_SCHEMA_VERSION (3) 24 | 25 | // TensorFlow Lite Runtime version. 26 | // This value is currently shared with that of TensorFlow. 27 | #define TFLITE_VERSION_STRING TF_VERSION_STRING 28 | 29 | #endif // TENSORFLOW_LITE_VERSION_H_ 30 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/third_party/cmsis/CMSIS/DSP/Include/dsp/svm_defines.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file svm_defines.h 3 | * @brief Public header file for CMSIS DSP Library 4 | ******************************************************************************/ 5 | /* 6 | * Copyright (c) 2010-2020 Arm Limited or its affiliates. All rights reserved. 7 | * 8 | * SPDX-License-Identifier: Apache-2.0 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the License); you may 11 | * not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 18 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | 24 | #ifndef _SVM_DEFINES_H_ 25 | #define _SVM_DEFINES_H_ 26 | 27 | /** 28 | * @brief Struct for specifying SVM Kernel 29 | */ 30 | typedef enum 31 | { 32 | ARM_ML_KERNEL_LINEAR = 0, 33 | /**< Linear kernel */ 34 | ARM_ML_KERNEL_POLYNOMIAL = 1, 35 | /**< Polynomial kernel */ 36 | ARM_ML_KERNEL_RBF = 2, 37 | /**< Radial Basis Function kernel */ 38 | ARM_ML_KERNEL_SIGMOID = 3 39 | /**< Sigmoid kernel */ 40 | } arm_ml_kernel_type; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/third_party/cmsis/CMSIS/NN/Source/ActivationFunctions/arm_relu6_s8.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* ---------------------------------------------------------------------- 20 | * Project: CMSIS NN Library 21 | * Title: arm_relu6_s8.c 22 | * Description: Basic s8 version of ReLU6 23 | * 24 | * $Date: Spetember 2019 25 | * $Revision: V.1.0.0 26 | * 27 | * Target Processor: Cortex-M cores 28 | * 29 | * -------------------------------------------------------------------- */ 30 | 31 | #include "arm_math.h" 32 | #include "arm_nnfunctions.h" 33 | 34 | /** 35 | * @ingroup groupNN 36 | */ 37 | 38 | /** 39 | * @addtogroup Acti 40 | * @{ 41 | */ 42 | 43 | /* 44 | * Basic ReLU6 function 45 | * 46 | * Refer to header file for details. 47 | * 48 | */ 49 | 50 | void arm_relu6_s8(q7_t *data, uint16_t size) 51 | { 52 | int32_t i; 53 | 54 | for (i = 0; i < size; i++) 55 | { 56 | int32_t ip = data[i]; 57 | 58 | ip = MAX(ip, 0); 59 | data[i] = MIN(ip, 6); 60 | } 61 | } 62 | 63 | /** 64 | * @} end of Acti group 65 | */ 66 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/third_party/cmsis/CMSIS/NN/Source/ReshapeFunctions/arm_reshape_s8.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2019 Arm Limited or its affiliates. All rights reserved. 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the License); you may 7 | * not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 14 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | /* ---------------------------------------------------------------------- 20 | * Project: CMSIS NN Library 21 | * Title: arm_reshape_s8.c 22 | * Description: Reshape a s8 vector 23 | * 24 | * $Date: September 2019 25 | * $Revision: V.1.0.0 26 | * 27 | * Target Processor: Cortex-M cores 28 | * 29 | * -------------------------------------------------------------------- */ 30 | 31 | #include "arm_nnfunctions.h" 32 | 33 | /** 34 | * @ingroup groupNN 35 | */ 36 | 37 | /** 38 | * @addtogroup Reshape 39 | * @{ 40 | */ 41 | 42 | /** 43 | * Basic s8 reshape function. 44 | * 45 | * Refer header file for details. 46 | * 47 | */ 48 | 49 | void arm_reshape_s8(const int8_t *input, 50 | int8_t *output, 51 | const uint32_t total_size) 52 | { 53 | memcpy(output, input, total_size); 54 | } 55 | 56 | /** 57 | * @} end of Reshape group 58 | */ -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/third_party/kissfft/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2010 Mark Borgerding 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 9 | * Neither the author nor the names of any contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/third_party/kissfft/tools/kiss_fftr.h: -------------------------------------------------------------------------------- 1 | #ifndef KISS_FTR_H 2 | #define KISS_FTR_H 3 | 4 | #include "kiss_fft.h" 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | 10 | /* 11 | 12 | Real optimized version can save about 45% cpu time vs. complex fft of a real seq. 13 | 14 | 15 | 16 | */ 17 | 18 | typedef struct kiss_fftr_state *kiss_fftr_cfg; 19 | 20 | 21 | kiss_fftr_cfg kiss_fftr_alloc(int nfft,int inverse_fft,void * mem, size_t * lenmem); 22 | /* 23 | nfft must be even 24 | 25 | If you don't care to allocate space, use mem = lenmem = NULL 26 | */ 27 | 28 | 29 | void kiss_fftr(kiss_fftr_cfg cfg,const kiss_fft_scalar *timedata,kiss_fft_cpx *freqdata); 30 | /* 31 | input timedata has nfft scalar points 32 | output freqdata has nfft/2+1 complex points 33 | */ 34 | 35 | void kiss_fftri(kiss_fftr_cfg cfg,const kiss_fft_cpx *freqdata,kiss_fft_scalar *timedata); 36 | /* 37 | input freqdata has nfft/2+1 complex points 38 | output timedata has nfft scalar points 39 | */ 40 | 41 | #define kiss_fftr_free free 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif 47 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/video_model.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEO_MODEL_H_ 2 | #define VIDEO_MODEL_H_ 3 | 4 | extern unsigned char video_model_tflite[]; 5 | extern unsigned int video_model_tflite_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/video_model.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/single_core/video_model.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/video_model_mobilenet.h: -------------------------------------------------------------------------------- 1 | #ifndef VIDEO_MODEL_MOBILENET_H_ 2 | #define VIDEO_MODEL_MOBILENET_H_ 3 | 4 | extern unsigned char video_model_mobilenet_tflite[]; 5 | extern unsigned int video_model_mobilenet_tflite_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/video_model_mobilenet.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/single_core/video_model_mobilenet.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/video_model_mobilenet_new.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/single_core/video_model_mobilenet_new.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/video_model_mobilenet_old.tflite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/multi_domain_pico/single_core/video_model_mobilenet_old.tflite -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/x_test_audio1.cc: -------------------------------------------------------------------------------- 1 | #include "x_test_audio1.h" 2 | 3 | unsigned char x_test_audio1_txt[] = { 4 | 0xdb, 0xde, 0xd6, 0xd0, 0xca, 0xbe, 0xaa, 0x96, 0x88, 0x82, 0x80, 0x81, 5 | 0x81, 0x85, 0x86, 0x82, 0x63, 0x63, 0x66, 0x70, 0x79, 0x7e, 0x7d, 0x75, 6 | 0x6c, 0x67, 0x64, 0x60, 0x5d, 0x58, 0x54, 0x55, 0x3a, 0x34, 0x31, 0x30, 7 | 0x33, 0x39, 0x3f, 0x42, 0x41, 0x42, 0x43, 0x44, 0x43, 0x44, 0x44, 0x43, 8 | 0x31, 0x2e, 0x2b, 0x29, 0x2b, 0x31, 0x3b, 0x41, 0x43, 0x46, 0x46, 0x44, 9 | 0x43, 0x44, 0x45, 0x44, 0x31, 0x35, 0x3a, 0x3b, 0x3b, 0x3a, 0x37, 0x39, 10 | 0x3b, 0x3e, 0x40, 0x3f, 0x3d, 0x3d, 0x3c, 0x3b, 0x40, 0x3f, 0x3e, 0x3b, 11 | 0x3a, 0x39, 0x36, 0x36, 0x38, 0x3a, 0x3c, 0x3f, 0x3f, 0x3e, 0x3f, 0x3f, 12 | 0x3c, 0x3a, 0x37, 0x37, 0x39, 0x39, 0x3c, 0x3d, 0x3b, 0x3b, 0x3c, 0x3b, 13 | 0x3c, 0x3d, 0x3d, 0x3c, 0x36, 0x37, 0x39, 0x3a, 0x3d, 0x3f, 0x3f, 0x41, 14 | 0x41, 0x41, 0x42, 0x42, 0x43, 0x43, 0x42, 0x41, 0x39, 0x3a, 0x3b, 0x3e, 15 | 0x3f, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x42, 0x42, 0x40, 0x3e, 0x3f, 16 | 0x3d, 0x3b, 0x39, 0x3b, 0x3d, 0x3f, 0x40, 0x3f, 0x41, 0x41, 0x42, 0x40, 17 | 0x40, 0x43, 0x43, 0x44, 0x3b, 0x39, 0x39, 0x39, 0x37, 0x35, 0x39, 0x3c, 18 | 0x3d, 0x3d, 0x3e, 0x3f, 0x3f, 0x3e, 0x3d, 0x3d, 0x3d, 0x3f, 0x40, 0x41, 19 | 0x40, 0x3f, 0x3d, 0x3b, 0x3d, 0x3f, 0x3e, 0x3d, 0x3c, 0x3c, 0x3d, 0x3e, 20 | 0x42, 0x45, 0x45, 0x43, 0x41, 0x3f, 0x3c, 0x3b, 0x3e, 0x3f, 0x3e, 0x3e, 21 | 0x3f, 0x41, 0x43, 0x42, 0x40, 0x42, 0x44, 0x41, 0x3e, 0x3f, 0x3e, 0x3d, 22 | 0x3f, 0x40, 0x40, 0x41, 0x41, 0x40, 0x3f, 0x3f, 0x44, 0x45, 0x45, 0x41, 23 | 0x3d, 0x3d, 0x3e, 0x3e, 0x40, 0x41, 0x42, 0x41, 0x40, 0x3f, 0x40, 0x41, 24 | 0x49, 0x4a, 0x49, 0x45, 0x41, 0x3e, 0x3e, 0x3f, 0x40, 0x40, 0x40, 0x40, 25 | 0x41, 0x43, 0x43, 0x42 26 | }; 27 | unsigned int x_test_audio1_txt_len = 256; 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/x_test_audio1.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_AUDIO1_H_ 2 | #define X_TEST_AUDIO1_H_ 3 | 4 | extern unsigned char x_test_audio1_txt[]; 5 | extern unsigned int x_test_audio1_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/x_test_audio2.cc: -------------------------------------------------------------------------------- 1 | #include "x_test_audio2.h" 2 | 3 | unsigned char x_test_audio2_txt[] = { 4 | 0xce, 0xc3, 0xce, 0xe2, 0xe7, 0xe1, 0xde, 0xdf, 0xde, 0xd5, 0xc9, 0xc7, 5 | 0xc0, 0xb0, 0xb0, 0xc5, 0x50, 0x56, 0x57, 0x4f, 0x4b, 0x4d, 0x4e, 0x4f, 6 | 0x55, 0x58, 0x5b, 0x5c, 0x5e, 0x5d, 0x5e, 0x63, 0x54, 0x52, 0x45, 0x41, 7 | 0x41, 0x44, 0x40, 0x3a, 0x3b, 0x40, 0x47, 0x4b, 0x4e, 0x52, 0x48, 0x36, 8 | 0x30, 0x34, 0x38, 0x36, 0x33, 0x2f, 0x2f, 0x2b, 0x2a, 0x2e, 0x35, 0x38, 9 | 0x3b, 0x3e, 0x39, 0x2b, 0x2b, 0x2a, 0x2a, 0x29, 0x28, 0x27, 0x31, 0x3d, 10 | 0x43, 0x3f, 0x34, 0x30, 0x30, 0x36, 0x3e, 0x40, 0x3f, 0x3b, 0x39, 0x3e, 11 | 0x40, 0x3d, 0x34, 0x31, 0x2f, 0x32, 0x37, 0x39, 0x39, 0x36, 0x3c, 0x41, 12 | 0x30, 0x31, 0x39, 0x39, 0x39, 0x36, 0x32, 0x33, 0x33, 0x30, 0x30, 0x32, 13 | 0x35, 0x39, 0x38, 0x39, 0x3c, 0x3c, 0x35, 0x36, 0x37, 0x36, 0x3e, 0x45, 14 | 0x43, 0x3f, 0x3a, 0x37, 0x35, 0x36, 0x3a, 0x3d, 0x3d, 0x39, 0x3a, 0x3d, 15 | 0x40, 0x42, 0x42, 0x41, 0x3f, 0x40, 0x3c, 0x39, 0x3a, 0x3d, 0x3d, 0x3f, 16 | 0x3c, 0x3c, 0x3d, 0x3c, 0x3c, 0x3d, 0x38, 0x38, 0x37, 0x33, 0x34, 0x37, 17 | 0x3b, 0x3d, 0x3c, 0x3e, 0x45, 0x45, 0x44, 0x42, 0x41, 0x44, 0x45, 0x41, 18 | 0x3a, 0x38, 0x3e, 0x3e, 0x3d, 0x3d, 0x41, 0x3f, 0x40, 0x40, 0x41, 0x41, 19 | 0x43, 0x46, 0x4b, 0x4b, 0x47, 0x44, 0x42, 0x40, 0x40, 0x40, 0x42, 0x40, 20 | 0x4a, 0x4a, 0x49, 0x49, 0x4a, 0x4b, 0x4d, 0x50, 0x4d, 0x4a, 0x48, 0x43, 21 | 0x40, 0x40, 0x42, 0x41, 0x4d, 0x4c, 0x48, 0x46, 0x46, 0x46, 0x45, 0x48, 22 | 0x47, 0x48, 0x48, 0x47, 0x45, 0x44, 0x42, 0x43, 0x4a, 0x49, 0x49, 0x49, 23 | 0x49, 0x47, 0x44, 0x3f, 0x41, 0x42, 0x45, 0x47, 0x45, 0x43, 0x42, 0x43, 24 | 0x45, 0x45, 0x46, 0x46, 0x45, 0x42, 0x3f, 0x3c, 0x3e, 0x43, 0x46, 0x45, 25 | 0x44, 0x44, 0x46, 0x48 26 | }; 27 | unsigned int x_test_audio2_txt_len = 256; 28 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/x_test_audio2.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_AUDIO2_H_ 2 | #define X_TEST_AUDIO2_H_ 3 | 4 | extern unsigned char x_test_audio2_txt[]; 5 | extern unsigned int x_test_audio2_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/x_test_video1.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_VIDEO1_H_ 2 | #define X_TEST_VIDEO1_H_ 3 | 4 | extern unsigned char x_test_video1_txt[]; 5 | extern unsigned int x_test_video1_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/multi_domain_pico/single_core/x_test_video2.h: -------------------------------------------------------------------------------- 1 | #ifndef X_TEST_VIDEO2_H_ 2 | #define X_TEST_VIDEO2_H_ 3 | 4 | extern unsigned char x_test_video2_txt[]; 5 | extern unsigned int x_test_video2_txt_len; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /projects/pico/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/.DS_Store -------------------------------------------------------------------------------- /projects/pico/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /projects/pico/deployment/README.md: -------------------------------------------------------------------------------- 1 | # Deployment scripts for Pico 2 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/.ipynb_checkpoints/Untitled-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/.ipynb_checkpoints/aws_objects-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ajeetraina/opencv4-python3 2 | RUN apt update 3 | RUN mkdir -p /project/ 4 | COPY image_processor.py /project/ 5 | COPY image-processor.json /project/ 6 | COPY consumer.py /project/ 7 | COPY templates /project/ 8 | COPY templates/index.html /project/templates/index.html 9 | COPY pico-consumer.sh /project/ 10 | WORKDIR /project/ 11 | RUN pip3 install pytz boto3 pillow 12 | CMD ["pico-consumer.sh"] 13 | ENTRYPOINT ["/bin/sh"] 14 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/Untitled.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": { 7 | "collapsed": true 8 | }, 9 | "outputs": [], 10 | "source": [ 11 | "from kafka import KafkaProducer" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": 2, 17 | "metadata": { 18 | "collapsed": true 19 | }, 20 | "outputs": [], 21 | "source": [ 22 | "producer = KafkaProducer(bootstrap_servers=['35.221.215.135:9092'])" 23 | ] 24 | }, 25 | { 26 | "cell_type": "code", 27 | "execution_count": 8, 28 | "metadata": {}, 29 | "outputs": [], 30 | "source": [ 31 | "var = \"camera\"+str(1)\n", 32 | "\n", 33 | "\n", 34 | "for i in range(0,100):\n", 35 | " producer.send(topic=var,value=b'raw_bytes')" 36 | ] 37 | }, 38 | { 39 | "cell_type": "code", 40 | "execution_count": null, 41 | "metadata": { 42 | "collapsed": true 43 | }, 44 | "outputs": [], 45 | "source": [] 46 | } 47 | ], 48 | "metadata": { 49 | "kernelspec": { 50 | "display_name": "Python 3", 51 | "language": "python", 52 | "name": "python3" 53 | }, 54 | "language_info": { 55 | "codemirror_mode": { 56 | "name": "ipython", 57 | "version": 3 58 | }, 59 | "file_extension": ".py", 60 | "mimetype": "text/x-python", 61 | "name": "python", 62 | "nbconvert_exporter": "python", 63 | "pygments_lexer": "ipython3", 64 | "version": "3.6.2" 65 | } 66 | }, 67 | "nbformat": 4, 68 | "nbformat_minor": 2 69 | } 70 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/image-processor.json: -------------------------------------------------------------------------------- 1 | { 2 | "s3_bucket" : "bucketpico", 3 | "s3_key_frames_root" : "frames/", 4 | 5 | "ddb_table" : "EnrichedFrame", 6 | 7 | "rekog_max_labels" : 123, 8 | "rekog_min_conf" : 50.0, 9 | 10 | "label_watch_list" : ["Human", "Pet", "Bag", "Toy"], 11 | "label_watch_min_conf" : 90.0, 12 | "label_watch_phone_num" : "7411763580", 13 | "label_watch_sns_topic_arn" : "mypico", 14 | 15 | "timezone" : "US/Eastern" 16 | } 17 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/image_processor.json: -------------------------------------------------------------------------------- 1 | { 2 | "s3_bucket" : "bucketpico", 3 | "s3_key_frames_root" : "frames/", 4 | 5 | "ddb_table" : "EnrichedFrame", 6 | 7 | "rekog_max_labels" : 123, 8 | "rekog_min_conf" : 50.0, 9 | 10 | "label_watch_list" : ["Human", "Pet", "Bag", "Toy"], 11 | "label_watch_min_conf" : 90.0, 12 | "label_watch_phone_num" : "7411763580", 13 | "label_watch_sns_topic_arn" : "mypico", 14 | 15 | "timezone" : "US/Eastern" 16 | } 17 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/person.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/deployment/objects/person.jpg -------------------------------------------------------------------------------- /projects/pico/deployment/objects/pet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/deployment/objects/pet.jpg -------------------------------------------------------------------------------- /projects/pico/deployment/objects/pico-consumer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | exec python3 image_processor.py & 4 | exec python3 consumer.py 5 | -------------------------------------------------------------------------------- /projects/pico/deployment/objects/rasp_cluster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/deployment/objects/rasp_cluster.jpg -------------------------------------------------------------------------------- /projects/pico/deployment/objects/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Video Streaming Demonstration 4 | 5 | 6 |

Video Streaming Demonstration

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /projects/pico/deployment/plates/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ajeetraina/rpi-raspbian-opencv 2 | MAINTAINER Ajeet S Raina "ajeetraina@gmail.c 3 | RUN apt update -y 4 | RUN pip3 install pytz 5 | RUN pip3 install kafka-python 6 | RUN apt install -y git 7 | ADD . /pico/ 8 | WORKDIR /pico/ 9 | ENTRYPOINT ["python3", "/pico/plates-producer.py" ] 10 | -------------------------------------------------------------------------------- /projects/pico/deployment/plates/README.md: -------------------------------------------------------------------------------- 1 | # Building Docker Image for Number Plates Detection Service 2 | 3 | ``` 4 | docker build -t ajeetraina/pico-raspbi-producer . 5 | ``` 6 | 7 | ## Running the Container 8 | 9 | ``` 10 | docker run -dit --privileged -v --device=/dev/vcsm --device=/dev/vchiq -v /dev/video0:/dev/video0 ajeetraina/pico-raspbi-producer 11 | ``` 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/pico/deployment/plates/plates-consumer.py: -------------------------------------------------------------------------------- 1 | 2 | # coding: utf-8 3 | 4 | # In[17]: 5 | 6 | 7 | import datetime 8 | from kafka import KafkaConsumer 9 | import boto3 10 | import json 11 | import base64 12 | 13 | # Fire up the Kafka Consumer 14 | topic = "testpico" 15 | brokers = ["35.189.130.4:9092"] 16 | 17 | # Initialising Kafka consumer(Lambda) with topic 18 | consumer = KafkaConsumer( 19 | topic, 20 | bootstrap_servers=brokers, 21 | value_deserializer=lambda m: json.loads(m.decode('utf-8'))) 22 | 23 | 24 | # In[18]: 25 | 26 | # Initialising AWS session using Secrey Keys 27 | session = boto3.session.Session(aws_access_key_id='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 28 | aws_secret_access_key='XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', 29 | region_name='us-west-2') 30 | 31 | # Reading every message in the consumer topic(queue) followed by decoding at the producer 32 | for msg in consumer: 33 | 34 | img_bytes = base64.b64decode(msg.value['image_bytes']) 35 | 36 | 37 | # Initializing the AWS Rekognition System 38 | rekog_client = session.client('rekognition') 39 | 40 | # Sending the Image byte array to the AWS Rekognition System to detect the text in the image 41 | 42 | response = rekog_client.detect_text(Image={'Bytes':img_bytes}) 43 | 44 | # Capturing the text detections from the AWS Rekognition System response 45 | 46 | 47 | textDetections=response['TextDetections'] 48 | 49 | for text in textDetections: 50 | print ('Detected text:' + text['DetectedText']) 51 | print ('Confidence: ' + "{:.2f}".format(text['Confidence']) + "%") 52 | 53 | print("#"*50) 54 | 55 | 56 | # In[ ]: 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /projects/pico/deployment/raspbi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ajeetraina/rpi-raspbian-opencv 2 | MAINTAINER Ajeet S Raina "ajeetraina@gmail.c 3 | 4 | RUN apt update -y 5 | RUN pip3 install pytz 6 | RUN pip3 install kafka-python 7 | RUN apt install -y git 8 | ADD . /pico/ 9 | WORKDIR /pico/raspbi/ 10 | ENTRYPOINT ["python3", "/pico/producer.py" ] 11 | -------------------------------------------------------------------------------- /projects/pico/deployment/raspbi/README.md: -------------------------------------------------------------------------------- 1 | # Getting Raspberry Pi Ready & Tagged with Camera IDs 2 | 3 | ## Pre-requisite 4 | 5 | - Enable Raspberry Pi Camera Interface using raspbi-config utility 6 | - Enable the BCM module: 7 | 8 | ``` 9 | sudo modprobe bcm2835-v4l2 10 | ``` 11 | 12 | ## Cloning the Repository 13 | 14 | ``` 15 | git clone https://github.com/collabnix/pico/ 16 | cd pico/deployment/raspbi 17 | ``` 18 | 19 | ## Modifying the Camera ID:1,2,3 respectively 20 | 21 | ## Building Docker Image 22 | 23 | ``` 24 | docker build -t ajeetraina/pico-armv71 25 | ``` 26 | 27 | ## Running the Container 28 | 29 | ``` 30 | docker run -d --privileged -v /dev/video0:/dev/video0 ajeetraina/pico-armv71 31 | ``` 32 | -------------------------------------------------------------------------------- /projects/pico/deployment/raspbi/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Video Streaming Demonstration 4 | 5 | 6 |

Video Streaming Demonstration

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /projects/pico/docs/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/pico/images/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /projects/pico/images/Screenshot 2020-08-20 at 6.33.02 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/Screenshot 2020-08-20 at 6.33.02 PM.png -------------------------------------------------------------------------------- /projects/pico/images/Screenshot 2020-08-20 at 6.33.37 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/Screenshot 2020-08-20 at 6.33.37 PM.png -------------------------------------------------------------------------------- /projects/pico/images/arch_pico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/arch_pico.png -------------------------------------------------------------------------------- /projects/pico/images/image-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/image-9.png -------------------------------------------------------------------------------- /projects/pico/images/install1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install1.png -------------------------------------------------------------------------------- /projects/pico/images/install2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install2.png -------------------------------------------------------------------------------- /projects/pico/images/install3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install3.png -------------------------------------------------------------------------------- /projects/pico/images/install4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install4.png -------------------------------------------------------------------------------- /projects/pico/images/install5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install5.png -------------------------------------------------------------------------------- /projects/pico/images/install6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install6.png -------------------------------------------------------------------------------- /projects/pico/images/install8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/install8.png -------------------------------------------------------------------------------- /projects/pico/images/pibox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/pibox.png -------------------------------------------------------------------------------- /projects/pico/images/pibox3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/pibox3.png -------------------------------------------------------------------------------- /projects/pico/images/picbox2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/picbox2.png -------------------------------------------------------------------------------- /projects/pico/images/pico-project-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/pico-project-arch.png -------------------------------------------------------------------------------- /projects/pico/images/pico2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/pico2.png -------------------------------------------------------------------------------- /projects/pico/images/pico_in_3_steps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/pico_in_3_steps.png -------------------------------------------------------------------------------- /projects/pico/images/rasp_cluster.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/rasp_cluster.jpg -------------------------------------------------------------------------------- /projects/pico/images/thepicoproject1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/images/thepicoproject1.png -------------------------------------------------------------------------------- /projects/pico/kafka/aws/credentials: -------------------------------------------------------------------------------- 1 | [default] 2 | aws_access_key_id=AKIXXX 3 | aws_secret_access_key=P66ZgXXX 4 | -------------------------------------------------------------------------------- /projects/pico/kafka/bin/debug.sh: -------------------------------------------------------------------------------- 1 | 2 | #!/usr/bin/env bash 3 | 4 | : ${SUSPEND:='n'} 5 | 6 | set -e 7 | 8 | export KAFKA_JMX_OPTS="-Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=${SUSPEND},address=5005" 9 | export CLASSPATH="$(find target/kafka-connect-aws-lambda-1.0-package/share/java -type f -name '*.jar' | tr '\n' ':')" 10 | 11 | # connect-standalone config/connect-json-docker.properties config/AwsLambdaSinkConnector.properties 12 | 13 | connect-standalone $1 $2 14 | -------------------------------------------------------------------------------- /projects/pico/kafka/config/AwsLambdaSinkConnector.properties: -------------------------------------------------------------------------------- 1 | 2 | name=AwsLambdaSinkConnector 3 | topics=aws-lambda-topic 4 | tasks.max=1 5 | connector.class=com.tm.kafka.connect.aws.lambda.AwsLambdaSinkConnector 6 | 7 | aws.region=us-west-2 8 | aws.function.name=kafka-aws-lambda-test 9 | aws.lambda.payload.converter.class=com.tm.kafka.connect.aws.lambda.converter.JsonPayloadConverter 10 | # aws.lambda.payload.converter.class=com.tm.kafka.connect.aws.lambda.converter.DefaultPayloadConverter 11 | # retry.backoff.ms=5000 12 | # aws.lambda.invoke.async=RequestResponse 13 | # aws.lambda.invoke.async=Event 14 | # aws.lambda.invoke.async=DryRun 15 | 16 | # aws.credentials.provider.class=com.amazonaws.auth.DefaultAWSCredentialsProviderChain 17 | aws.credentials.provider.class=com.tm.kafka.connect.aws.lambda.ConfigurationAWSCredentialsProvider 18 | aws.credentials.provider.aws.access.key.id=${file:/root/.aws/credentials:aws_access_key_id} 19 | aws.credentials.provider.aws.secret.access.key=${file:/root/.aws/credentials:aws_secret_access_key} 20 | -------------------------------------------------------------------------------- /projects/pico/kafka/kafka-common.env: -------------------------------------------------------------------------------- 1 | KAFKA_ZOOKEEPER_CONNECT=zk-1:2181,zk-2:2181,zk-3:2181 2 | KAFKA_LISTENERS=EXTERNAL://0.0.0.0:9092,INTERNAL://0.0.0.0:9192 3 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP=INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT 4 | KAFKA_INTER_BROKER_LISTENER_NAME=INTERNAL 5 | KAFKA_DEFAULT_REPLICATION_FACTOR=3 6 | KAFKA_JMX_PORT=9181 7 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/assembly/package.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | package 7 | 8 | dir 9 | 10 | false 11 | 12 | 13 | ${project.basedir} 14 | share/doc/${project.name}/ 15 | 16 | README* 17 | LICENSE* 18 | NOTICE* 19 | licenses/ 20 | 21 | 22 | 23 | ${project.basedir}/config 24 | etc/${project.name} 25 | 26 | * 27 | 28 | 29 | 30 | 31 | 32 | share/java/${project.name} 33 | true 34 | true 35 | 36 | org.apache.kafka:connect-api 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/java/com/tm/kafka/connect/aws/lambda/AwsLambdaSinkConnector.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda; 2 | 3 | import org.apache.kafka.common.config.ConfigDef; 4 | import org.apache.kafka.connect.connector.Task; 5 | import org.apache.kafka.connect.sink.SinkConnector; 6 | import org.slf4j.Logger; 7 | import org.slf4j.LoggerFactory; 8 | 9 | import java.util.ArrayList; 10 | import java.util.HashMap; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | public class AwsLambdaSinkConnector extends SinkConnector { 15 | private static Logger log = LoggerFactory.getLogger(AwsLambdaSinkConnector.class); 16 | private AwsLambdaSinkConnectorConfig config; 17 | 18 | @Override 19 | public String version() { 20 | return VersionUtil.getVersion(); 21 | } 22 | 23 | @Override 24 | public void start(Map map) { 25 | config = new AwsLambdaSinkConnectorConfig(map); 26 | } 27 | 28 | @Override 29 | public Class taskClass() { 30 | return AwsLambdaSinkTask.class; 31 | } 32 | 33 | @Override 34 | public List> taskConfigs(int maxTasks) { 35 | Map taskProps = new HashMap<>(config.originalsStrings()); 36 | List> taskConfigs = new ArrayList<>(maxTasks); 37 | for (int i = 0; i < maxTasks; ++i) { 38 | taskConfigs.add(taskProps); 39 | } 40 | return taskConfigs; 41 | } 42 | 43 | @Override 44 | public void stop() { 45 | } 46 | 47 | @Override 48 | public ConfigDef config() { 49 | return AwsLambdaSinkConnectorConfig.conf(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/java/com/tm/kafka/connect/aws/lambda/ConfigurationAWSCredentialsProvider.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda; 2 | 3 | import com.amazonaws.auth.AWSCredentials; 4 | import com.amazonaws.auth.AWSCredentialsProvider; 5 | import org.apache.kafka.common.Configurable; 6 | 7 | import java.util.Map; 8 | 9 | public class ConfigurationAWSCredentialsProvider implements AWSCredentialsProvider, Configurable { 10 | 11 | private static final String AWS_ACCESS_KEY_ID_CONFIG = "aws.access.key.id"; 12 | private static final String AWS_SECRET_ACCESS_KEY_CONFIG = "aws.secret.access.key"; 13 | 14 | private AWSCredentials awsCredentials; 15 | 16 | @Override 17 | public AWSCredentials getCredentials() { 18 | return awsCredentials; 19 | } 20 | 21 | @Override 22 | public void refresh() { 23 | 24 | } 25 | 26 | @Override 27 | public void configure(final Map configs) { 28 | awsCredentials = new AWSCredentials() { 29 | private final String key = (String) configs.get(AWS_ACCESS_KEY_ID_CONFIG); 30 | private final String secret = (String) configs.get(AWS_SECRET_ACCESS_KEY_CONFIG); 31 | 32 | @Override 33 | public String getAWSAccessKeyId() { 34 | return key; 35 | } 36 | 37 | @Override 38 | public String getAWSSecretKey() { 39 | return secret; 40 | } 41 | }; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/java/com/tm/kafka/connect/aws/lambda/VersionUtil.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda; 2 | 3 | /** 4 | * Created by jeremy on 5/3/16. 5 | */ 6 | class VersionUtil { 7 | public static String getVersion() { 8 | try { 9 | return VersionUtil.class.getPackage().getImplementationVersion(); 10 | } catch (Exception ex) { 11 | return "0.0.0.0"; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/java/com/tm/kafka/connect/aws/lambda/converter/DefaultPayloadConverter.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda.converter; 2 | 3 | import com.google.gson.Gson; 4 | import org.apache.kafka.connect.sink.SinkRecord; 5 | import org.slf4j.Logger; 6 | import org.slf4j.LoggerFactory; 7 | 8 | public class DefaultPayloadConverter implements SinkRecordToPayloadConverter { 9 | private Logger log = LoggerFactory.getLogger(DefaultPayloadConverter.class); 10 | private Gson gson = new Gson(); 11 | 12 | public String convert(SinkRecord record) { 13 | String payload = gson.toJson(record); 14 | log.trace("P: {}", payload); 15 | return payload; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/java/com/tm/kafka/connect/aws/lambda/converter/JsonPayloadConverter.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda.converter; 2 | 3 | import com.fasterxml.jackson.core.JsonProcessingException; 4 | import com.fasterxml.jackson.databind.ObjectMapper; 5 | import org.apache.kafka.connect.data.Schema; 6 | import org.apache.kafka.connect.json.JsonConverter; 7 | import org.apache.kafka.connect.json.JsonDeserializer; 8 | import org.apache.kafka.connect.sink.SinkRecord; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | 12 | import static java.util.Collections.emptyMap; 13 | 14 | public class JsonPayloadConverter implements SinkRecordToPayloadConverter { 15 | private Logger log = LoggerFactory.getLogger(JsonPayloadConverter.class); 16 | private ObjectMapper objectMapper = new ObjectMapper(); 17 | private JsonConverter jsonConverter = new JsonConverter(); 18 | private JsonDeserializer jsonDeserializer = new JsonDeserializer(); 19 | 20 | public JsonPayloadConverter() { 21 | jsonConverter.configure(emptyMap(), false); 22 | jsonDeserializer.configure(emptyMap(), false); 23 | } 24 | 25 | public String convert(SinkRecord record) throws JsonProcessingException { 26 | String topic = record.topic(); 27 | Schema schema = record.valueSchema(); 28 | Object value = record.value(); 29 | 30 | String payload = objectMapper.writeValueAsString( 31 | jsonDeserializer.deserialize(topic, 32 | jsonConverter.fromConnectData(topic, schema, value))); 33 | 34 | if (log.isTraceEnabled()) { 35 | log.trace("P: {}", payload); 36 | } 37 | 38 | return payload; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/java/com/tm/kafka/connect/aws/lambda/converter/SinkRecordToPayloadConverter.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda.converter; 2 | 3 | import org.apache.kafka.connect.errors.RetriableException; 4 | import org.apache.kafka.connect.sink.SinkRecord; 5 | 6 | import java.util.function.Function; 7 | 8 | public interface SinkRecordToPayloadConverter extends Function { 9 | String convert(final SinkRecord record) throws Exception; 10 | 11 | default String apply(final SinkRecord record) { 12 | try { 13 | return convert(record); 14 | } catch (final Exception e) { 15 | throw new RetriableException("Payload converter " + getClass().getName() + " failed to convert '" + record.toString(), e); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/test/java/com/tm/kafka/connect/aws/lambda/AwsLambdaSinkConnectorConfigTest.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda; 2 | 3 | import org.junit.Test; 4 | 5 | public class AwsLambdaSinkConnectorConfigTest { 6 | @Test 7 | public void doc() { 8 | System.out.println(AwsLambdaSinkConnectorConfig.conf().toRst()); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/test/java/com/tm/kafka/connect/aws/lambda/AwsLambdaSinkConnectorTest.java: -------------------------------------------------------------------------------- 1 | package com.tm.kafka.connect.aws.lambda; 2 | 3 | import org.junit.Test; 4 | 5 | public class AwsLambdaSinkConnectorTest { 6 | @Test 7 | public void test() { 8 | // Congrats on a passing test! 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /projects/pico/kafka/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /projects/pico/kafka/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Video Streaming Demonstration 4 | 5 | 6 |

Video Streaming Demonstration

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /projects/pico/kafka/zk-common.env: -------------------------------------------------------------------------------- 1 | ZOOKEEPER_CLIENT_PORT=2181 2 | -------------------------------------------------------------------------------- /projects/pico/lambda/Screen Shot 2019-07-01 at 3.31.58 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/lambda/Screen Shot 2019-07-01 at 3.31.58 PM.png -------------------------------------------------------------------------------- /projects/pico/lambda/Screen Shot 2019-07-01 at 3.32.15 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/lambda/Screen Shot 2019-07-01 at 3.32.15 PM.png -------------------------------------------------------------------------------- /projects/pico/lambda/function.py: -------------------------------------------------------------------------------- 1 | import json 2 | from kafka import KafkaConsumer 3 | 4 | def lambda_handler(event, context): 5 | 6 | consumer = KafkaConsumer('aws-lambda-topic', bootstrap_servers='35.189.130.4:9092') 7 | 8 | for message in consumer: 9 | return { 'statusCode': 200, 'body': json.dumps(str(message.value))} 10 | ~ 11 | -------------------------------------------------------------------------------- /projects/pico/producer-rpi/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fradelg/rpi-opencv 2 | 3 | MAINTAINER ajeetraina@gmail.com 4 | 5 | RUN apt-get update 6 | RUN apt install python-pip python3-pip 7 | RUN pip3 install pytz kafka-python 8 | RUN pip install virtualenv virtualenvwrapper 9 | RUN apt-get install -y git 10 | RUN git clone https://github.com/collabnix/pico 11 | WORKDIR pico/deployment/objects 12 | -------------------------------------------------------------------------------- /projects/pico/raspbi/README.md: -------------------------------------------------------------------------------- 1 | # Script to be run from Raspberry Pi Boxes 2 | -------------------------------------------------------------------------------- /projects/pico/raspbi/consumer-test.py: -------------------------------------------------------------------------------- 1 | 2 | # coding: utf-8 3 | 4 | # In[3]: 5 | 6 | 7 | import datetime 8 | from kafka import KafkaConsumer 9 | 10 | 11 | topic = "testpico" 12 | brokers = ["35.189.130.4:9092"] 13 | 14 | consumer = KafkaConsumer( 15 | topic, 16 | bootstrap_servers=brokers, 17 | value_deserializer=lambda m: json.loads(m.decode('utf-8'))) 18 | 19 | 20 | # In[4]: 21 | 22 | 23 | for msg in consumer: 24 | print(msg.value['frame']) 25 | 26 | 27 | # In[ ]: 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /projects/pico/raspbi/consumer.py: -------------------------------------------------------------------------------- 1 | import datetime 2 | import json 3 | import base64 4 | from flask import Flask, Response, render_template 5 | from kafka import KafkaConsumer 6 | 7 | # Fire up the Kafka Consumer 8 | topic = "testpico" 9 | brokers = ["35.189.130.4:9092"] 10 | 11 | consumer = KafkaConsumer( 12 | topic, 13 | bootstrap_servers=brokers, 14 | value_deserializer=lambda m: json.loads(m.decode('utf-8')) 15 | 16 | 17 | # Set the consumer in a Flask App 18 | app = Flask(__name__) 19 | 20 | @app.route('/') 21 | def index(): 22 | return render_template('index.html') 23 | 24 | @app.route('/video_feed', methods=['GET']) 25 | def video_feed(): 26 | """ 27 | This is the heart of our video display. Notice we set the mimetype to 28 | multipart/x-mixed-replace. This tells Flask to replace any old images with 29 | new values streaming through the pipeline. 30 | """ 31 | return Response( 32 | get_video_stream(), 33 | mimetype='multipart/x-mixed-replace; boundary=frame') 34 | 35 | def get_video_stream(): 36 | """ 37 | Here is where we recieve streamed images from the Kafka Server and convert 38 | them to a Flask-readable format. 39 | """ 40 | for msg in consumer: 41 | yield (b'--frame\r\n' 42 | b'Content-Type: image/jpg\r\n\r\n' + base64.b64decode(msg.value['image_bytes']) + b'\r\n\r\n') 43 | 44 | if __name__ == "__main__": 45 | app.run(host='0.0.0.0', debug=True) 46 | -------------------------------------------------------------------------------- /projects/pico/rtmp/images/README.md: -------------------------------------------------------------------------------- 1 | # Images 2 | -------------------------------------------------------------------------------- /projects/pico/rtmp/images/pico2.0.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/rtmp/images/pico2.0.jpeg -------------------------------------------------------------------------------- /projects/pico/rtmp/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes auto; 2 | rtmp_auto_push on; 3 | events {} 4 | rtmp { 5 | server { 6 | listen 1935; 7 | listen [::]:1935 ipv6only=on; 8 | 9 | application live { 10 | live on; 11 | record off; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /projects/pico/testing/.ipynb_checkpoints/consumer-test-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /projects/pico/testing/.ipynb_checkpoints/producer-test-checkpoint.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [], 3 | "metadata": {}, 4 | "nbformat": 4, 5 | "nbformat_minor": 2 6 | } 7 | -------------------------------------------------------------------------------- /projects/pico/testing/templates/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Video Streaming Demonstration 4 | 5 | 6 |

Video Streaming Demonstration

7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /projects/pico/workshop/README.md: -------------------------------------------------------------------------------- 1 | # Workshop on Pico - Object Detection & Analytics using Docker, Raspberry Pi & AWS Rekognition Service 2 | 3 | ![Image](https://github.com/collabnix/pico/blob/master/workshop/images/pico123.png) 4 | 5 | ## Docker on Raspberry Pi 6 | 7 | - [Preparing Your Raspberry Pi](https://github.com/collabnix/pico/blob/master/workshop/preparing-raspberrypi.md) 8 | - [Installing Docker on Raspberry Pi](https://github.com/collabnix/pico/blob/master/workshop/installing-docker.md) 9 | - [Turn Your Raspberry Pi into CCTV Camera using Docker container](https://github.com/collabnix/pico/blob/master/workshop/turn-your-raspberrypi-into-camera.md) 10 | 11 | 12 | ## Apache Kafka on AWS Cloud 13 | 14 | - [Setting up 2-Node Docker Swarm Cluster on AWS Cloud](https://github.com/collabnix/pico/blob/master/workshop/setting-up-docker-swarm-on-aws.md) 15 | - [Building Apache Kafka on 2-Node Docker Swarm Cluster](https://github.com/collabnix/pico/blob/master/workshop/running-kafka-on-swarm-cluster.md) 16 | 17 | 18 | ## Setting up Pico 19 | 20 | - [Running Consumer Scripts on AWS Cloud Instance](https://github.com/collabnix/pico/blob/master/workshop/running-consumer-script.md) 21 | - [Running Producer Script on Raspberry Pi](https://github.com/collabnix/pico/blob/master/workshop/running-producer-script-on-pi.md) 22 | 23 | ## Testing Object Detection 24 | 25 | - [Performing Object Detection](https://github.com/collabnix/pico/blob/master/workshop/performing-object-detection.md) 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /projects/pico/workshop/images/README.md: -------------------------------------------------------------------------------- 1 | # Images goes here 2 | -------------------------------------------------------------------------------- /projects/pico/workshop/images/pico123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/pico/workshop/images/pico123.png -------------------------------------------------------------------------------- /projects/pico/workshop/performing-object-detection.md: -------------------------------------------------------------------------------- 1 | # Performing Object Detection 2 | 3 | ## Sequence of Scripts Execution 4 | 5 | ### Pre-requisite: 6 | 7 | - Ensure that Docker Swarm is up and running on AWS Cloud 8 | 9 | ### Sequence: 10 | 11 | - First run the Image_Processor Script on AWS Instance 12 | - Then run the Consumer.py Script on AWS Instance 13 | - Finally, run the Producer_camera.py script on Pi 14 | 15 | Place an object in front of camera module and watch out for both text as well as object detection under http://broker-ip:5000 16 | -------------------------------------------------------------------------------- /projects/pico/workshop/running-consumer-script.md: -------------------------------------------------------------------------------- 1 | # Running Consumer Script for Pico 2 | 3 | ## Run the below Docker container for preparing environment for Consumer scripts 4 | 5 | ``` 6 | docker run -d -p 5000:5000 ajeetraina/opencv4-python3 bash 7 | ``` 8 | 9 | ## Open up bash shell inside Docker Container 10 | 11 | ``` 12 | docker exec -it bash 13 | ``` 14 | 15 | ## Remove the existing Pico directory 16 | 17 | ``` 18 | rm -fr pico 19 | ``` 20 | 21 | ## Cloning the fresh Repository 22 | 23 | ``` 24 | #git clone https://github.com/collabnix/pico 25 | ``` 26 | 27 | ## Locating the right consumer scripts 28 | 29 | You will need 2 scripts - Image Processor and Consumer 30 | 31 | ``` 32 | cd pico/deployment/objects/ 33 | ``` 34 | 35 | ## Execute Image processor Script 36 | 37 | This script is placed under https://github.com/collabnix/pico/blob/master/deployment/objects/image_processor.py location. 38 | Before you run this script, ensure that it has right AWS Access Key and Broker IP address 39 | 40 | ``` 41 | python3 image_processor.py 42 | ``` 43 | 44 | ## Open up new bash again 45 | 46 | ``` 47 | docker exec -it bash 48 | ``` 49 | 50 | ## Exexute Consumer Script 51 | 52 | This script is placed under https://github.com/collabnix/pico/blob/master/deployment/objects/ directory. 53 | Before you run this script, ensure that it has right Broker IP address 54 | 55 | ``` 56 | python3 consumer.py 57 | ``` 58 | -------------------------------------------------------------------------------- /projects/pico/workshop/running-producer-script-on-pi.md: -------------------------------------------------------------------------------- 1 | # Running Producer Script on Pi 2 | 3 | ## Clone the Repository 4 | 5 | ``` 6 | git clone https://github.com/collabnix/pico 7 | ``` 8 | 9 | ## Locating Producer Script 10 | 11 | ``` 12 | cd pico/deployment/objects/ 13 | ``` 14 | 15 | ## Edit producer_camera.py script and add the proper IP address for the kafka broker: 16 | 17 | ``` 18 | brokers = ["35.221.213.182:9092"] 19 | ``` 20 | 21 | ## Installing Dependencies 22 | 23 | ``` 24 | apt install -y python-pip libatlas-base-dev libjasper-dev libqtgui4 python3-pyqt5 python3-pyqt5 libqt4-test 25 | pip3 install kafka-python opencv-python pytz 26 | pip install virtualenv virtualenvwrapper numpy 27 | ``` 28 | 29 | ## Execute the script 30 | 31 | ``` 32 | python3 producer_camera.py 33 | ``` 34 | 35 | Please Note: This script should be run post the consumer scripts (Image_Processor & Consumer.py) is executed 36 | -------------------------------------------------------------------------------- /projects/pico/workshop/turn-your-raspberrypi-into-camera.md: -------------------------------------------------------------------------------- 1 | 2 | # Turn Your Raspberry Pi into CCTV Camera 3 | 4 | 5 | ## Cloning the Repository: 6 | 7 | 8 | ``` 9 | $ git clone https://github.com/collabnix/docker-cctv-raspbian 10 | ``` 11 | 12 | ## Building Docker Image 13 | 14 | ``` 15 | $ cd docker-cctv-raspbian 16 | $ docker build -t collabnix/docker-cctv-raspbian . 17 | ``` 18 | 19 | ## Configuring Camera Interface 20 | 21 | Before you execute run.sh, you need to configure Camera Interface by running the below command: 22 | 23 | ``` 24 | $sudo raspi-config 25 | ``` 26 | 27 | It will open up command-line UI window, choose Interfacing , select Camera and enable it. Save and exit the CLI window. 28 | 29 | ## Running the Docker container 30 | 31 | Before you execute run.sh, you will need to load the required driver “bcm2835-v412” to make your camera module work. If you miss this step, you will end up seeing a blank screen even though the application comes up without any issue. 32 | 33 | ``` 34 | $ sudo modprobe bcm2835-v4l2 35 | ``` 36 | 37 | ``` 38 | $sudo sh run.sh 39 | ``` 40 | 41 | That’s it. Browse over to http://:8082(either using Win Laptop or macbook) to open up CCTV cam which initiates the video streaming instantly. Cool, isn’t it? 42 | 43 | 44 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | arduino_secrets.h 3 | .DS_Store 4 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/.env: -------------------------------------------------------------------------------- 1 | FLASK_APP=main.py 2 | FLASK_ENV=development 3 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/.gitignore: -------------------------------------------------------------------------------- 1 | venv 2 | __pycache__ 3 | static/captured-images/* 4 | 5 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/README.md: -------------------------------------------------------------------------------- 1 | Image Server 2 | 3 | Accepts raw grayscale image data via HTTP POST and save as a jpg into the static directory. 4 | 5 | Create a virtual environment 6 | 7 | python3 -m venv venv 8 | 9 | Activate 10 | 11 | . venv/bin/activate 12 | 13 | Install requirements 14 | 15 | pip install -r requirements.txt 16 | 17 | Run the server 18 | 19 | flask run --host=0.0.0.0 20 | 21 | Post a file to test 22 | 23 | curl -vv --data-binary "@test.raw" http://localhost:5000/tf/96/96/0/255 24 | 25 | Look in static for the resulting jpg file 26 | 27 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/generate_image.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Chariot Solutions Inc. (https://chariotsolutions.com) 3 | and ARM (https://arm.com) All Rights Reserved. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | ==============================================================================*/ 17 | 18 | 19 | const fs = require('fs') 20 | const width = 96 21 | const height = 96 22 | const buffer = Buffer.alloc(width * height) 23 | 24 | // draw some stripes 25 | for (let i = 0; i < (width * height); i += 16) { 26 | buffer.writeBigUInt64LE(0xFFFFFFFFFFFFFFFFn, i) 27 | } 28 | 29 | fs.writeFileSync('./test.raw', buffer); 30 | 31 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/requirements.txt: -------------------------------------------------------------------------------- 1 | flask 2 | python-dotenv 3 | Pillow -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: / 3 | 4 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/static/site-images/Arm_logo_blue_150MD.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/portenta_person_detection/image-server/static/site-images/Arm_logo_blue_150MD.png -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/static/site-images/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/portenta_person_detection/image-server/static/site-images/placeholder.png -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/test.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/portenta_person_detection/image-server/test.raw -------------------------------------------------------------------------------- /projects/portenta_person_detection/image-server/wsgi.py: -------------------------------------------------------------------------------- 1 | from dotenv import load_dotenv 2 | load_dotenv() 3 | 4 | from main import app 5 | 6 | if __name__ == "__main__": 7 | app.run() 8 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .idea/ 3 | .idea/* 4 | config.h 5 | 6 | 7 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/ImageCropper.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Chariot Solutions Inc. (https://chariotsolutions.com) 3 | and ARM (https://arm.com) All Rights Reserved. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | ==============================================================================*/ 17 | 18 | #ifndef IMAGE_CROPPER_H 19 | #define IMAGE_CROPPER_H 20 | 21 | class ImageCropper 22 | { 23 | 24 | private: 25 | int get_one_dim_pixel_index(int col, int row, int row_width) ; 26 | int8_t get_source_pixel(uint8_t *source, int source_width, int col, int row); 27 | void set_dest_pixel(uint8_t *dest, int dest_width, int col, int row, uint8_t value) ; 28 | 29 | public: 30 | void crop_image(uint8_t *source, int source_width, int source_height, uint8_t *dest, int dest_width, int dest_height); 31 | }; 32 | 33 | #endif // IMAGE_CROPPER_H 34 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/ImageScaler.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Chariot Solutions Inc. (https://chariotsolutions.com) 3 | and ARM (https://arm.com) All Rights Reserved. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | ==============================================================================*/ 17 | 18 | #ifndef IMAGE_SCALER_H 19 | #define IMAGE_SCALER_H 20 | 21 | class ImageScaler 22 | { 23 | private: 24 | int get_one_dim_pixel_index(int col, int row, int row_width); 25 | int8_t get_souurce_pixel(uint8_t *source, int col, int row, int source_width); 26 | void set_dest_pixel(uint8_t *dest, int col, int row, int dest_width, uint8_t value); 27 | 28 | public: 29 | int scale_image_down(uint8_t *largeImage, int large_width, int large_height, uint8_t *scaledImage, int scaled_width, int scaled_height); 30 | }; 31 | 32 | #endif // IMAGE_SCALER_H 33 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/ImageSender.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Chariot Solutions Inc. (https://chariotsolutions.com) 3 | and ARM (https://arm.com) All Rights Reserved. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | ==============================================================================*/ 17 | 18 | #ifndef PERSON_DETECTION_IMAGESENDER_H 19 | #define PERSON_DETECTION_IMAGESENDER_H 20 | 21 | #include "tensorflow/lite/c/common.h" 22 | #include "tensorflow/lite/micro/micro_error_reporter.h" 23 | 24 | class ImageSender 25 | { 26 | private: 27 | void print_wifi_status(tflite::ErrorReporter* error_reporter); 28 | 29 | public: 30 | TfLiteStatus connect_to_wifi(tflite::ErrorReporter* error_reporter); 31 | TfLiteStatus send_image(tflite::ErrorReporter* error_reporter, const uint8_t *image, int width, int height, int person_score, int no_person_score); 32 | }; 33 | 34 | 35 | #endif //PERSON_DETECTION_IMAGESENDER_H 36 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/cmake-build-debug/CMakeFiles/clion-log.txt: -------------------------------------------------------------------------------- 1 | CMakeLists.txt not found in /Users/rfreedman/projects/ARM/arm-developer/projects/portenta_person_detection/person_detection Select CMakeLists.txt 2 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/config.h.template: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Chariot Solutions Inc. (https://chariotsolutions.com) 3 | and ARM (https://arm.com) All Rights Reserved. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | ==============================================================================*/ 17 | 18 | 19 | /* 20 | * Put your wifi access point credentials here and save as config.h 21 | * DO NOT commit config.h to version control 22 | * DO NOT save / commit this file with password present 23 | */ 24 | 25 | #ifndef PERSON_DETECTION_CONFIG_H 26 | #define PERSON_DETECTION_CONFIG_H 27 | 28 | #define WIFI_SSID "SSID" 29 | #define WIFI_PASS "PASS" 30 | #define SERVER_IP_ADDRESS "0.0.0.0" 31 | 32 | #endif // PERSON_DETECTION_CONFIG_H 33 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/main_functions.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ 17 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ 18 | 19 | // Expose a C friendly interface for main functions. 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | // Initializes all data needed for the example. The name is important, and needs 25 | // to be setup() for Arduino compatibility. 26 | void setup(); 27 | 28 | // Runs one iteration of data gathering and inference. This should be called 29 | // repeatedly from the application code. The name needs to be loop() for Arduino 30 | // compatibility. 31 | void loop(); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MAIN_FUNCTIONS_H_ 38 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/model_settings.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "model_settings.h" 17 | 18 | const char* kCategoryLabels[kCategoryCount] = { 19 | "unused", 20 | "person", 21 | "notperson", 22 | }; 23 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/model_settings.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MODEL_SETTINGS_H_ 17 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MODEL_SETTINGS_H_ 18 | 19 | // Keeping these as constant expressions allow us to allocate fixed-sized arrays 20 | // on the stack for our working memory. 21 | 22 | // All of these values are derived from the values used during model training, 23 | // if you change your model you'll need to update these constants. 24 | constexpr int kNumCols = 96; 25 | constexpr int kNumRows = 96; 26 | constexpr int kNumChannels = 1; 27 | 28 | constexpr int kMaxImageSize = kNumCols * kNumRows * kNumChannels; 29 | 30 | constexpr int kCategoryCount = 3; 31 | constexpr int kPersonIndex = 1; 32 | constexpr int kNotAPersonIndex = 2; 33 | extern const char* kCategoryLabels[kCategoryCount]; 34 | 35 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_MODEL_SETTINGS_H_ 36 | -------------------------------------------------------------------------------- /projects/portenta_person_detection/person_detection/person_detect_model_data.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | // This is a standard TensorFlow Lite model file that has been converted into a 17 | // C data array, so it can be easily compiled into a binary for devices that 18 | // don't have a file system. It was created using the command: 19 | // xxd -i person_detect.tflite > person_detect_model_data.cc 20 | 21 | #ifndef TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 22 | #define TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 23 | 24 | extern const unsigned char g_person_detect_model_data[]; 25 | extern const int g_person_detect_model_data_len; 26 | 27 | #endif // TENSORFLOW_LITE_MICRO_EXAMPLES_PERSON_DETECTION_PERSON_DETECT_MODEL_DATA_H_ 28 | -------------------------------------------------------------------------------- /projects/python-wheels/README.md: -------------------------------------------------------------------------------- 1 | # Python 2 | 3 | ## Table of Contents 4 | 5 | - [Python Wheels](multi-platform.md) 6 | 7 | 8 | -------------------------------------------------------------------------------- /projects/redis_benchmark/create_cluster.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | source terraform_variables.sh 6 | 7 | RED='\033[0;31m' 8 | GREEN="\033[0;92m" 9 | NC='\033[0m' # No Color 10 | 11 | if [[ "$1" == "create" ]]; then 12 | OPERATION="apply" 13 | MESSAGE="Creating" 14 | COLOUR=$GREEN 15 | elif [[ "$1" == "destroy" ]]; then 16 | OPERATION="destroy" 17 | MESSAGE="Destroying" 18 | COLOUR=$RED 19 | else 20 | echo -e "${RED}First argument has to be [create|destroy]${NC}" 21 | exit -1 22 | fi 23 | 24 | #statements 25 | if [[ "$2" == "x86" ]]; then 26 | echo -e "${COLOUR} $MESSAGE x86 cluster...${NC}" 27 | bash -c "terraform $OPERATION $TERRAFORM_VARS_X86" 28 | elif [[ "$2" == "aarch64" ]]; then 29 | echo -e "${COLOUR} $MESSAGE aarch64 cluster...${NC}" 30 | bash -c "terraform $OPERATION $TERRAFORM_VARS_ARM" 31 | else 32 | echo -e "${RED}Second argument has to be [x86|aarch64]${NC}" 33 | exit -1 34 | fi 35 | -------------------------------------------------------------------------------- /projects/redis_benchmark/download_bench_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | REDIS_MEMTIER_IP=$(head -n 1 REDIS_MEMTIER_ADDRESSES | tr -s '\n') 6 | 7 | scp -i "" ubuntu@$REDIS_MEMTIER_IP:* $1 8 | -------------------------------------------------------------------------------- /projects/redis_benchmark/ssh_redis_memtier.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | REDIS_MEMTIER_IP=$(head -n 1 REDIS_MEMTIER_ADDRESSES | tr -s '\n' ' ') 4 | 5 | ssh -i "" -o StrictHostKeyChecking=no ubuntu@$REDIS_MEMTIER_IP 6 | -------------------------------------------------------------------------------- /projects/redis_benchmark/ssh_redis_server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | REDIS_SERVER_IP=$(head -n 1 REDIS_SERVER_ADDRESSES | tr -s '\n' ' ') 4 | 5 | ssh -i "" -o StrictHostKeyChecking=no ubuntu@$REDIS_SERVER_IP 6 | -------------------------------------------------------------------------------- /projects/redis_benchmark/terraform_variables.sh: -------------------------------------------------------------------------------- 1 | AARCH64_INSTANCE_TYPE="r6g" 2 | X86_INSTANCE_TYPE="r5" 3 | INSTANCE_SIZE="2xlarge" 4 | VPC="" 5 | AWS_KEY_NAME="" 6 | 7 | TERRAFORM_VARS_X86="-var=\"instance_type=$X86_INSTANCE_TYPE\" -var=\"instance_size=$INSTANCE_SIZE\" -var=\"vpc=$VPC\" -var=\"ami_id=ami-08962a4068733a2b6\" -var=\"key_name=$AWS_KEY_NAME\"" 8 | TERRAFORM_VARS_ARM="-var=\"instance_type=$AARCH64_INSTANCE_TYPE\" -var=\"instance_size=$INSTANCE_SIZE\" -var=\"vpc=$VPC\" -var=\"ami_id=ami-064446ad1d755489e\" -var=\"key_name=$AWS_KEY_NAME\"" 9 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/.gitignore: -------------------------------------------------------------------------------- 1 | ################### 2 | ## Java Ignores 3 | ################### 4 | *.class 5 | 6 | # Mobile Tools for Java (J2ME) 7 | .mtj.tmp/ 8 | 9 | # Package Files # 10 | *.jar 11 | *.war 12 | *.ear 13 | *.original 14 | 15 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 16 | hs_err_pid* 17 | 18 | ######################### 19 | ## Python Related Ignores 20 | ######################### 21 | *.pyc 22 | 23 | ####################### 24 | ## VIM related ignores 25 | ####################### 26 | *.swp 27 | *.swo 28 | 29 | ##################### 30 | ## Terraform ignores 31 | ##################### 32 | *.tfstate 33 | *.tfstate.lock.info 34 | *.tfstate.backup 35 | *.tfstate.*.backup 36 | *.terraform.lock.hcl 37 | **/.terraform 38 | 39 | ##################### 40 | ## installer ignores 41 | ##################### 42 | *.deb 43 | *.rpm 44 | *.tgz 45 | 46 | ##################### 47 | ## Prevent accidental merge of keys 48 | ##################### 49 | *.key 50 | *.pem 51 | 52 | ##################### 53 | ## Ignore temp files 54 | ##################### 55 | **/splunk_ent_ip 56 | **/host 57 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/Arm_Splunk_Diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/Arm_Splunk_Diagram.jpg -------------------------------------------------------------------------------- /projects/splunk_edge_demo/Partial_Dashboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/Partial_Dashboard.jpg -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/Arm_logo_blue_150MN.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/Arm_logo_blue_150MN.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_allblack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_allblack.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_allwhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_allwhite.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_black.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_black.gif -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_black.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_white.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_white.gif -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/appLogo_white.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/bg_hash_grey.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/bg_hash_grey.gif -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/loader.gif -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_10.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_18.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_large.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_bottomgradient_soft.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_glass_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_glass_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gloss_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gloss_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_25.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_4.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_gradient_50.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_innerleftshadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_innerleftshadow.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_innershadow_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_innershadow_4.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradient_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradient_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradient_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradient_4.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradient_light_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradient_light_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradientridge_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_reversegradientridge_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_softgradient_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_softgradient_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_togradient_large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_togradient_large.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topInnerShadow_35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topInnerShadow_35.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topgradient.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topgradient.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topgradient_beige_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topgradient_beige_soft.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topgradient_soft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_topgradient_soft.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_white_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_white_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_whiteridge_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/overlay_whiteridge_28.png -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/splIcons.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ARM-software/developer/4c90e9d9cd801dbf0e688e67c8bcca1c6a60503e/projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/appserver/static/splIcons.gif -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/bin/readme.txt: -------------------------------------------------------------------------------- 1 | This is where you put any scripts you want to add to this app. -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/default/app.conf: -------------------------------------------------------------------------------- 1 | # Splunk app configuration file 2 | 3 | [install] 4 | is_configured = 0 5 | 6 | [ui] 7 | is_visible = 1 8 | label = Edge Sensor Demo 9 | 10 | [launcher] 11 | author = Arm 12 | description = Edge Sensor Demo 13 | version = 1.0.0 14 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/local/app.conf: -------------------------------------------------------------------------------- 1 | [ui] 2 | 3 | [launcher] 4 | 5 | [package] 6 | check_for_updates = 1 7 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/local/data/ui/nav/default.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/local/readme.txt: -------------------------------------------------------------------------------- 1 | This is where you put all your configs for this app. Splunk Web will write out configs here, too. 2 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/metadata/default.meta: -------------------------------------------------------------------------------- 1 | [] 2 | access = read : [ * ], write : [ admin, power ] 3 | export = none 4 | 5 | [tags] 6 | export = system 7 | 8 | [props] 9 | export = system 10 | 11 | [transforms] 12 | export = system 13 | 14 | [lookups] 15 | export = system 16 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_apps/edge_sensor_demo/metadata/local.meta: -------------------------------------------------------------------------------- 1 | [app/ui] 2 | version = 8.2.1 3 | modtime = 1631214224.816075000 4 | 5 | [app/launcher] 6 | version = 8.2.1 7 | modtime = 1631214224.816825000 8 | 9 | [app/package/check_for_updates] 10 | version = 8.2.1 11 | modtime = 1631214224.817080000 12 | 13 | [views/edge_sensor_demo_dash] 14 | owner = admin 15 | version = 8.2.1 16 | modtime = 1631652745.846923000 17 | 18 | [nav/default] 19 | version = 8.2.1 20 | modtime = 1631214940.551159000 21 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_config/web.conf: -------------------------------------------------------------------------------- 1 | [settings] 2 | # this determines whether to start SplunkWeb in http or https. 3 | enableSplunkWebSSL = true 4 | 5 | # SSL certificate files for admin acces to web gui. 6 | privKeyPath = /opt/splunk/etc/auth/mycerts/mySplunkWebPrivateKey.key 7 | serverCert = /opt/splunk/etc/auth/mycerts/mySplunkWebCertificate.pem 8 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_deployment_apps/edge_array_input/default/inputs.conf: -------------------------------------------------------------------------------- 1 | [monitor:///var/log/sensor_data] 2 | disabled = 0 3 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_deployment_apps/edge_array_output/default/outputs.conf: -------------------------------------------------------------------------------- 1 | [tcpout] 2 | defaultGroup = default-autolb-group 3 | 4 | [tcpout:default-autolb-group] 5 | server = splunk_ent_ip:9997 6 | 7 | [tcpout-server://splunk_ent_ip:9997] 8 | clientCert = /opt/splunkforwarder/etc/auth/mycerts/mySplunkIndexCertificate.pem 9 | useClientSSLCompression = true 10 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_inputs/inputs.conf: -------------------------------------------------------------------------------- 1 | [splunktcp://9997] 2 | disabled = 1 3 | 4 | [splunktcp-ssl://9997] 5 | disabled = 0 6 | 7 | # This is for forwarder data encryption 8 | [SSL] 9 | serverCert = /opt/splunk/etc/auth/mycerts/mySplunkIndexCertificate.pem 10 | requireClientCert = false 11 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/splunk_user/user-seed.conf: -------------------------------------------------------------------------------- 1 | [user_info] 2 | USERNAME = admin 3 | PASSWORD = 4 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/terraform/tf-compute/compute.tf: -------------------------------------------------------------------------------- 1 | # Splunk enterprise instance(s) 2 | resource "aws_instance" "splunk_instances" { 3 | # Assign the type, ami and name of each instance. 4 | # migrated tags are for credits with AWS 5 | instance_type = var.enterprise_instance_type 6 | ami = var.enterprise_instance_ami 7 | availability_zone = var.instance_az 8 | tags = { 9 | Name = "arm-splunk-demo", 10 | } 11 | 12 | # Network 13 | subnet_id = aws_subnet.splunk_demo_subnet.id 14 | associate_public_ip_address = true 15 | 16 | # Security & SSH 17 | vpc_security_group_ids = [ 18 | aws_security_group.splunk_allow_ssh.id, 19 | aws_security_group.splunk_allow_egress.id, 20 | aws_security_group.splunk_allow_ui.id, 21 | aws_security_group.splunk_allow_deployment_clients.id, 22 | aws_security_group.splunk_receiver.id 23 | ] 24 | key_name = var.aws_key 25 | 26 | # Storage 27 | root_block_device { 28 | volume_size = 100 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/terraform/tf-compute/network.tf: -------------------------------------------------------------------------------- 1 | # Create our VPC 2 | resource "aws_vpc" "splunk_demo_vpc" { 3 | cidr_block = "10.0.0.0/16" 4 | tags = { 5 | Name = "splunk-demo-vpc" 6 | } 7 | } 8 | 9 | # Create a subnet in the VPC 10 | resource "aws_subnet" "splunk_demo_subnet" { 11 | vpc_id = aws_vpc.splunk_demo_vpc.id 12 | cidr_block = "10.0.0.0/16" 13 | availability_zone = var.instance_az 14 | tags = { 15 | Name = "splunk-demo-subnet" 16 | } 17 | } 18 | 19 | # Create and connect internet gateway to the VPC 20 | resource "aws_internet_gateway" "splunk_int_gw" { 21 | vpc_id = aws_vpc.splunk_demo_vpc.id 22 | tags = { 23 | Name = "splunk-demo-intgw" 24 | } 25 | } 26 | 27 | # Create a routing table that routes towards the internet gateway 28 | resource "aws_route_table" "splunk_demo_route_table" { 29 | vpc_id = aws_vpc.splunk_demo_vpc.id 30 | route { 31 | cidr_block = "0.0.0.0/0" 32 | gateway_id = aws_internet_gateway.splunk_int_gw.id 33 | } 34 | 35 | tags = { 36 | Name = "splunk-demo-route-table" 37 | } 38 | } 39 | 40 | # Associate the internet gateway with the subnet created above via the route table created above 41 | resource "aws_route_table_association" "splunk_gateway_association" { 42 | subnet_id = aws_subnet.splunk_demo_subnet.id 43 | route_table_id = aws_route_table.splunk_demo_route_table.id 44 | } 45 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/terraform/tf-compute/output.tf: -------------------------------------------------------------------------------- 1 | # Splunk enterprise host IP(s) 2 | output "splunk_host_ips" { 3 | value = aws_instance.splunk_instances.public_ip 4 | } 5 | 6 | resource "local_file" "splunk_ips" { 7 | content = aws_instance.splunk_instances.public_ip 8 | filename = "../../ansible/host" 9 | } 10 | 11 | resource "local_file" "splunk_ent_ip" { 12 | content = aws_instance.splunk_instances.public_ip 13 | filename = "../../../fwd/ansible/splunk_ent_ip" 14 | } 15 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/terraform/tf-compute/provider.tf: -------------------------------------------------------------------------------- 1 | terraform { 2 | required_providers { 3 | aws = { 4 | source = "hashicorp/aws" 5 | version = "~> 3.0" 6 | } 7 | } 8 | } 9 | 10 | ####################################### 11 | # Providers 12 | ####################################### 13 | # Tells terraform to use the aws APIs 14 | provider "aws" { 15 | region = var.aws_region 16 | profile = "default" 17 | } 18 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/enterprise/terraform/tf-compute/variables.tf: -------------------------------------------------------------------------------- 1 | ###################################################################### 2 | # Variables related to general setup of the infrastructure 3 | ###################################################################### 4 | variable "aws_region" { 5 | description = "The AWS region we want to deploy on." 6 | type = string 7 | default = "us-east-1" 8 | } 9 | 10 | ################################### 11 | # Variable related to instance deployment 12 | ################################### 13 | variable "enterprise_instance_ami" { 14 | description = "The AMI to use for enterprise_instance_type" 15 | type = string 16 | default = "ami-09e67e426f25ce0d7" 17 | } 18 | 19 | variable "enterprise_instance_type" { 20 | description = "The EC2 instance type to use for splunk enterprise" 21 | type = string 22 | default = "m6i.large" 23 | } 24 | 25 | variable "instance_az" { 26 | description = "Availability Zone we want for splunk" 27 | type = string 28 | default = "us-east-1a" 29 | } 30 | 31 | variable "ingress_ips" { 32 | description = "A list of IP address we will allow to connect to the splunk instance(s), 0.0.0.0/0 is all ips. all ips is ok for debug, but don't use it for demos" 33 | type = list(string) 34 | default = [""] 35 | } 36 | 37 | variable "aws_key" { 38 | description = "The AWS public key to push into the instances for SSH/SCP." 39 | type = string 40 | default = "" 41 | } 42 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/fwd/ansible/hosts: -------------------------------------------------------------------------------- 1 | Edge device IP addresses in ansible inventory format 2 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/fwd/local/deploymentclient.conf: -------------------------------------------------------------------------------- 1 | [deployment-client] 2 | clientName = EdgeArray-00 3 | phoneHomeIntervalInSecs = 10 4 | 5 | [target-broker:deploymentServer] 6 | targetUri = splunk_ent_ip:8089 7 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/fwd/local/user-seed.conf: -------------------------------------------------------------------------------- 1 | [user_info] 2 | USERNAME = admin 3 | PASSWORD = 4 | -------------------------------------------------------------------------------- /projects/splunk_edge_demo/python/read_sensors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from i2cdriver import I2CDriver 3 | from bme680 import BME680 4 | from tsl2591 import TSL2591 5 | from time import sleep 6 | from datetime import datetime 7 | 8 | 9 | def main(): 10 | print("Polling All Sensors") 11 | i2c = I2CDriver("/dev/ttyUSB0") 12 | i2c.scan() # Reset all devices on the i2c bus 13 | tphg_sensor = BME680(i2c) 14 | als_sensor = TSL2591(i2c) 15 | 16 | # Clear the sensor data file 17 | with open('/var/log/sensor_data', 'w') as sensor_data_file: 18 | sensor_data_file.write('') 19 | 20 | while True: 21 | sleep(4) 22 | tphg = tphg_sensor.get_measurement() 23 | als = als_sensor.get_measurement() 24 | print("Temp (F), Press (pa), Hum (%), VOC (ohm): {}".format(tphg)) 25 | print("Light (integral): {}\n".format(als)) 26 | 27 | # Get event count count 28 | with open('/var/log/sensor_data') as f: 29 | count = sum(1 for _ in f) 30 | 31 | read_write = 'w' if count > 36000 else 'a' # Overwrite file is event count exceeds 36000 (about 48hrs) 32 | with open('/var/log/sensor_data', read_write) as sensor_data_file: 33 | sensor_data_file.write( 34 | "time={},temperature={},pressure={},humidity={},\ 35 | voc={},als-inf-vis={},als-inf={}\n".format(datetime.now(), tphg[0], tphg[1], tphg[2], 36 | tphg[3], als[0], als[1])) 37 | 38 | 39 | if __name__ == "__main__": 40 | main() 41 | --------------------------------------------------------------------------------