Skip to content

Commit fa1864e

Browse files
nicolashei1201IRISZZW
authored andcommitted
NCKU_house_keeper
1 parent 36b443c commit fa1864e

25 files changed

+9415
-0
lines changed
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# NCKU Aitum Angelfish
2+
3+
## House Keeper - Smart Face Recognition System
4+
5+
## Introduction
6+
Our goal is to implements light face detection CNN model on ARC IoTdk board, edge devices such as ARC IoTdk board has advantages like low power comsumption and reasonable price are very suitable for preprocessing or wake-up device of the back-end system(in this case, we use face recognition CNN model as our backend system).
7+
## System architecture
8+
![system](./img/system.jpg)
9+
## Required Hardware
10+
- Camera : [OV7670](https://www.voti.nl/docs/OV7670.pdf)
11+
12+
- Always-On Face Detector Device : [ARC IoTDK](https://embarc.org/embarc_osp/doc/build/html/board/iotdk.html)
13+
14+
- Micro USB Cable
15+
16+
### Hardware cable connection
17+
1.Connect ov7670 to IoTDK Board.
18+
19+
|ov7670|ARC: 2x18 Pin Extension Header|
20+
|-|-|
21+
| SCL|I2C0_SCL (need pull-up 10K resistor)|
22+
| SDA|I2C0_SDA (need pull-up 10K resistor)|
23+
24+
|ov7670|ARC: Arduino PIN|
25+
|-|-|
26+
|VSYBC | arduino IO0|
27+
|PCLK | arduino IO1|
28+
|XCLK | arduino IO3|
29+
|D7~D0 | arduino IO4~IO11|
30+
|3V3 | +3.3V|
31+
|RESET | +3.3V|
32+
|GND | GND|
33+
|PWDN | GND|
34+
35+
2.Connect IoTDK Board to computer with micro USB Cable.
36+
## Required Software
37+
- MetaWare Development Toolkit
38+
39+
- embARC Machine Learning Inference Library
40+
41+
- [embARC Open Software Platform (OSP)](https://github.com/foss-for-synopsys-dwc-arc-processors/embarc_osp/tree/embarc_mli)
42+
43+
## User Manual
44+
45+
#### Before running
46+
- Download source code from github
47+
48+
- Setup hardware connection
49+
50+
- Goto `(embarc_osp)\middleware\common\console_io.c`
51+
52+
- Change
53+
54+
console_uart = uart_get_dev(CONSOLE_UART_ID);
55+
56+
console_uart->uart_open(BOARD_CONSOLE_UART_BAUD);
57+
58+
xdev_in(console_getchar);
59+
xdev_out(console_putchar);
60+
- to
61+
62+
console_uart = uart_get_dev(CONSOLE_UART_ID);
63+
64+
console_uart->uart_open(1500000);
65+
66+
xdev_in(console_getchar);
67+
xdev_out(console_putchar);
68+
69+
- Goto `python\read.py` and `python\build.py`
70+
- In `port='COM3',`change `COM3` to the port which your IoTDK Board connect.
71+
72+
73+
#### Run the application
74+
##### To start face detection and recognition
75+
- Type `python read.py` and wait the terminal to print `Configured`
76+
77+
- Type `make run` to download and start the program on IoTDK Board
78+
79+
- If terminal shows memory allocation error, open `obj_iotdk_10\mw_arcem9d\linker_mw.ldf`
80+
- change
81+
82+
GROUP : {
83+
.mli_model_p2 ALIGN(8): {
84+
_f_mli_model_p2 = .;
85+
*(.mli_model_p2 .mli_model_p2.*)
86+
_e_mli_model_p2 = .;
87+
}
88+
} > REGION_DCCM AT > REGION_ICCM
89+
90+
_load_addr_mli_model_p2 = LOADADDR(.mli_model_p2);
91+
92+
GROUP : {
93+
.mli_model ALIGN(8): {
94+
_f_mli_model = .;
95+
*(.mli_model .mli_model.*)
96+
_e_mli_model = .;
97+
}
98+
} > REGION_XCCM AT > REGION_ICCM
99+
100+
- to
101+
102+
GROUP : {
103+
.mli_model_p2 ALIGN(8): {
104+
_f_mli_model_p2 = .;
105+
*(.mli_model_p2 .mli_model_p2.*)
106+
_e_mli_model_p2 = .;
107+
}
108+
} > REGION_DCCM AT > REGION_DCCM
109+
110+
_load_addr_mli_model_p2 = LOADADDR(.mli_model_p2);
111+
112+
GROUP : {
113+
.mli_model ALIGN(8): {
114+
_f_mli_model = .;
115+
*(.mli_model .mli_model.*)
116+
_e_mli_model = .;
117+
}
118+
} > REGION_DCCM AT > REGION_DCCM
119+
120+
- Type `make run` to download and start the program on IoTDK Board again
121+
122+
##### To sign up a new face ID in face recognition database
123+
- Type `python build.py (yourname)` ,you can set `(yourname)` parameter to any name you want and wait the terminal to print `Configured`.
124+
125+
- Type `make run` to download and start the program on IoTDK Board.
126+
127+
- Type any key and the system will sign up camera's current frame with `(yourname)`.
128+
129+
##### To delete face ID you signed up
130+
131+
- Type `python delete_data.py` and insert the ID you want to delete.
101 KB
Loading
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef _NCKU_FD_H_
2+
#define _NCKU_FD_H_
3+
4+
#include "stdint.h"
5+
6+
#define IN_POINTS (12*12*3)
7+
#define OUT_POINTS (2)
8+
9+
// Face Trigger Input dimmensions size (same for X and Y)
10+
#define FT_MODEL_IN_DIM_SZ (12)
11+
12+
// Face Trigger Input size
13+
#define FT_MODEL_IN_POINTS (3 * FT_MODEL_IN_DIM_SZ * FT_MODEL_IN_DIM_SZ)
14+
15+
//int mli_face_detection(const char * debug_ir_root);
16+
17+
#endif

0 commit comments

Comments
 (0)