Skip to content

Commit 64ddade

Browse files
author
XiaochaoGONG
committed
Init commit
0 parents  commit 64ddade

File tree

137 files changed

+28997
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+28997
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
3+
sdkconfig
4+
sdkconfig.old

.gitlab-ci.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
stages:
2+
- build
3+
- deploy
4+
5+
variables:
6+
# System environment
7+
8+
# Common parameters for the 'make' during CI tests
9+
MAKEFLAGS: "-j5 --no-keep-going"
10+
11+
# GitLab-CI environment
12+
13+
# more attempts for more robust
14+
GET_SOURCES_ATTEMPTS: "10"
15+
ARTIFACT_DOWNLOAD_ATTEMPTS: "10"
16+
17+
# We use get_sources.sh script to fetch the submodules and/or re-fetch the repo
18+
# if it was corrupted (if submodule update fails this can happen)
19+
GIT_STRATEGY: clone
20+
GIT_SUBMODULE_STRATEGY: none
21+
IDF_PATH: "$CI_PROJECT_DIR/esp-idf"
22+
23+
before_script:
24+
# add gitlab ssh key
25+
- mkdir -p ~/.ssh
26+
- chmod 700 ~/.ssh
27+
- echo -n $GITLAB_KEY > ~/.ssh/id_rsa_base64
28+
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
29+
- chmod 600 ~/.ssh/id_rsa
30+
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
31+
# replace submodule esp-idf to internal repository to speedup cloning
32+
- sed -i "s%https://github.com/espressif/esp-idf%${GITLAB_SSH_SERVER}/idf/esp-idf.git%" .gitmodules
33+
- git submodule update --init
34+
# (the same regular expressions are used to set these are used in 'only:' sections below
35+
- source esp-idf/tools/ci/configure_ci_environment.sh
36+
37+
# fetch the submodules (& if necessary re-fetch repo) from gitlab
38+
- time ./esp-idf/tools/ci/get-full-sources.sh
39+
40+
41+
.add_gitlab_key_before:
42+
before_script: &add_gitlab_key_before
43+
- echo "Not fetching submodules"
44+
- source ${IDF_PATH}/tools/ci/configure_ci_environment.sh
45+
# add gitlab ssh key
46+
- mkdir -p ~/.ssh
47+
- chmod 700 ~/.ssh
48+
- echo -n $AUTO_KEY > ~/.ssh/id_rsa_base64
49+
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
50+
- chmod 600 ~/.ssh/id_rsa
51+
- echo -e "Host gitlab.espressif.cn\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
52+
53+
.build_template: &build_template
54+
stage: build
55+
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
56+
tags:
57+
- build
58+
variables:
59+
BATCH_BUILD: "1"
60+
V: "0"
61+
62+
.build_examples_make_template: &build_examples_make_template
63+
<<: *build_template
64+
retry: 1
65+
artifacts:
66+
when: always
67+
paths:
68+
- build_examples/*/*/build/*.bin
69+
- build_examples/*/*/build/*.elf
70+
- build_examples/*/*/build/*.map
71+
- build_examples/*/*/build/download.config
72+
- build_examples/*/*/build/bootloader/*.bin
73+
- ${LOG_PATH}
74+
- ${IDF_PATH}/tools/ci
75+
expire_in: 1 week
76+
variables:
77+
IDF_CI_BUILD: "1"
78+
LOG_PATH: "$CI_PROJECT_DIR/log_examples_make"
79+
script:
80+
# it's not possible to build 100% out-of-tree and have the "artifacts"
81+
# mechanism work, but this is the next best thing
82+
- rm -rf build_examples
83+
- mkdir build_examples
84+
- cd build_examples
85+
- mkdir -p ${LOG_PATH}
86+
- ${CI_PROJECT_DIR}/tools/ci/build_examples.sh "${CI_PROJECT_DIR}/examples" "${CI_JOB_NAME}"
87+
88+
build_examples_make_00:
89+
<<: *build_examples_make_template
90+
91+
92+
push_to_github:
93+
stage: deploy
94+
image: $CI_DOCKER_REGISTRY/esp32-ci-env$BOT_DOCKER_IMAGE_TAG
95+
tags:
96+
- deploy
97+
only:
98+
- master
99+
- /^release\/v/
100+
when: on_success
101+
dependencies:
102+
- build_examples_make_00
103+
before_script:
104+
- echo "skip default before_script"
105+
script:
106+
- mkdir -p ~/.ssh
107+
- chmod 700 ~/.ssh
108+
- echo -n $GH_PUSH_KEY > ~/.ssh/id_rsa_base64
109+
- base64 --decode --ignore-garbage ~/.ssh/id_rsa_base64 > ~/.ssh/id_rsa
110+
- chmod 600 ~/.ssh/id_rsa
111+
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
112+
- git remote remove github &>/dev/null || true
113+
- git remote add github [email protected]:espressif/esp-who.git
114+
- ${IDF_PATH}/tools/ci/push_to_github.sh

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "esp-idf"]
2+
path = esp-idf
3+
url = https://github.com/espressif/esp-idf
4+
[submodule "components/esp-face"]
5+
path = components/esp-face
6+
url = https://github.com/espressif/esp-face
7+
[submodule "components/esp32-camera"]
8+
path = components/esp32-camera
9+
url = https://github.com/espressif/esp32-camera.git

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Change log for esp-who
2+
3+
## 0.1.0
4+
Initial commit, esp-who appear in the world.
5+
- Elementry functions such as image processing and matrix computing
6+
- Face detection
7+
- Components such as camera
8+
9+
## 0.1.1
10+
Open coefficients for facial detection
11+
- Provide interface to generate customized coefficients via `mkmodel` (temporally support linux only, other os coming soon)
12+
13+
## 0.5.0
14+
Face recognition framework
15+
- Add face recognition relative framework
16+
- Provide basic face recognition example
17+
- Move `esp_facenet` to `esp-face` as submodule
18+
- Add some documents for API reference and guide
19+
20+
## 0.5.1
21+
Modify recognition example
22+
- enroll procedure changes to waiting 3 seconds
23+
- update readme

LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
ESPRESSIF MIT License
2+
3+
Copyright (c) 2018 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
4+
5+
Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case,
6+
it is free of charge, to any person obtaining a copy of this software and associated
7+
documentation files (the "Software"), to deal in the Software without restriction, including
8+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished
10+
to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all copies or
13+
substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# ESP-WHO
2+
3+
ESP-WHO is a face detection and recognition platform that is currently based on Espressif Systems' [ESP32](https://espressif.com/en/products/hardware/esp32/overview) chip.
4+
5+
# Overview
6+
ESP-WHO supports development of face detection and recognition applications based around Espressif Systems' [ESP32](https://espressif.com/en/products/hardware/esp32/overview) chip in the most convenient way. With ESP-WHO, you can easily build up face detection- and recognition-featured applications, for instance:
7+
* A coffee machine that brews coffee according to your taste preference;
8+
* Home applicance that will shut off the electricity automatically when unsupervised children are operating them;
9+
* And other more applications that suit your needs.
10+
11+
In general, the ESP-WHO features will be supported as shown below:
12+
13+
![overview](img/overview.jpg)
14+
15+
In ESP-WHO, Detection, Recognition and Image Utility are at the core of the platform.
16+
17+
18+
* **Image Utility** offers fundamental image processing APIs for ESP32.
19+
20+
* **Detection** takes images as input and give the position of face if there is a face. It is implemented with MTMN model, which refers to [MTCNN](http://cn.arxiv.org/abs/1604.02878) and [MobileNet](https://arxiv.org/abs/1801.04381). However, we replace CNN with MobileNet block and the model size is quite smaller than other face detection models.
21+
22+
* **Recognition** is to identify the particular person, and it needs the results of detection. It is implemented with MobileFace model.
23+
24+
25+
Both input and output are flexible.
26+
27+
* Image sources could be **input** via camera. However, we don't provide many drivers right now, those for other camera modules will be released in the future.
28+
29+
* Results could be **output** and displayed through Command line, LCD or even website via Wi-Fi http service.
30+
31+
32+
# Quick Start with ESP-WHO
33+
34+
## Hardware Preparation
35+
36+
To run ESP-WHO, you need to have a development board which integrates a **ESP32 module** that has sufficient GPIO pins and more than **4 MB** external SPI RAM. In this case, we take **ESP-WROVER-KIT** as the test board, which is highly recommended for getting started with ESP-WHO.
37+
38+
On how to configure ESP32 module for your applications, please refer to the README.md of each example.
39+
40+
## Software Preparation
41+
42+
### Image
43+
44+
The recommended resolution of input image is **QVGA (320x240)**.
45+
46+
As for choosing camera as an image offer, make sure that the ESP32 module you choose offers specific pins that your camera needs. If there are pin conflicts, please refer to the pin connection in README.md of each example.
47+
48+
By now, we have provided the driver of **OV2640**, which is highly recommended to get started with.
49+
50+
### ESP-WHO
51+
Make sure you clone the project recursive:
52+
53+
```
54+
git clone --recursive https://github.com/espressif/esp-who.git
55+
```
56+
57+
If you clone project without `--recursive` flag, please go to the `esp-who` directory and run command `git submodule update --init` before doing anything.
58+
59+
### ESP-IDF
60+
See setup guides for detailed instructions to set up the ESP-IDF:
61+
62+
* [Getting Started Guide for the stable ESP-IDF version](https://docs.espressif.com/projects/esp-idf/en/stable/get-started/)
63+
* [Getting Started Guide for the latest (master branch) ESP-IDF version](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/)
64+
65+
In this case, we take [ESP-IDF v3.1](https://github.com/espressif/esp-idf/releases/v3.1) as the test version.
66+
67+
68+
# Components
69+
70+
Components is the main framework of the SDK, with camera driver and algorithm inside.
71+
72+
See the following sections for more details about components.
73+
74+
## Camera
75+
76+
The [camera](components/camera) component contains drivers for camera devices of ESP32. Now OV2640 is supported.
77+
78+
79+
## esp-face
80+
81+
The [esp-face](components/esp-face) component contains the APIs of ESP-WHO neural networks, including face detection and recognition framework.
82+
83+
84+
# Examples
85+
The folder of [examples](examples) contains sample applications demonstrating the API features of ESP-WHO.
86+
87+
Take one Face Detection as an example.
88+
89+
1. Get into one example folder `esp-who/examples/single_chip/detection_with_command_line`.
90+
```
91+
cd esp-who/examples/single_chip/detection_with_command_line
92+
```
93+
94+
2. Compile the project. You may run `make defconfig` before `make flash` to get the default configurations.
95+
```
96+
make defconfig
97+
make flash
98+
```
99+
3. Advanced users can modify some options by using the command `make menuconfig`.
100+
101+
102+
Check README.md of each example for more details.
103+
104+
105+
# Resources
106+
107+
* [Check the Issues section on github](https://github.com/espressif/esp-who/issues) if you find a bug or have a feature request, please check existing Issues before opening a new one.
108+
109+
* If you're interested in contributing to ESP-WHO, please check the [Contributions Guide](https://esp-idf.readthedocs.io/en/latest/contribute/index.html).

components/component_conf.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components
2+
EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/lib
3+
EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/image_util
4+
EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_detection/fd_coefficients
5+
EXTRA_COMPONENT_DIRS += $(SOLUTION_PATH)/components/esp-face/face_recognition/fr_coefficients

components/esp-face

Submodule esp-face added at 822bdfd

components/esp32-camera

Submodule esp32-camera added at f1a7c35
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
default.vim
2+
fontconvert/fontconvert

0 commit comments

Comments
 (0)