merge codes

This commit is contained in:
wlyu
2022-03-09 16:06:27 +08:00
19792 changed files with 394267 additions and 4760751 deletions
+1 -1
View File
@@ -18,5 +18,5 @@ menu "Applications"
source "$APP_DIR/Applications/control_app/Kconfig"
source "$APP_DIR/Applications/knowing_app/Kconfig"
source "$APP_DIR/Applications/sensor_app/Kconfig"
source "$APP_DIR/Applications/embedded_database_app/Kconfig"
endmenu
+1 -1
View File
@@ -7,7 +7,7 @@ ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
endif
ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
SRC_DIR := general_functions app_test
SRC_FILES := main.c framework_init.c
+2 -2
View File
@@ -12,7 +12,7 @@ menu "test app"
bool "Config test adc"
default n
if USER_TEST_ADC
if ADD_XIUOS_FETURES
if ADD_XIZI_FETURES
config ADC_DEV_DRIVER
string "Set ADC dev path"
default "/dev/adc1_dev"
@@ -23,7 +23,7 @@ menu "test app"
bool "Config test dac"
default n
if USER_TEST_DAC
if ADD_XIUOS_FETURES
if ADD_XIZI_FETURES
config DAC_DEV_DRIVER
string "Set DAC dev path"
default "/dev/dac_dev"
@@ -31,7 +31,7 @@ void test_adc()
adc_fd = PrivOpen(ADC_DEV_DRIVER, O_RDWR);
if (adc_fd < 0) {
KPrintf("open adc fd error %d\n", adc_fd);
printf("open adc fd error %d\n", adc_fd);
return;
}
@@ -39,7 +39,7 @@ void test_adc()
ioctl_cfg.ioctl_driver_type = ADC_TYPE;
ioctl_cfg.args = &adc_channel;
if (0 != PrivIoctl(adc_fd, OPE_CFG, &ioctl_cfg)) {
KPrintf("ioctl adc fd error %d\n", adc_fd);
printf("ioctl adc fd error %d\n", adc_fd);
PrivClose(adc_fd);
return;
}
@@ -42,7 +42,7 @@ Modification:
1. support spi flash open, read and write function
*************************************************/
#include <xiuos.h>
#include <xizi.h>
#include <device.h>
#include <flash_spi.h>
#include <user_api.h>
@@ -19,7 +19,7 @@
*/
#include <transform.h>
#include <xiuos.h>
#include <xizi.h>
#include "board.h"
#include "sys_arch.h"
#include <lwip/sockets.h>
@@ -18,7 +18,7 @@
* @date 2021-05-29
*/
#include <transform.h>
#include <xiuos.h>
#include <xizi.h>
#include "board.h"
#include "sys_arch.h"
#include "lwip/udp.h"
+1 -1
View File
@@ -10,7 +10,7 @@
* See the Mulan PSL v2 for more details.
*/
#include <xiuos.h>
#include <xizi.h>
#include <stdio.h>
#include <cstdlib>
using namespace std;
@@ -0,0 +1,6 @@
menuconfig USING_EMBEDDED_DATABASE_APP
bool "embedded database app"
default n
if USING_EMBEDDED_DATABASE_APP
source "$APP_DIR/Applications/embedded_database_app/flashdb_app/Kconfig"
endif
@@ -0,0 +1,14 @@
import os
Import('RTT_ROOT')
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(path, 'SConscript'))
Return('objs')
@@ -0,0 +1,5 @@
config EMBEDDED_DATABASE_FLASHDB_APP
bool "embedded database apps/flashdb(example)"
select USING_EMBEDDED_DATABASE
select USING_EMBEDDED_DATABASE_FLASHDB
default n
@@ -0,0 +1,9 @@
from building import *
cwd = GetCurrentDir()
src = Glob('*.c') + Glob('*.cpp')
CPPPATH = [cwd]
group = DefineGroup('flashdb(example)', src, depend = ['EMBEDDED_DATABASE_FLASHDB_APP'], LOCAL_CPPPATH = CPPPATH)
Return('group')
@@ -0,0 +1,129 @@
#include <transform.h>
#include <flashdb.h>
#define FDB_LOG_TAG "[flashdb_app]"
static pthread_mutex_t kv_locker, ts_locker;
static uint32_t boot_count = 0;
static time_t boot_time[10] = {0, 1, 2, 3};
/* default KV nodes */
static struct fdb_default_kv_node default_kv_table[] = {
{"username", "armink", 0}, /* string KV */
{"password", "123456", 0}, /* string KV */
{"boot_count", &boot_count, sizeof(boot_count)}, /* int type KV */
{"boot_time", &boot_time, sizeof(boot_time)}, /* int array type KV */
};
/* KVDB object */
static struct fdb_kvdb kvdb = { 0 };
/* TSDB object */
struct fdb_tsdb tsdb = { 0 };
/* counts for simulated timestamp */
static int counts = 0;
extern void kvdb_basic_sample(fdb_kvdb_t kvdb);
extern void kvdb_type_string_sample(fdb_kvdb_t kvdb);
extern void kvdb_type_blob_sample(fdb_kvdb_t kvdb);
extern void tsdb_sample(fdb_tsdb_t tsdb);
static void lock(fdb_db_t db)
{
pthread_mutex_lock((pthread_mutex_t *)db->user_data);
}
static void unlock(fdb_db_t db)
{
pthread_mutex_unlock((pthread_mutex_t *)db->user_data);
}
static fdb_time_t get_time(void)
{
return time(NULL);
}
int flashdb_app(void)
{
fdb_err_t result;
bool file_mode = true;
uint32_t sec_size = 4096, db_size = sec_size * 4;
#ifdef FDB_USING_KVDB
{ /* KVDB Sample */
struct fdb_default_kv default_kv;
default_kv.kvs = default_kv_table;
default_kv.num = sizeof(default_kv_table) / sizeof(default_kv_table[0]);
/* set the lock and unlock function if you want */
pthread_mutex_init(&kv_locker, NULL);
fdb_kvdb_control(&kvdb, FDB_KVDB_CTRL_SET_LOCK, (void *)lock);
fdb_kvdb_control(&kvdb, FDB_KVDB_CTRL_SET_UNLOCK, (void *)unlock);
/* set the sector and database max size */
fdb_kvdb_control(&kvdb, FDB_KVDB_CTRL_SET_SEC_SIZE, &sec_size);
fdb_kvdb_control(&kvdb, FDB_KVDB_CTRL_SET_MAX_SIZE, &db_size);
/* enable file mode */
fdb_kvdb_control(&kvdb, FDB_KVDB_CTRL_SET_FILE_MODE, &file_mode);
/* create database directory */
mkdir("fdb_kvdb1", 0777);
/* Key-Value database initialization
*
* &kvdb: database object
* "env": database name
* "fdb_kvdb1": The flash partition name base on FAL. Please make sure it's in FAL partition table.
* Please change to YOUR partition name.
* &default_kv: The default KV nodes. It will auto add to KVDB when first initialize successfully.
* &kv_locker: The locker object.
*/
result = fdb_kvdb_init(&kvdb, "env", "fdb_kvdb1", &default_kv, &kv_locker);
if (result != FDB_NO_ERR) {
return -1;
}
/* run basic KV samples */
kvdb_basic_sample(&kvdb);
/* run string KV samples */
kvdb_type_string_sample(&kvdb);
/* run blob KV samples */
kvdb_type_blob_sample(&kvdb);
}
#endif /* FDB_USING_KVDB */
#ifdef FDB_USING_TSDB
{ /* TSDB Sample */
/* set the lock and unlock function if you want */
pthread_mutex_init(&ts_locker, NULL);
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_LOCK, (void *)lock);
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_UNLOCK, (void *)unlock);
/* set the sector and database max size */
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_SEC_SIZE, &sec_size);
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_MAX_SIZE, &db_size);
/* enable file mode */
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_SET_FILE_MODE, &file_mode);
/* create database directory */
mkdir("fdb_tsdb1", 0777);
/* Time series database initialization
*
* &tsdb: database object
* "log": database name
* "fdb_tsdb1": The flash partition name base on FAL. Please make sure it's in FAL partition table.
* Please change to YOUR partition name.
* get_time: The get current timestamp function.
* 128: maximum length of each log
* ts_locker: The locker object.
*/
result = fdb_tsdb_init(&tsdb, "log", "fdb_tsdb1", get_time, 128, &ts_locker);
/* read last saved time for simulated timestamp */
fdb_tsdb_control(&tsdb, FDB_TSDB_CTRL_GET_LAST_TIME, &counts);
if (result != FDB_NO_ERR) {
return -1;
}
/* run TSDB sample */
tsdb_sample(&tsdb);
}
#endif /* FDB_USING_TSDB */
return 0;
}
#ifdef __RT_THREAD_H__
MSH_CMD_EXPORT(flashdb_app, flashdb test);
#endif
@@ -0,0 +1,50 @@
/*
* Copyright (c) 2020, Armink, <armink.ztl@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief basic KV samples.
*
* basic Key-Value Database KV feature samples
* get and show currnet boot counts
*/
#include <flashdb.h>
#ifdef FDB_USING_KVDB
#define FDB_LOG_TAG "[sample][kvdb][basic]"
void kvdb_basic_sample(fdb_kvdb_t kvdb)
{
struct fdb_blob blob;
int boot_count = 0;
FDB_INFO("==================== kvdb_basic_sample ====================\n");
{ /* GET the KV value */
/* get the "boot_count" KV value */
fdb_kv_get_blob(kvdb, "boot_count", fdb_blob_make(&blob, &boot_count, sizeof(boot_count)));
/* the blob.saved.len is more than 0 when get the value successful */
if (blob.saved.len > 0) {
FDB_INFO("get the 'boot_count' value is %d\n", boot_count);
} else {
FDB_INFO("get the 'boot_count' failed\n");
}
}
{ /* CHANGE the KV value */
/* increase the boot count */
boot_count ++;
/* change the "boot_count" KV's value */
fdb_kv_set_blob(kvdb, "boot_count", fdb_blob_make(&blob, &boot_count, sizeof(boot_count)));
FDB_INFO("set the 'boot_count' value to %d\n", boot_count);
}
FDB_INFO("===========================================================\n");
}
#endif /* FDB_USING_KVDB */
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2020, Armink, <armink.ztl@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief blob KV samples.
*
* Key-Value Database blob type KV feature samples
*/
#include <flashdb.h>
#ifdef FDB_USING_KVDB
#define FDB_LOG_TAG "[sample][kvdb][blob]"
void kvdb_type_blob_sample(fdb_kvdb_t kvdb)
{
struct fdb_blob blob;
FDB_INFO("==================== kvdb_type_blob_sample ====================\n");
{ /* CREATE new Key-Value */
int temp_data = 36;
/* It will create new KV node when "temp" KV not in database.
* fdb_blob_make: It's a blob make function, and it will return the blob when make finish.
*/
fdb_kv_set_blob(kvdb, "temp", fdb_blob_make(&blob, &temp_data, sizeof(temp_data)));
FDB_INFO("create the 'temp' blob KV, value is: %d\n", temp_data);
}
{ /* GET the KV value */
int temp_data = 0;
/* get the "temp" KV value */
fdb_kv_get_blob(kvdb, "temp", fdb_blob_make(&blob, &temp_data, sizeof(temp_data)));
/* the blob.saved.len is more than 0 when get the value successful */
if (blob.saved.len > 0) {
FDB_INFO("get the 'temp' value is: %d\n", temp_data);
}
}
{ /* CHANGE the KV value */
int temp_data = 38;
/* change the "temp" KV's value to 38 */
fdb_kv_set_blob(kvdb, "temp", fdb_blob_make(&blob, &temp_data, sizeof(temp_data)));
FDB_INFO("set 'temp' value to %d\n", temp_data);
}
{ /* DELETE the KV by name */
fdb_kv_del(kvdb, "temp");
FDB_INFO("delete the 'temp' finish\n");
}
FDB_INFO("===========================================================\n");
}
#endif /* FDB_USING_KVDB */
@@ -0,0 +1,63 @@
/*
* Copyright (c) 2020, Armink, <armink.ztl@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief string KV samples.
*
* Key-Value Database string type KV feature samples source file.
*/
#include <flashdb.h>
#include <string.h>
#ifdef FDB_USING_KVDB
#define FDB_LOG_TAG "[sample][kvdb][string]"
void kvdb_type_string_sample(fdb_kvdb_t kvdb)
{
FDB_INFO("==================== kvdb_type_string_sample ====================\n");
{ /* CREATE new Key-Value */
char temp_data[10] = "36C";
/* It will create new KV node when "temp" KV not in database. */
fdb_kv_set(kvdb, "temp", temp_data);
FDB_INFO("create the 'temp' string KV, value is: %s\n", temp_data);
}
{ /* GET the KV value */
char *return_value, temp_data[10] = { 0 };
/* Get the "temp" KV value.
* NOTE: The return value saved in fdb_kv_get's buffer. Please copy away as soon as possible.
*/
return_value = fdb_kv_get(kvdb, "temp");
/* the return value is NULL when get the value failed */
if (return_value != NULL) {
strncpy(temp_data, return_value, sizeof(temp_data));
FDB_INFO("get the 'temp' value is: %s\n", temp_data);
}
}
{ /* CHANGE the KV value */
char temp_data[10] = "38C";
/* change the "temp" KV's value to "38.1" */
fdb_kv_set(kvdb, "temp", temp_data);
FDB_INFO("set 'temp' value to %s\n", temp_data);
}
{ /* DELETE the KV by name */
fdb_kv_del(kvdb, "temp");
FDB_INFO("delete the 'temp' finish\n");
}
FDB_INFO("===========================================================\n");
}
#endif /* FDB_USING_KVDB */
@@ -0,0 +1,120 @@
/*
* Copyright (c) 2020, Armink, <armink.ztl@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief TSDB samples.
*
* Time series log (like TSDB) feature samples source file.
*
* TSL is time series log, the TSDB saved many TSLs.
*/
#include <flashdb.h>
#include <string.h>
#ifdef FDB_USING_TSDB
#define FDB_LOG_TAG "[sample][tsdb]"
struct env_status {
int temp;
int humi;
};
static bool query_cb(fdb_tsl_t tsl, void *arg);
static bool query_by_time_cb(fdb_tsl_t tsl, void *arg);
static bool set_status_cb(fdb_tsl_t tsl, void *arg);
void tsdb_sample(fdb_tsdb_t tsdb)
{
struct fdb_blob blob;
FDB_INFO("==================== tsdb_sample ====================\n");
{ /* APPEND new TSL (time series log) */
struct env_status status;
/* append new log to TSDB */
status.temp = 36;
status.humi = 85;
fdb_tsl_append(tsdb, fdb_blob_make(&blob, &status, sizeof(status)));
FDB_INFO("append the new status.temp (%d) and status.humi (%d)\n", status.temp, status.humi);
status.temp = 38;
status.humi = 90;
fdb_tsl_append(tsdb, fdb_blob_make(&blob, &status, sizeof(status)));
FDB_INFO("append the new status.temp (%d) and status.humi (%d)\n", status.temp, status.humi);
}
{ /* QUERY the TSDB */
/* query all TSL in TSDB by iterator */
fdb_tsl_iter(tsdb, query_cb, tsdb);
}
{ /* QUERY the TSDB by time */
/* prepare query time (from 1970-01-01 00:00:00 to 2020-05-05 00:00:00) */
struct tm tm_from = { .tm_year = 1970 - 1900, .tm_mon = 0, .tm_mday = 1, .tm_hour = 0, .tm_min = 0, .tm_sec = 0 };
struct tm tm_to = { .tm_year = 2020 - 1900, .tm_mon = 4, .tm_mday = 5, .tm_hour = 0, .tm_min = 0, .tm_sec = 0 };
time_t from_time = mktime(&tm_from), to_time = mktime(&tm_to);
size_t count;
/* query all TSL in TSDB by time */
fdb_tsl_iter_by_time(tsdb, from_time, to_time, query_by_time_cb, tsdb);
/* query all FDB_TSL_WRITE status TSL's count in TSDB by time */
count = fdb_tsl_query_count(tsdb, from_time, to_time, FDB_TSL_WRITE);
FDB_INFO("query count is: %zu\n", count);
}
{ /* SET the TSL status */
/* Change the TSL status by iterator or time iterator
* set_status_cb: the change operation will in this callback
*
* NOTE: The actions to modify the state must be in order.
* like: FDB_TSL_WRITE -> FDB_TSL_USER_STATUS1 -> FDB_TSL_DELETED -> FDB_TSL_USER_STATUS2
* The intermediate states can also be ignored.
* such as: FDB_TSL_WRITE -> FDB_TSL_DELETED
*/
fdb_tsl_iter(tsdb, set_status_cb, tsdb);
}
FDB_INFO("===========================================================\n");
}
static bool query_cb(fdb_tsl_t tsl, void *arg)
{
struct fdb_blob blob;
struct env_status status;
fdb_tsdb_t db = arg;
fdb_blob_read((fdb_db_t) db, fdb_tsl_to_blob(tsl, fdb_blob_make(&blob, &status, sizeof(status))));
FDB_INFO("[query_cb] queried a TSL: time: %ld, temp: %d, humi: %d\n", tsl->time, status.temp, status.humi);
return false;
}
static bool query_by_time_cb(fdb_tsl_t tsl, void *arg)
{
struct fdb_blob blob;
struct env_status status;
fdb_tsdb_t db = arg;
fdb_blob_read((fdb_db_t) db, fdb_tsl_to_blob(tsl, fdb_blob_make(&blob, &status, sizeof(status))));
FDB_INFO("[query_by_time_cb] queried a TSL: time: %ld, temp: %d, humi: %d\n", tsl->time, status.temp, status.humi);
return false;
}
static bool set_status_cb(fdb_tsl_t tsl, void *arg)
{
fdb_tsdb_t db = arg;
FDB_INFO("set the TSL (time %ld) status from %d to %d\n", tsl->time, tsl->status, FDB_TSL_USER_STATUS1);
fdb_tsl_set_status(db, tsl, FDB_TSL_USER_STATUS1);
return false;
}
#endif /* FDB_USING_TSDB */
@@ -21,6 +21,7 @@ extern int AdapterNbiotInit(void);
extern int AdapterBlueToothInit(void);
extern int AdapterWifiInit(void);
extern int AdapterEthernetInit(void);
extern int AdapterEthercatInit(void);
extern int AdapterZigbeeInit(void);
extern int AdapterLoraInit(void);
@@ -35,6 +36,8 @@ extern int As830Ch4Init(void);
extern int Tb600bIaq10IaqInit(void);
extern int Tb600bTvoc10TvocInit(void);
extern int Tb600bWqHcho1osInit(void);
extern int QsFxWindDirectionInit(void);
extern int QsFsWindSpeedInit(void);
extern int lv_port_init(void);
@@ -103,6 +106,14 @@ static struct InitDesc sensor_desc[] =
{ "zg09_co2", Zg09Co2Init },
#endif
#ifdef SENSOR_QS_FX
{ "qs_fx_wind_direction", QsFxWindDirectionInit },
#endif
#ifdef SENSOR_QS_FS
{ "qs_fs_wind_speed", QsFsWindSpeedInit },
#endif
#ifdef SENSOR_AS830
{ "ch4_as830", As830Ch4Init },
#endif
@@ -142,6 +153,9 @@ static struct InitDesc connection_desc[] =
#ifdef CONNECTION_ADAPTER_ETHERNET
{ "ethernet adapter", AdapterEthernetInit},
#endif
#ifdef CONNECTION_ADAPTER_ETHERCAT
{ "ethercat adapter", AdapterEthercatInit},
#endif
#ifdef CONNECTION_ADAPTER_LORA
{ "lora adapter", AdapterLoraInit},
#endif
@@ -5,7 +5,7 @@ ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
include $(APPDIR)/Application.mk
endif
ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
SRC_FILES := double_list.c single_list.c
include $(KERNEL_ROOT)/compiler.mk
endif
@@ -9,7 +9,8 @@ menu "knowing app"
source "$APP_DIR/Applications/knowing_app/iris_ml_demo/Kconfig"
source "$APP_DIR/Applications/knowing_app/k210_fft_test/Kconfig"
source "$APP_DIR/Applications/knowing_app/image_processing/Kconfig"
source "$APP_DIR/Applications/knowing_app/cmsis_5_demo/Kconfig"
source "$APP_DIR/Applications/knowing_app/cmsis_5_demo/Kconfig"
source "$APP_DIR/Applications/knowing_app/nnom_demo/Kconfig"
endif
endmenu
@@ -0,0 +1,6 @@
############################################################################
# Applications/knowing_app/Make.defs
############################################################################
ifneq ($(CONFIG_APPLICATION_KNOWING),)
include $(wildcard $(APPDIR)/../../../APP_Framework/Applications/knowing_app/*/Make.defs)
endif
@@ -1,6 +1,6 @@
menuconfig USING_CMSIS_5_DEMOAPP
bool "CMSIS-5 demo app"
depends on USING_USING_CMSIS_5_NN
depends on USING_CMSIS_5_NN
default n
if USING_CMSIS_5_DEMOAPP
@@ -11,6 +11,11 @@ menuconfig USING_CMSIS_5_DEMOAPP
select IMAGE_PROCESSING_USING_TJPGD
default n
config USING_CMSIS_5_NN_DEMOAPP_VEG_CLASSIFY
bool "Using CMSIS-5 NN demo app vegetable classify"
select USING_IMAGE_PROCESSING
select IMAGE_PROCESSING_USING_TJPGD
default n
endif
@@ -13,6 +13,6 @@ path = [
cwd + '/demo'
]
group = DefineGroup('CMSISNN-cifar10', src, depend = ['USING_CMSIS_5_DEMOAPP'], CPPPATH = path)
group = DefineGroup('CMSISNN-cifar10', src, depend = ['USING_CMSIS_5_NN_DEMOAPP'], CPPPATH = path)
Return('group')
@@ -0,0 +1,37 @@
# CMSIS-NN vegetable classify example
This example uses CMSIS-NN to classify vegetable in real time under certain circumstances .
## Requirements:
- CMSIS-NN in Framework/knowing/cmsis_5
- **ov2640 need to be configured** in menuconfig "More Drivers->ov2640 driver" as follows
- Output format (RGB565 mode)
- (256) X direction resolution of outputimage
- (256) Y direction resolution of outputimage
- (512) X direction WINDOWS SIZE
- (512) Y direction WINDOWS SIZE
## To run this demo:
- Set up and configure the corresponding hardware environment.
- Run demo by type the command
```
cmsisnn_vegetable_classify
## Results
- **tomato**
![tomato](https://www.gitlink.org.cn/repo/WentaoWong/xiuos/raw/branch/dev/APP_Framework/Applications/knowing_app/cmsis_5_demo/cmsisnn_vegetable_classify/doc/tomato.jpg)
- **potato**
![potato](https://www.gitlink.org.cn/repo/WentaoWong/xiuos/raw/branch/dev/APP_Framework/Applications/knowing_app/cmsis_5_demo/cmsisnn_vegetable_classify/doc/potato.jpg)
- **pepper**
![pepper](https://www.gitlink.org.cn/repo/WentaoWong/xiuos/raw/branch/dev/APP_Framework/Applications/knowing_app/cmsis_5_demo/cmsisnn_vegetable_classify/doc/pepper.jpg)
- **mushroom**
![mushroom](https://www.gitlink.org.cn/repo/WentaoWong/xiuos/raw/branch/dev/APP_Framework/Applications/knowing_app/cmsis_5_demo/cmsisnn_vegetable_classify/doc/mushroom.jpg)
@@ -0,0 +1,18 @@
from building import *
import os
cwd = GetCurrentDir()
src = Split('''
model/nn_vegetable_classify.c
cmsisnn_vegetable_classify.c
''')
path = [
cwd + '/model',
cwd + '/demo'
]
group = DefineGroup('CMSISNN vegetable classify application', src, depend = ['USING_CMSIS_5_NN_DEMOAPP_VEG_CLASSIFY'], CPPPATH = path)
Return('group')
@@ -0,0 +1,188 @@
#include <rtthread.h>
#include <rtdevice.h>
#include "stdio.h"
#include "string.h"
#ifdef OV2640_RGB565_MODE
#ifdef RT_USING_POSIX
#include <dfs_posix.h>
#include <dfs_poll.h>
#ifdef RT_USING_POSIX_TERMIOS
#include <posix_termios.h>
#endif
#endif
#include <drv_ov2640.h>
#include <drv_lcd.h>
#include "nn_vegetable_classify.h"
#define JPEG_BUF_SIZE (2 * OV2640_X_RESOLUTION_IMAGE_OUTSIZE * OV2640_Y_RESOLUTION_IMAGE_OUTSIZE)
#define IOCTL_ERROR 1
static int fd = 0;
static int infer_times = 0;
static int photo_times = 0;
static int height = OV2640_X_RESOLUTION_IMAGE_OUTSIZE;
static int width = OV2640_Y_RESOLUTION_IMAGE_OUTSIZE;
static _ioctl_shoot_para shoot_para_t = {0};
const char *vegetable_label[] = {"mushroom", "pepper", "potato", "tomato"};
uint8_t *resized_buffer = NULL;
uint8_t *in_buffer = NULL;
int get_top_prediction_detection(q7_t *predictions)
{
int max_ind = 0;
int max_val = -128;
for (int i = 0; i < 10; i++)
{
if (max_val < predictions[i])
{
max_val = predictions[i];
max_ind = i;
}
}
return max_ind;
}
int cmsisnn_inference_vegetable_classify(uint8_t *input_data)
{
int8_t output_data[4];
char output[50] = {0};
char outputPrediction[50] = {0};
memset(output, 0, 50);
memset(outputPrediction, 0, 50);
run_nn_sn_classify((int8_t *)input_data, output_data);
arm_softmax_q7(output_data, 4, output_data);
infer_times++;
int top_ind = get_top_prediction_detection(output_data);
printf("times:%d Prediction:%s \r\n", infer_times, vegetable_label[top_ind]);
sprintf(outputPrediction, "times:%d Prediction:%s \r\n", infer_times, vegetable_label[top_ind]);
lcd_show_string(1, 280, 240, 16, 16, outputPrediction, RED);
return top_ind;
}
void resize_rgb888in_rgb565out(uint8_t *camera_image, uint16_t *resize_image)
{
uint8_t *psrc_temp = (uint8_t *)camera_image;
uint16_t *pdst_temp = (uint16_t *)resize_image;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
*pdst_temp++ = (*psrc_temp++ & 0xF8) << 8 | (*psrc_temp++ & 0xFC) << 3 | *psrc_temp++ >> 3;
}
}
}
void resize_rgb565in_rgb888out(uint8_t *camera_image, uint8_t *resize_image)
{
uint8_t *psrc_temp = (uint8_t *)camera_image;
uint8_t *pdst_temp = (uint8_t *)resize_image;
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
uint8_t pixel_lo = *psrc_temp++;
uint8_t pixel_hi = *psrc_temp++;
*pdst_temp++ = (0xF8 & pixel_hi);
*pdst_temp++ = ((0x07 & pixel_hi) << 5) | ((0xE0 & pixel_lo) >> 3);
*pdst_temp++ = (0x1F & pixel_lo) << 3;
}
}
}
void lcd_show_ov2640_thread_detection(uint8_t *rgbbuffer)
{
int32_t ret = 0;
while (1)
{
ret = ioctl(fd, IOCTRL_CAMERA_START_SHOT, &shoot_para_t);
if (ret == IOCTL_ERROR)
{
printf("ov2640 can't wait event flag");
free(rgbbuffer);
return;
}
lcd_fill_array(0, 0, OV2640_X_RESOLUTION_IMAGE_OUTSIZE, OV2640_Y_RESOLUTION_IMAGE_OUTSIZE, rgbbuffer);
if (photo_times % 20 == 0)
{
resize_rgb565in_rgb888out(rgbbuffer, resized_buffer);
int pixel = 0;
for (int i = 0; i < 3 * width; i += 3 * width / CONV1_IN_DIM)
{
for (int j = 0; j < 3 * height; j += 3 * height / CONV1_IN_DIM)
{
for (int k = 0; k < 3; k++, pixel++)
{
*(in_buffer + pixel) = *(resized_buffer + 256 * i + j + k);
}
}
}
cmsisnn_inference_vegetable_classify(in_buffer);
}
photo_times++;
}
}
void cmsisnn_vegetable_classify()
{
fd = open("/dev/ov2640", O_RDONLY);
if (fd < 0)
{
printf("open ov2640 fail !!");
return;
}
printf("memory_init \n\r");
uint8_t *JpegBuffer = malloc(JPEG_BUF_SIZE);
if (JpegBuffer == NULL)
{
printf("JpegBuffer senddata buf malloc error!\n");
return;
}
resized_buffer = malloc(3 * width * height);
if (resized_buffer == NULL)
{
printf("Resized_buffer buf malloc error!\n");
return;
}
in_buffer = malloc(CONV1_IN_CH * CONV1_IN_DIM * CONV1_IN_DIM);
if (in_buffer == NULL)
{
printf("In_buffer buf malloc error!\n");
return;
}
memory_init();
printf("memory_init success\n\r");
shoot_para_t.pdata = (uint32_t)JpegBuffer;
shoot_para_t.length = JPEG_BUF_SIZE / 2;
int result = 0;
pthread_t tid = 0;
pthread_attr_t attr;
struct sched_param prio;
prio.sched_priority = 8;
size_t stack_size = 1024 * 11;
pthread_attr_init(&attr);
pthread_attr_setschedparam(&attr, &prio);
pthread_attr_setstacksize(&attr, stack_size);
result = pthread_create(&tid, &attr, lcd_show_ov2640_thread_detection, JpegBuffer);
if (0 == result) {
printf("thread_detect_entry successfully!\n");
} else {
printf("thread_detect_entry failed! error code is %d.\n", result);
close(fd);
}
return;
}
#ifdef __RT_THREAD_H__
MSH_CMD_EXPORT(cmsisnn_vegetable_classify, classify vegetable using cmsis-nn);
#endif
#endif
Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

@@ -0,0 +1,108 @@
#include "nn_vegetable_classify.h"
static const q7_t conv1_w[CONV1_WT_SHAPE] = CONV1_WT;
static const q7_t conv1_b[CONV1_BIAS_SHAPE] = CONV1_BIAS;
static const q7_t conv2_w[CONV2_WT_SHAPE] = CONV2_WT;
static const q7_t conv2_b[CONV2_BIAS_SHAPE] = CONV2_BIAS;
// static const q7_t conv3_w[CONV3_WT_SHAPE] = CONV3_WT;
// static const q7_t conv3_b[CONV3_BIAS_SHAPE] = CONV3_BIAS;
static const q7_t interface_w[INTERFACE_WT_SHAPE] = INTERFACE_WT;
static const q7_t interface_b[INTERFACE_BIAS_SHAPE] = INTERFACE_BIAS;
static const q7_t linear_w[LINEAR_WT_SHAPE] = LINEAR_WT;
static const q7_t linear_b[LINEAR_BIAS_SHAPE] = LINEAR_BIAS;
q7_t *conv1_out = NULL;
q7_t *pool1_out = NULL;
q7_t *conv2_out = NULL;
q7_t *pool2_out = NULL;
// q7_t *conv3_out = NULL ;
q7_t *interface_out = NULL;
q7_t *linear_out = NULL;
q7_t *y_out = NULL;
q7_t *conv_buffer = NULL;
q7_t *fc_buffer = NULL;
void memory_init()
{
static int flag = 0;
if (flag == 0)
{
conv1_out = malloc(CONV1_OUT_CH * CONV1_OUT_DIM * CONV1_OUT_DIM);
if (conv1_out == NULL)
{
printf("conv1_out malloc failed...\n");
return;
}
pool1_out = malloc(CONV1_OUT_CH * POOL1_OUT_DIM * POOL1_OUT_DIM);
if (pool1_out == NULL)
{
printf("pool1_out malloc failed...\n");
return;
}
conv2_out = malloc(CONV2_OUT_CH * CONV2_OUT_DIM * CONV2_OUT_DIM);
if (conv2_out == NULL)
{
printf("conv2_out malloc failed...\n");
return;
}
pool2_out = malloc(CONV2_OUT_CH * POOL2_OUT_DIM * POOL2_OUT_DIM);
if (pool2_out == NULL)
{
printf("pool2_out malloc failed...\n");
return;
}
interface_out = malloc(INTERFACE_OUT_DIM);
if (interface_out == NULL)
{
printf("interface_out malloc failed...\n");
return;
}
linear_out = malloc(LINEAR_OUT_DIM);
if (linear_out == NULL)
{
printf("linear_out malloc failed...\n");
return;
}
y_out = malloc(LINEAR_OUT_DIM);
if (y_out == NULL)
{
printf("y_out malloc failed...\n");
return;
}
conv_buffer = malloc(MAX_CONV_BUFFER_SIZE);
if (conv_buffer == NULL)
{
printf("conv_buffer malloc failed...\n");
return;
}
fc_buffer = malloc(MAX_FC_BUFFER);
if (fc_buffer == NULL)
{
printf("fc_buffer malloc failed...\n");
return;
}
}
}
void run_nn_sn_classify(q7_t *input_data, q7_t *output_data)
{
for (int i = 0; i < CONV1_IN_CH * CONV1_IN_DIM * CONV1_IN_DIM; i++)
{
input_data[i] = input_data[i] - 127;
}
arm_convolve_HWC_q7_basic(input_data, CONV1_IN_DIM, CONV1_IN_CH, conv1_w, CONV1_OUT_CH, CONV1_KER_DIM, CONV1_PAD, CONV1_STRIDE, conv1_b, CONV1_BIAS_LSHIFT, CONV1_OUT_RSHIFT, conv1_out, CONV1_OUT_DIM, (q15_t *)conv_buffer, fc_buffer);
arm_maxpool_q7_HWC(conv1_out, POOL1_IN_DIM, POOL1_IN_CH, POOL1_KER_DIM, POOL1_PAD, POOL1_STRIDE, POOL1_OUT_DIM, NULL, pool1_out);
arm_relu_q7(pool1_out, POOL1_OUT_DIM * POOL1_OUT_DIM * CONV1_OUT_CH);
arm_convolve_HWC_q7_basic(pool1_out, CONV2_IN_DIM, CONV2_IN_CH, conv2_w, CONV2_OUT_CH, CONV2_KER_DIM, CONV2_PAD, CONV2_STRIDE, conv2_b, CONV2_BIAS_LSHIFT, CONV2_OUT_RSHIFT, conv2_out, CONV2_OUT_DIM, (q15_t *)conv_buffer, NULL);
arm_maxpool_q7_HWC(conv2_out, POOL2_IN_DIM, POOL2_IN_CH, POOL2_KER_DIM, POOL2_PAD, POOL2_STRIDE, POOL2_OUT_DIM, NULL, pool2_out);
arm_relu_q7(pool2_out, POOL2_OUT_DIM * POOL2_OUT_DIM * CONV2_OUT_CH);
// printf("1\n");
// arm_convolve_HWC_q7_basic(pool2_out, CONV3_IN_DIM, CONV3_IN_CH, conv3_w, CONV3_OUT_CH, CONV3_KER_DIM,
// CONV3_PAD, CONV3_STRIDE, conv3_b, CONV3_BIAS_LSHIFT, CONV3_OUT_RSHIFT, conv3_out,
// CONV3_OUT_DIM, (q15_t *) conv_buffer, NULL);
// arm_relu_q7(conv3_out, CONV3_OUT_DIM * CONV3_OUT_DIM * CONV3_OUT_CH);
// printf("2\n");
arm_fully_connected_q7_opt(pool2_out, interface_w, INTERFACE_IN_DIM, INTERFACE_OUT_DIM, INTERFACE_BIAS_LSHIFT, INTERFACE_OUT_RSHIFT, interface_b, interface_out, (q15_t *)fc_buffer);
arm_relu_q7(interface_out, INTERFACE_OUT_DIM);
arm_fully_connected_q7_opt(interface_out, linear_w, LINEAR_IN_DIM, LINEAR_OUT_DIM, LINEAR_BIAS_LSHIFT, LINEAR_OUT_RSHIFT, linear_b, output_data, (q15_t *)fc_buffer);
}
@@ -0,0 +1,13 @@
#ifndef __NN_H__
#define __NN_H__
#include <transform.h>
#include "arm_math.h"
#include "arm_nnfunctions.h"
#include "parameter_vegetable_classify.h"
#include "weights_vegetable_classify.h"
void run_nn_detection(q7_t* input_data, q7_t* output_data);
void memory_init();
#endif
@@ -0,0 +1,56 @@
#define CONV1_IN_CH 3
#define CONV1_OUT_CH 32
#define CONV1_KER_DIM 3
#define CONV1_PAD 0
#define CONV1_STRIDE 1
#define CONV1_IN_DIM 32
#define CONV1_OUT_DIM 30
#define MAX_CONV_BUFFER_SIZE 3096
#define POOL1_IN_CH 32
#define POOL1_KER_DIM 2
#define POOL1_PAD 0
#define POOL1_STRIDE 2
#define POOL1_IN_DIM 30
#define POOL1_OUT_DIM 15
#define CONV2_IN_CH 32
#define CONV2_OUT_CH 32
#define CONV2_KER_DIM 3
#define CONV2_PAD 0
#define CONV2_STRIDE 1
#define CONV2_IN_DIM 15
#define CONV2_OUT_DIM 13
#define POOL2_IN_CH 32
#define POOL2_KER_DIM 2
#define POOL2_PAD 0
#define POOL2_STRIDE 2
#define POOL2_IN_DIM 13
#define POOL2_OUT_DIM 6
#define INTERFACE_OUT_DIM 32
#define INTERFACE_IN_DIM 1152
#define MAX_FC_BUFFER 3096
#define LINEAR_OUT_DIM 4
#define LINEAR_IN_DIM 32
#define CONV1_BIAS_LSHIFT 6
#define CONV1_OUT_RSHIFT 9
#define CONV1_WEIGHT_Q 8
#define CONV1_BIAS_Q 8
#define CONV1_INPUT_Q 6
#define CONV1_OUT_Q 5
#define CONV2_BIAS_LSHIFT 4
#define CONV2_OUT_RSHIFT 10
#define CONV2_WEIGHT_Q 9
#define CONV2_BIAS_Q 10
#define CONV2_INPUT_Q 5
#define CONV2_OUT_Q 4
#define INTERFACE_BIAS_LSHIFT 3
#define INTERFACE_OUT_RSHIFT 11
#define INTERFACE_WEIGHT_Q 9
#define INTERFACE_BIAS_Q 10
#define INTERFACE_INPUT_Q 4
#define INTERFACE_OUT_Q 2
#define LINEAR_BIAS_LSHIFT 0
#define LINEAR_OUT_RSHIFT 7
#define LINEAR_WEIGHT_Q 7
#define LINEAR_BIAS_Q 9
#define LINEAR_INPUT_Q 2
#define LINEAR_OUT_Q 2
@@ -1,4 +1,5 @@
config IMAGE_PROCESSING_TJPGDEC_APP
bool "image processing apps/TJpgDec(example)"
select USING_IMAGE_PROCESSING
select IMAGE_PROCESSING_USING_TJPGD
default n
@@ -0,0 +1,6 @@
############################################################################
# APP_Framework/Applications/knowing_app/k210_fft_test/Make.defs
############################################################################
ifneq ($(CONFIG_K210_FFT_TEST),)
CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Applications/knowing_app/k210_fft_test
endif
@@ -0,0 +1,12 @@
include $(KERNEL_ROOT)/.config
ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
include $(APPDIR)/Make.defs
ifeq ($(CONFIG_K210_FFT_TEST), y)
CSRCS += fft_soft.c fft_test.c
endif
include $(APPDIR)/Application.mk
endif
@@ -71,7 +71,7 @@ void k210_fft_test(void)
data_soft[i].real = data_hard[i].real;
data_soft[i].imag = data_hard[i].imag;
}
for (int i = 0; i < FFT_N / 2; ++i)
for (i = 0; i < FFT_N / 2; ++i)
{
input_data = (fft_data_t *)&buffer_input[i];
input_data->R1 = data_hard[2 * i].real;
@@ -118,7 +118,7 @@ void k210_fft_test(void)
printf("%3d : %f %f\n", i, hard_angel[i] * 180 / PI, soft_angel[i] * 180 / PI);
}
for (int i = 0; i < FFT_N / 2; ++i)
for (i = 0; i < FFT_N / 2; ++i)
{
input_data = (fft_data_t *)&buffer_input[i];
input_data->R1 = data_hard[2 * i].real;
@@ -154,6 +154,24 @@ void k210_fft_test(void)
cycle[FFT_SOFT][FFT_DIR_FORWARD]/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000),
cycle[FFT_SOFT][FFT_DIR_BACKWARD]/(sysctl_clock_get_freq(SYSCTL_CLOCK_CPU)/1000000));
}
#ifdef ADD_NUTTX_FETURES
void nuttx_k210_fft_test(void)
{
pthread_t thread;
int result;
pthread_attr_t attr = PTHREAD_ATTR_INITIALIZER;
attr.priority = 20;
attr.stacksize = 81920;
result = PrivTaskCreate(&thread, &attr, (void*)k210_fft_test, NULL);
if (result != 0)
{
printf("k210 fft test:task create failed, status=%d\n", result);
_exit(-1);
}
}
#endif
#ifdef __RT_THREAD_H__
MSH_CMD_EXPORT(k210_fft_test,k210 fft test );
#endif
@@ -0,0 +1,14 @@
menuconfig USING_NNOM_DEMOAPP
bool "NNOM demo app"
depends on USING_NNOM
default n
if USING_NNOM_DEMOAPP
config USING_NNOM_MNIST_DEMOAPP
bool "Using NNOM mnist demo app"
default n
endif
@@ -0,0 +1,14 @@
import os
Import('RTT_ROOT')
from building import *
cwd = GetCurrentDir()
objs = []
list = os.listdir(cwd)
for d in list:
path = os.path.join(cwd, d)
if os.path.isfile(os.path.join(path, 'SConscript')):
objs = objs + SConscript(os.path.join(path, 'SConscript'))
Return('objs')
@@ -0,0 +1,16 @@
# NNoM Mnist-simple Example
This example is from [[NNoM](https://github.com/majianjia/nnom)/**[mnist-simple](https://github.com/majianjia/nnom/tree/master/examples/mnist-simple)**] and can be deployed on Arm CPUs and RISC-V CPUs. CMSIS-NN can be used to accelerate on Arm Cortex-M CPUs.
## Requirements:
- NNoM in Framework/knowing/nnom
- To use CMSIS-NN backend, select in menuconfig "APP_Framework->Framework->support knowing framework->NNoM->Select NNoM Backend"
## To run this demo:
- Run demo by type the command
```
mnist_nnom num
```
@@ -0,0 +1,10 @@
import os
from building import *
cwd = GetCurrentDir()
src = Glob('*.c')
path = [cwd]
group = DefineGroup('NNOM mnist application', src, depend = ['USING_NNOM_MNIST_DEMOAPP'], CPPPATH = path)
Return('group')
@@ -0,0 +1,36 @@
#define IMG0 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 88, 126, 126, 126, 126, 127, 64, 56, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 81, 126, 126, 126, 126, 126, 126, 126, 126, 109, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 28, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 89, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 126, 126, 127, 126, 114, 23, 0, 31, 89, 126, 126, 126, 127, 126, 59, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 100, 126, 126, 126, 111, 26, 0, 0, 0, 28, 116, 126, 126, 126, 126, 107, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 126, 83, 0, 0, 0, 0, 0, 37, 116, 126, 126, 126, 126, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 126, 37, 0, 0, 0, 0, 0, 0, 84, 126, 126, 126, 126, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 126, 126, 126, 126, 13, 0, 0, 0, 0, 0, 0, 84, 126, 126, 126, 126, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 126, 126, 126, 127, 13, 0, 0, 0, 0, 0, 0, 84, 126, 127, 126, 126, 112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 126, 126, 126, 126, 13, 0, 0, 0, 0, 0, 0, 61, 126, 126, 126, 126, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 126, 68, 0, 0, 0, 0, 0, 0, 30, 126, 126, 126, 126, 111, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 126, 112, 29, 5, 0, 0, 5, 69, 112, 126, 126, 126, 126, 104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 110, 126, 126, 126, 126, 126, 88, 70, 70, 89, 126, 126, 126, 126, 126, 126, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 99, 126, 126, 127, 126, 126, 126, 126, 127, 126, 126, 126, 126, 127, 126, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 111, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 77, 126, 126, 126, 126, 126, 126, 126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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 127, 127, 127, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 82, 127, 127, 124, 85, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 22, 110, 127, 127, 98, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 76, 127, 127, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 73, 127, 124, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 110, 127, 111, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 127, 127, 75, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 102, 127, 127, 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 69, 123, 127, 120, 63, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 44, 119, 127, 127, 127, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 69, 103, 52, 70, 125, 127, 127, 100, 63, 21, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 75, 127, 127, 127, 127, 127, 127, 94, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 0, 0, 0, 0, 38, 123, 126, 126, 63, 0, 0, 0, 0, 56, 126, 126, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 55, 0, 0, 0, 0, 56, 126, 126, 99, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 0, 0, 0, 0, 0, 19, 117, 126, 126, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 0, 0, 0, 0, 0, 0, 73, 126, 126, 94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 126, 126, 126, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 0, 0, 0, 0, 0, 0, 42, 126, 126, 126, 81, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 100, 126, 126, 126, 0, 0, 0, 0, 0, 0, 9, 104, 126, 126, 126, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 126, 126, 126, 126, 14, 38, 84, 84, 84, 54, 9, 90, 126, 126, 126, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 107, 44, 126, 126, 126, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, 120, 126, 126, 126, 127, 126, 126, 126, 126, 127, 126, 126, 126, 126, 127, 84, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, 126, 126, 126, 126, 88, 83, 75, 53, 126, 126, 126, 126, 126, 126, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 27, 27, 27, 28, 3, 0, 0, 0, 28, 27, 27, 93, 126, 126, 116, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 6, 9, 66, 95, 78, 83, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 12, 64, 95, 126, 126, 126, 126, 126, 123, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 27, 92, 126, 126, 126, 126, 126, 126, 115, 96, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 36, 114, 126, 126, 126, 126, 126, 102, 67, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 126, 126, 126, 126, 100, 96, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 126, 126, 115, 69, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 94, 126, 126, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 126, 126, 126, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 82, 126, 126, 105, 54, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 124, 126, 126, 126, 126, 121, 94, 60, 61, 26, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 98, 126, 126, 126, 126, 126, 126, 126, 127, 126, 80, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 54, 54, 54, 54, 105, 114, 119, 126, 126, 126, 126, 87, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 51, 109, 126, 126, 126, 112, 58, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 50, 102, 119, 126, 126, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 90, 126, 126, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 48, 117, 126, 126, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 29, 102, 102, 9, 20, 43, 76, 106, 126, 126, 114, 64, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 126, 126, 110, 117, 126, 126, 126, 126, 91, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 104, 126, 126, 126, 126, 126, 126, 115, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 65, 65, 123, 95, 65, 28, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 123, 126, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 53, 126, 121, 96, 14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 126, 126, 107, 70, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 85, 126, 127, 126, 126, 126, 56, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 121, 126, 126, 88, 93, 126, 118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 126, 126, 28, 3, 6, 93, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 117, 126, 118, 0, 0, 0, 84, 126, 47, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 126, 126, 56, 0, 0, 0, 84, 126, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 126, 126, 87, 0, 0, 0, 84, 126, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 101, 126, 126, 81, 28, 9, 98, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 126, 126, 126, 116, 104, 126, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 49, 111, 126, 126, 126, 116, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 126, 126, 110, 18, 0, 0, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 107, 126, 127, 106, 66, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 81, 126, 126, 126, 126, 126, 86, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 126, 127, 65, 31, 51, 96, 126, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 126, 86, 5, 0, 0, 35, 126, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 127, 126, 0, 0, 0, 0, 25, 126, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 71, 126, 85, 0, 0, 0, 0, 46, 126, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 127, 45, 0, 0, 0, 20, 107, 126, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 121, 116, 15, 0, 0, 20, 121, 126, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 126, 117, 15, 0, 0, 86, 126, 127, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 126, 126, 86, 10, 91, 126, 126, 126, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 91, 127, 126, 127, 126, 127, 86, 127, 126, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 106, 126, 126, 126, 65, 5, 65, 126, 61, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 126, 127, 25, 0, 0, 25, 126, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 116, 126, 86, 5, 0, 0, 25, 126, 111, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 126, 0, 0, 0, 0, 25, 126, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 126, 126, 0, 0, 0, 0, 46, 126, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 127, 126, 0, 0, 5, 86, 127, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 126, 126, 20, 20, 86, 126, 106, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 117, 126, 127, 126, 127, 86, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 126, 126, 106, 45, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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0, 0, 0, 0, 0, 0, 0, 63, 127, 120, 0, 0, 0, 0, 0, 83, 127, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 97, 127, 90, 0, 0, 0, 0, 0, 15, 127, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 34, 124, 127, 75, 0, 0, 0, 0, 0, 14, 127, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 102, 127, 126, 103, 36, 22, 0, 0, 10, 112, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 119, 127, 127, 127, 115, 93, 93, 86, 83, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 40, 121, 127, 127, 127, 127, 127, 127, 127, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 55, 84, 124, 124, 127, 127, 127, 127, 127, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 76, 93, 127, 127, 127, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 75, 127, 127, 58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 127, 127, 39, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 127, 127, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 127, 127, 92, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 122, 127, 127, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 127, 127, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
#define IMG9_LABLE 9
#define TOTAL_IMAGE 10
static const int8_t img[10][784] = {IMG0,IMG1,IMG2,IMG3,IMG4,IMG5,IMG6,IMG7,IMG8,IMG9};
static const int8_t label[10] = {IMG0_LABLE,IMG1_LABLE,IMG2_LABLE,IMG3_LABLE,IMG4_LABLE,IMG5_LABLE,IMG6_LABLE,IMG7_LABLE,IMG8_LABLE,IMG9_LABLE};
@@ -0,0 +1,77 @@
/*
* Copyright (c) 2018-2020, Jianjia Ma
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-03-29 Jianjia Ma first implementation
*/
#include <stdio.h>
#include <transform.h>
#include "nnom.h"
#include "image.h"
#include "weights.h"
nnom_model_t *model;
const char codeLib[] = "@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\\|()1{}[]?-_+~<>i!lI;:,\"^`'. ";
void print_img(int8_t * buf)
{
for(int y = 0; y < 28; y++)
{
for (int x = 0; x < 28; x++)
{
int index = 69 / 127.0 * (127 - buf[y*28+x]);
if(index > 69) index =69;
if(index < 0) index = 0;
printf("%c",codeLib[index]);
printf("%c",codeLib[index]);
}
printf("\n");
}
}
// Do simple test using image in "image.h" with model created previously.
void mnist_nnom(int argc, char **argv)
{
model = nnom_model_create();
uint32_t tick, time;
uint32_t predic_label;
float prob;
int32_t index = atoi(argv[1]);
if (index >= TOTAL_IMAGE || argc != 2)
{
printf("Please input image number within %d\n", TOTAL_IMAGE - 1);
return;
}
printf("\nprediction start.. \n");
#ifdef __RT_THREAD_H__
tick = rt_tick_get();
#endif
memcpy(nnom_input_data, (int8_t *)&img[index][0], 784);
nnom_predict(model, &predic_label, &prob);
#ifdef __RT_THREAD_H__
time = rt_tick_get() - tick;
#endif
// print original image to console
print_img((int8_t *)&img[index][0]);
#ifdef __RT_THREAD_H__
printf("Time: %d tick\n", time);
#endif
printf("Truth label: %d\n", label[index]);
printf("Predicted label: %d\n", predic_label);
printf("Probability: %d%%\n", (int)(prob * 100));
}
#ifdef __RT_THREAD_H__
MSH_CMD_EXPORT(mnist_nnom, nnom mnist demo and image number should be followed);
#endif
@@ -0,0 +1,166 @@
'''
Copyright (c) 2018-2020
Jianjia Ma
majianjia@live.com
SPDX-License-Identifier: Apache-2.0
Change Logs:
Date Author Notes
2019-02-12 Jianjia Ma The first version
'''
import matplotlib.pyplot as plt
import sys
import os
nnscript = os.path.abspath('../../../Framework/knowing/nnom/scripts')
sys.path.append(nnscript)
from tensorflow.keras import *
from tensorflow.keras.datasets import mnist
from tensorflow.keras.layers import *
from tensorflow.keras.models import load_model, save_model
import tensorflow as tf
import numpy as np
from nnom import *
model_name = 'mnist_simple_trained_model.h5'
def image_to_cfile(data, label, num_of_image, file='image.h'):
with open(file, 'w') as f:
for i in range(num_of_image):
selected = np.random.randint(0, 1000) # select 10 out of 1000.
f.write('#define IMG%d {'% (i))
np.round(data[selected]).flatten().tofile(f, sep=", ", format="%d") # convert 0~1 to 0~127
f.write('} \n')
f.write('#define IMG%d_LABLE'% (i))
f.write(' %d \n \n' % label[selected])
f.write('#define TOTAL_IMAGE %d \n \n'%(num_of_image))
f.write('static const int8_t img[%d][%d] = {' % (num_of_image, data[0].flatten().shape[0]))
f.write('IMG0')
for i in range(num_of_image -1):
f.write(',IMG%d'%(i+1))
f.write('};\n\n')
f.write('static const int8_t label[%d] = {' % (num_of_image))
f.write('IMG0_LABLE')
for i in range(num_of_image -1):
f.write(',IMG%d_LABLE'%(i+1))
f.write('};\n\n')
def train(x_train, y_train, x_test, y_test, batch_size=64, epochs=100):
inputs = Input(shape=x_train.shape[1:])
x = Conv2D(12, kernel_size=(3, 3), strides=(1, 1), padding='same')(inputs)
x = ReLU()(x)
x = MaxPool2D((2,2),strides=(2,2), padding="same")(x)
x = Conv2D(24 ,kernel_size=(3,3), strides=(1,1), padding="same")(x)
x = ReLU()(x)
x = MaxPool2D((2,2),strides=(2,2), padding="same")(x)
x = Conv2D(48, kernel_size=(3,3), strides=(1,1), padding="same")(x)
x = ReLU()(x)
x = Dropout(0.2)(x)
x = MaxPool2D((2,2),strides=(2,2), padding="same")(x)
x = Flatten()(x)
x = Dense(96)(x)
x = Dropout(0.2)(x)
x = ReLU()(x)
x = Dense(10)(x)
predictions = Softmax()(x)
model = Model(inputs=inputs, outputs=predictions)
model.compile(loss='categorical_crossentropy',
optimizer='adam',
metrics=['accuracy'])
model.summary()
history = model.fit(x_train, y_train,
batch_size=batch_size,
epochs=epochs,
verbose=2,
validation_data=(x_test, y_test),
shuffle=True)
# free the session to avoid nesting naming while we load the best model after.
save_model(model, model_name)
del model
tf.keras.backend.clear_session()
return history
if __name__ == "__main__":
epochs = 2
num_classes = 10
# The data, split between train and test sets:
(x_train, y_train_num), (x_test, y_test_num) = mnist.load_data()
print(x_train.shape[0], 'train samples')
print(x_test.shape[0], 'test samples')
# Convert class vectors to binary class matrices.
y_train = tf.keras.utils.to_categorical(y_train_num, num_classes)
y_test = tf.keras.utils.to_categorical(y_test_num, num_classes)
# reshape to 4 d becaue we build for 4d?
x_train = x_train.reshape(x_train.shape[0], x_train.shape[1], x_train.shape[2], 1)
x_test = x_test.reshape(x_test.shape[0], x_test.shape[1], x_test.shape[2], 1)
print('x_train shape:', x_train.shape)
# quantize the range to 0~255 -> 0~1
x_test = x_test/255
x_train = x_train/255
print("data range", x_test.min(), x_test.max())
# select a few image and write them to image.h
image_to_cfile(x_test*127, y_test_num, 10, file='image.h')
# train model, save the best accuracy model
history = train(x_train, y_train, x_test, y_test, batch_size=64, epochs=epochs)
# reload best model
model = load_model(model_name)
# evaluate
evaluate_model(model, x_test, y_test)
# save weight
generate_model(model, np.vstack((x_train, x_test)), name="weights.h")
# plot
acc = history.history['accuracy']
val_acc = history.history['val_accuracy']
plt.plot(range(0, epochs), acc, color='red', label='Training acc')
plt.plot(range(0, epochs), val_acc, color='green', label='Validation acc')
plt.title('Training and validation accuracy')
plt.xlabel('Epochs')
plt.ylabel('Loss')
plt.legend()
plt.show()
File diff suppressed because one or more lines are too long
@@ -53,6 +53,10 @@ menu "sensor app"
config APPLICATION_SENSOR_CO2_ZG09
bool "Using sensor ZG09 apps"
default n
config APPLICATION_SENSOR_CO2_G8S
bool "Using sensor G8S apps"
default n
endif
menuconfig APPLICATION_SENSOR_PM1_0
@@ -122,7 +126,36 @@ menu "sensor app"
endif
endif
menuconfig APPLICATION_SENSOR_WINDDIRECTION
bool "Using sensor wind direction apps"
default n
if APPLICATION_SENSOR_WINDDIRECTION
config APPLICATION_SENSOR_WINDDIRECTION_QS_FX
bool "Using sensor QS-FX apps"
default n
endif
menuconfig APPLICATION_SENSOR_WINDSPEED
bool "Using sensor wind speed apps"
default n
if APPLICATION_SENSOR_WINDSPEED
config APPLICATION_SENSOR_WINDSPEED_QS_FS
bool "Using sensor QS-FS apps"
default n
endif
menuconfig APPLICATION_SENSOR_ALTITUDE
bool "Using sensor altitude apps"
default n
if APPLICATION_SENSOR_ALTITUDE
config APPLICATION_SENSOR_ALTITUDE_BMP180
bool "Using sensor BMP180 apps"
default n
endif
endif
endmenu
+17 -1
View File
@@ -51,7 +51,7 @@ ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
endif
ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
ifeq ($(CONFIG_ADD_XIZI_FETURES),y)
SRC_FILES :=
ifeq ($(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS), y)
@@ -74,6 +74,10 @@ ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
SRC_FILES += co2_zg09.c
endif
ifeq ($(CONFIG_APPLICATION_SENSOR_CO2_G8S), y)
SRC_FILES += co2_g8s.c
endif
ifeq ($(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308), y)
SRC_FILES += pm1_0_ps5308.c
endif
@@ -98,6 +102,18 @@ ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
SRC_FILES += temperature_hs300x.c
endif
ifeq ($(CONFIG_APPLICATION_SENSOR_WINDDIRECTION_QS_FX), y)
SRC_FILES += winddirection_qs_fx.c
endif
ifeq ($(CONFIG_APPLICATION_SENSOR_WINDSPEED_QS_FS), y)
SRC_FILES += windspeed_qs_fs.c
endif
ifeq ($(CONFIG_APPLICATION_SENSOR_ALTITUDE_BMP180), y)
SRC_FILES += altitude_bmp180.c
endif
include $(KERNEL_ROOT)/compiler.mk
endif
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file altitude_bmp180.c
* @brief BMP180 altitude example
* @version 1.1
* @author AIIT XUOS Lab
* @date 2021.12.23
*/
#include <user_api.h>
#include <sensor.h>
/**
* @description: Read a altitude
* @return 0
*/
void AltitudeBmp180(void)
{
int32 altitude;
struct SensorQuantity *p_altitude = SensorQuantityFind(SENSOR_QUANTITY_BMP180_ALTITUDE, SENSOR_QUANTITY_ALTITUDE);
SensorQuantityOpen(p_altitude);
altitude = SensorQuantityRead(p_altitude);
printf("Altitude Pressure : %d Pa\n", altitude);
PrivTaskDelay(1000);
SensorQuantityClose(p_altitude);
}
@@ -18,7 +18,7 @@
* @date 2021.12.10
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
#include <sensor.h>
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiUOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file co2_g8s.c
* @brief G8S CO2 example
* @version 1.1
* @author AIIT XUOS Lab
* @date 2021.12.23
*/
#include <user_api.h>
#include <sensor.h>
/**
* @description: Read a CO2
* @return 0
*/
void Co2G8s(void)
{
struct SensorQuantity *co2 = SensorQuantityFind(SENSOR_QUANTITY_G8S_CO2, SENSOR_QUANTITY_CO2);
SensorQuantityOpen(co2);
printf("CO2 : %d ppm\n", SensorQuantityRead(co2));
SensorQuantityClose(co2);
}
@@ -18,7 +18,7 @@
* @date 2021.04.23
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
#include <sensor.h>
@@ -18,7 +18,7 @@
* @date 2021.12.15
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
#include <sensor.h>
@@ -18,7 +18,7 @@
* @date 2021.04.23
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
@@ -18,7 +18,7 @@
* @date 2021.12.14
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
#include <sensor.h>
@@ -18,7 +18,7 @@
* @date 2021.04.23
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
@@ -18,7 +18,7 @@
* @date 2021.04.23
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
@@ -18,7 +18,7 @@
* @date 2021.04.23
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
@@ -18,7 +18,7 @@
* @date 2021.04.23
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
@@ -18,7 +18,7 @@
* @date 2021.12.15
*/
#ifdef ADD_XIUOS_FETURES
#ifdef ADD_XIZI_FETURES
# include <user_api.h>
#endif
#include <sensor.h>
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file winddirection_qs_fx.c
* @brief qs-fx wind direction example
* @version 1.1
* @author AIIT XUOS Lab
* @date 2021.12.14
*/
#include <transform.h>
#include <sensor.h>
/**
* @description: Read a wind direction
* @return 0
*/
void WindDirectionQsFx(void)
{
struct SensorQuantity *wind_direction = SensorQuantityFind(SENSOR_QUANTITY_QS_FX_WINDDIRECTION, SENSOR_QUANTITY_WINDDIRECTION);
SensorQuantityOpen(wind_direction);
PrivTaskDelay(2000);
uint16 result = SensorQuantityRead(wind_direction);
printf("wind direction : %d degree\n", result);
SensorQuantityClose(wind_direction);
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, WindDirectionQsFx, WindDirectionQsFx, WindDirectionQsFx function);
@@ -0,0 +1,38 @@
/*
* Copyright (c) 2020 AIIT XUOS Lab
* XiOS is licensed under Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
* http://license.coscl.org.cn/MulanPSL2
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/
/**
* @file windspeed_qs_fs.c
* @brief qs-fx wind direction example
* @version 1.1
* @author AIIT XUOS Lab
* @date 2021.12.14
*/
#include <transform.h>
#include <sensor.h>
/**
* @description: Read a wind speed
* @return 0
*/
void WindSpeedQsFs(void)
{
struct SensorQuantity *wind_speed = SensorQuantityFind(SENSOR_QUANTITY_QS_FS_WINDSPEED, SENSOR_QUANTITY_WINDSPEED);
SensorQuantityOpen(wind_speed);
PrivTaskDelay(2000);
uint16 result = SensorQuantityRead(wind_speed);
printf("wind speed : %d.%d m/s\n", result/10, result%10);
SensorQuantityClose(wind_speed);
}
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_PARAM_NUM(0)|SHELL_CMD_DISABLE_RETURN, WindSpeedQsFs, WindSpeedQsFs, WindSpeedQsFs function);