Merge pull request 'tflite application licence small modification' (#25) from Gumeijie/xiuos:gmj_work into master

This commit is contained in:
leebaok 2021-04-30 14:05:41 +08:00
commit 3ba05d0a71
13 changed files with 74 additions and 9 deletions

View File

@ -15,7 +15,7 @@
* @brief: using zigbee to receive message * @brief: using zigbee to receive message
* @version: 1.0 * @version: 1.0
* @author: AIIT XUOS Lab * @author: AIIT XUOS Lab
* @date: 2020/4/25 * @date: 2021/4/30
* *
*/ */
#include <xs_adapter_zigbee.h> #include <xs_adapter_zigbee.h>

View File

@ -15,7 +15,7 @@
* @brief: using zigbee to send message * @brief: using zigbee to send message
* @version: 1.0 * @version: 1.0
* @author: AIIT XUOS Lab * @author: AIIT XUOS Lab
* @date: 2020/4/25 * @date: 2021/4/30
* *
*/ */
#include <xs_adapter_zigbee.h> #include <xs_adapter_zigbee.h>

View File

@ -9,6 +9,15 @@
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details. * See the Mulan PSL v2 for more details.
*/ */
/**
* @file: digit.h
* @brief: store digits in this file
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2021/4/30
*
*/
const float mnist_digit[] = { const float mnist_digit[] = {
0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,

View File

@ -9,6 +9,15 @@
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details. * See the Mulan PSL v2 for more details.
*/ */
/**
* @file: mnistapp.cpp
* @brief: mnist function
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2021/4/30
*
*/
#include <xiuos.h> #include <xiuos.h>
#include "tensorflow/lite/micro/all_ops_resolver.h" #include "tensorflow/lite/micro/all_ops_resolver.h"

View File

@ -9,6 +9,16 @@
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details. * See the Mulan PSL v2 for more details.
*/ */
/**
* @file: mnistmain.c
* @brief: start mnist function
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2021/4/30
*
*/
#include <xiuos.h> #include <xiuos.h>
void mnist_app(void); void mnist_app(void);

View File

@ -9,6 +9,15 @@
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details. * See the Mulan PSL v2 for more details.
*/ */
/**
* @file: model.h
* @brief: store model weights in this file
* @version: 1.0
* @author: AIIT XUOS Lab
* @date: 2021/4/30
*
*/
unsigned char mnist_model[] = { unsigned char mnist_model[] = {
0x1c, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x14, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x14, 0x00, 0x20, 0x00,
0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00,

9
applications/tflite_mnist/tools/mnist-c-digit.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# ========================================================================================== # ==========================================================================================
# Copyright (c) 2020 AIIT XUOS Lab # Copyright (c) 2020 AIIT XUOS Lab
# XiOS is licensed under Mulan PSL v2. # XiOS is licensed under Mulan PSL v2.
@ -8,8 +9,14 @@
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, # EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details. # See the Mulan PSL v2 for more details.
# @file: mnist-c-digit.py
# @brief: print image digit at command line
# @version: 1.0
# @author: AIIT XUOS Lab
# @date: 2021/4/30
# ========================================================================================== # ==========================================================================================
#!/usr/bin/env python3
import tensorflow as tf import tensorflow as tf

9
applications/tflite_mnist/tools/mnist-c-model.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# ========================================================================================== # ==========================================================================================
# Copyright (c) 2020 AIIT XUOS Lab # Copyright (c) 2020 AIIT XUOS Lab
# XiOS is licensed under Mulan PSL v2. # XiOS is licensed under Mulan PSL v2.
@ -8,8 +9,14 @@
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, # EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details. # See the Mulan PSL v2 for more details.
# @file: mnist-c-model.py
# @brief: open file path and load model
# @version: 1.0
# @author: AIIT XUOS Lab
# @date: 2021/4/30
# ========================================================================================== # ==========================================================================================
#!/usr/bin/env python3
#tflite_file_path = 'mnist-default-quan.tflite' #tflite_file_path = 'mnist-default-quan.tflite'
tflite_file_path = 'mnist.tflite' tflite_file_path = 'mnist.tflite'

9
applications/tflite_mnist/tools/mnist-inference.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# ========================================================================================== # ==========================================================================================
# Copyright (c) 2020 AIIT XUOS Lab # Copyright (c) 2020 AIIT XUOS Lab
# XiOS is licensed under Mulan PSL v2. # XiOS is licensed under Mulan PSL v2.
@ -8,8 +9,14 @@
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, # EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details. # See the Mulan PSL v2 for more details.
# @file: mnist-inference.py
# @brief: load data amd start model omferemce
# @version: 1.0
# @author: AIIT XUOS Lab
# @date: 2021/4/30
# ========================================================================================== # ==========================================================================================
#!/usr/bin/env python3
import tensorflow as tf import tensorflow as tf

9
applications/tflite_mnist/tools/mnist-train.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
# ========================================================================================== # ==========================================================================================
# Copyright (c) 2020 AIIT XUOS Lab # Copyright (c) 2020 AIIT XUOS Lab
# XiOS is licensed under Mulan PSL v2. # XiOS is licensed under Mulan PSL v2.
@ -8,8 +9,14 @@
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, # EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. # MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more details. # See the Mulan PSL v2 for more details.
# @file: mnist-train.py
# @brief: model training
# @version: 1.0
# @author: AIIT XUOS Lab
# @date: 2021/4/30
# ========================================================================================== # ==========================================================================================
#!/usr/bin/env python3
import os import os
import tensorflow as tf import tensorflow as tf

View File

@ -15,7 +15,7 @@
* @brief: head file * @brief: head file
* @version: 1.0 * @version: 1.0
* @author: AIIT XUOS Lab * @author: AIIT XUOS Lab
* @date: 2020/4/25 * @date: 2021/4/25
* *
*/ */
#ifndef XS_ADAPTER_ZIGBEE_H #ifndef XS_ADAPTER_ZIGBEE_H

View File

@ -15,7 +15,7 @@
* @brief: register zigbee in initialization * @brief: register zigbee in initialization
* @version: 1.0 * @version: 1.0
* @author: AIIT XUOS Lab * @author: AIIT XUOS Lab
* @date: 2020/4/25 * @date: 2021/4/30
* *
*/ */
#include <xs_adapter_zigbee.h> #include <xs_adapter_zigbee.h>

View File

@ -15,7 +15,7 @@
* @brief: zigbee open close function * @brief: zigbee open close function
* @version: 1.0 * @version: 1.0
* @author: AIIT XUOS Lab * @author: AIIT XUOS Lab
* @date: 2020/4/25 * @date: 2021/4/30
* *
*/ */