Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 59 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ As it is currently only linux compatible we have created an image on DockerHub u

* Download the image and create and run a daemon container, giving it access to your default camera and a port through which to host a webserver.

```sudo docker run -itd -p 8080:8080 -p 3000:3000 --privileged \
-name gesture \
```
sudo docker run -itd -p 8080:8080 -p 3000:3000 --privileged \
--name gesture \
-v /dev/video0:/dev/video0 \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY admobilize/gesture```
-e DISPLAY=$DISPLAY admobilize/gesture
```

* Execute a command inside the docker, to run the node sample `handTracker.js`

Expand All @@ -46,7 +48,8 @@ As it is currently only linux compatible we have created an image on DockerHub u

It will return a `JSON` object with the location (both center (xc,yc) and top left corner (x,y)), size, hand type, and unique id.

```{
```
{
"results":
[{
"hand_type":0,
Expand All @@ -58,14 +61,44 @@ It will return a `JSON` object with the location (both center (xc,yc) and top le
"y":196,
"yc":288
}]
}```
}
```

For those running mac/windows, you would have to create a VirtualBox running linux to be able to access the camera from docker. Docker-engine runs a basic linux that doesn't recognize the camera. Docker is currently beta testing their new mac/windows docker which will be compatible with this library and you will be able to access your camera. Alternatively you can run detection through a node server in the node SDK where you can access it through `localhost:3000` in a browser.

```sudo docker exec -it gesture /bin/sh -c 'cd ~/matrix-gesture-node-sdk/; npm run start-test-server'```

(We have had some permission problems with google chrome and safari blocking the server on mac, but firefox works fine)

#### P.S
1. Err fix

Error response from daemon: Conflict.

1-1. Stop a running gesture container:

```docker stop gesture```

1-2. Force remove a running gestrue container:

```docker rm -f gestrue```

2. webcam in VirtualBox Guest OS on Windows Host.
https://reurl.cc/rQGAN

Windows Host

2-1. Install 'Oracle VM VirtualBox Extrnsion Pack'.

2-2. open cmd.

```cd c:\Program Files\Oracle\VirtualBox```

2-3. open VirtualBox.

```VboxManage controlvm "Ubuntu16" webcam attach .1```

*Replace "Ubuntu16" with your guest OS name.
### Using without Docker

As long as you have the required dependencies enter the node sdk directory and run:
Expand All @@ -76,7 +109,26 @@ or if you are root

```npm install && npm run-root-setup```

Run some examples!
### Note for gesture detection over video stream
1. A secure channel is required for the video stream, i.e. https. You'll need to get/configure the Nodejs ssl key pair.
2. The keys path are specified in file examples/detection-server/server.js
```
const privateKey = fs.readFileSync('YOUR_KEY_PATH/privkey.pem', 'utf8');
const certificate = fs.readFileSync('YOUR_KEY_PATH/cert.pem', 'utf8');
const ca = fs.readFileSync('YOUR_KEY_PATH/fullchain.pem', 'utf8');
```
3. check if the port for https (3000 in this example) is allowed to access from the firewall.
4. start the server by run the following command:

``` npm run start-test-server ```

5. You'll see message ``` listening on *:3000```
6. Launch your browser and access the web page at https://YOUR_DOMAIN:3000
7. You should be able to see the page as below:

![alt text](https://github.com/dfeng99/matrix-gesture-node-sdk/raw/master/docker/examples/gestureAI.png "Test over Video Stream")

Run some other examples!

`node examples/handTracker.js` or `npm run start-test-server`

Expand All @@ -87,4 +139,4 @@ The documentation can be found [here](http://gesture.ai/#/develop "Gesture.ai Do
Gesture.ai anonymously aggregates data from people using the SDK to improve the detection of gestures and to provide the best SDK possible. This data aggregation can be turned off from the client side but it is opt-out. To opt out, run `set_data_submit(false)` on creation of a `Gesture` class.

### Community
Visit and join our community [here](http://community.gesture.ai "Gesture.ai Community")
Visit and join our community [here](http://community.gesture.ai "Gesture.ai Community")
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmd_Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/facedetect.o := g++ '-DNODE_GYP_MODULE_NAME=gesture' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/willem/.node-gyp/0.12.10/include/node -I/home/willem/.node-gyp/0.12.10/src -I/home/willem/.node-gyp/0.12.10/deps/uv/include -I/home/willem/.node-gyp/0.12.10/deps/v8/include -I../node_modules/nan -I../../admobilize-detection-manager/lib/pico -I../src/libs -I../-I/usr/local/include/opencv -I../-I/usr/local/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -I/usr/local/include/opencv -I/usr/local/include -Wall -g -w -std=c++11 -O3 -ffunction-sections -fdata-sections -fno-tree-vrp -fno-tree-sink -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/facedetect.o.d.raw -c -o Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/facedetect.o ../../admobilize-detection-manager/lib/pico/facedetect.cpp
Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/facedetect.o: \
../../admobilize-detection-manager/lib/pico/facedetect.cpp \
../../admobilize-detection-manager/lib/pico/facedetect.hpp \
../../admobilize-detection-manager/lib/pico/constants.hpp \
../../admobilize-detection-manager/lib/pico/face-all.h
../../admobilize-detection-manager/lib/pico/facedetect.cpp:
../../admobilize-detection-manager/lib/pico/facedetect.hpp:
../../admobilize-detection-manager/lib/pico/constants.hpp:
../../admobilize-detection-manager/lib/pico/face-all.h:
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmd_Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/motiondetector.o := g++ '-DNODE_GYP_MODULE_NAME=gesture' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/willem/.node-gyp/0.12.10/include/node -I/home/willem/.node-gyp/0.12.10/src -I/home/willem/.node-gyp/0.12.10/deps/uv/include -I/home/willem/.node-gyp/0.12.10/deps/v8/include -I../node_modules/nan -I../../admobilize-detection-manager/lib/pico -I../src/libs -I../-I/usr/local/include/opencv -I../-I/usr/local/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -I/usr/local/include/opencv -I/usr/local/include -Wall -g -w -std=c++11 -O3 -ffunction-sections -fdata-sections -fno-tree-vrp -fno-tree-sink -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/motiondetector.o.d.raw -c -o Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/motiondetector.o ../../admobilize-detection-manager/lib/pico/motiondetector.cpp
Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/motiondetector.o: \
../../admobilize-detection-manager/lib/pico/motiondetector.cpp \
../../admobilize-detection-manager/lib/pico/motiondetector.hpp
../../admobilize-detection-manager/lib/pico/motiondetector.cpp:
../../admobilize-detection-manager/lib/pico/motiondetector.hpp:
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cmd_Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/uniqueness2.o := g++ '-DNODE_GYP_MODULE_NAME=gesture' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DBUILDING_NODE_EXTENSION' -I/home/willem/.node-gyp/0.12.10/include/node -I/home/willem/.node-gyp/0.12.10/src -I/home/willem/.node-gyp/0.12.10/deps/uv/include -I/home/willem/.node-gyp/0.12.10/deps/v8/include -I../node_modules/nan -I../../admobilize-detection-manager/lib/pico -I../src/libs -I../-I/usr/local/include/opencv -I../-I/usr/local/include -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -m64 -I/usr/local/include/opencv -I/usr/local/include -Wall -g -w -std=c++11 -O3 -ffunction-sections -fdata-sections -fno-tree-vrp -fno-tree-sink -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/uniqueness2.o.d.raw -c -o Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/uniqueness2.o ../../admobilize-detection-manager/lib/pico/uniqueness2.cpp
Release/obj.target/gesture/../admobilize-detection-manager/lib/pico/uniqueness2.o: \
../../admobilize-detection-manager/lib/pico/uniqueness2.cpp \
../../admobilize-detection-manager/lib/pico/brief.hpp \
../../admobilize-detection-manager/lib/pico/uniqueness2.hpp \
../../admobilize-detection-manager/lib/pico/constants.hpp \
../../admobilize-detection-manager/lib/pico/facedetect.hpp \
../../admobilize-detection-manager/lib/pico/posedetector.h \
../../admobilize-detection-manager/lib/pico/uniqueness.hpp
../../admobilize-detection-manager/lib/pico/uniqueness2.cpp:
../../admobilize-detection-manager/lib/pico/brief.hpp:
../../admobilize-detection-manager/lib/pico/uniqueness2.hpp:
../../admobilize-detection-manager/lib/pico/constants.hpp:
../../admobilize-detection-manager/lib/pico/facedetect.hpp:
../../admobilize-detection-manager/lib/pico/posedetector.h:
../../admobilize-detection-manager/lib/pico/uniqueness.hpp:
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmd_Release/obj.target/gesture.node := g++ -shared -pthread -rdynamic -m64 -Wl,-soname=gesture.node -o Release/obj.target/gesture.node -Wl,--start-group Release/obj.target/gesture/admobilize-detection-manager/lib/pico/facedetect.o Release/obj.target/gesture/admobilize-detection-manager/lib/pico/motiondetector.o Release/obj.target/gesture/admobilize-detection-manager/lib/pico/picornt.o Release/obj.target/gesture/admobilize-detection-manager/lib/pico/uniqueness2.o Release/obj.target/gesture/src/gesture_manager.o Release/obj.target/gesture/src/gesture_manager_impl.o Release/obj.target/gesture/src/curl_handler.o Release/obj.target/gesture/src/drawing.o Release/obj.target/gesture/src/sha1.o Release/obj.target/gesture/src/gesture_recognition.o -Wl,--end-group -L/usr/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core -lcurl
cmd_Release/obj.target/gesture.node := g++ -shared -pthread -rdynamic -m64 -Wl,-soname=gesture.node -o Release/obj.target/gesture.node -Wl,--start-group Release/obj.target/gesture/admobilize-detection-manager/lib/pico/facedetect.o Release/obj.target/gesture/admobilize-detection-manager/lib/pico/uniqueness2.o Release/obj.target/gesture/admobilize-detection-manager/lib/pico/motiondetector.o Release/obj.target/gesture/src/gesture_manager.o Release/obj.target/gesture/src/gesture_manager_impl.o Release/obj.target/gesture/src/gesture_recognition.o -Wl,--end-group -L/usr/local/lib -lopencv_shape -lopencv_stitching -lopencv_objdetect -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_ml -lopencv_imgproc -lopencv_flann -lopencv_core
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Release/obj.target/gesture/src/gesture_manager.o: \
../admobilize-detection-manager/lib/pico/motiondetector.hpp \
../admobilize-detection-manager/lib/pico/uniqueness2.hpp \
../admobilize-detection-manager/lib/pico/facedetect.hpp \
../admobilize-detection-manager/lib/pico/posedetector.h \
../src/curl_handler.h ../src/sha1.h ../src/libs/json.hpp
../admobilize-detection-manager/lib/pico/posedetector.h
../src/gesture_manager.cpp:
../src/gesture_manager.h:
../src/gesture_manager_impl.h:
Expand All @@ -18,6 +17,3 @@ Release/obj.target/gesture/src/gesture_manager.o: \
../admobilize-detection-manager/lib/pico/uniqueness2.hpp:
../admobilize-detection-manager/lib/pico/facedetect.hpp:
../admobilize-detection-manager/lib/pico/posedetector.h:
../src/curl_handler.h:
../src/sha1.h:
../src/libs/json.hpp:
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Release/obj.target/gesture/src/gesture_manager_impl.o: \
../admobilize-detection-manager/lib/pico/uniqueness2.hpp \
../admobilize-detection-manager/lib/pico/facedetect.hpp \
../admobilize-detection-manager/lib/pico/posedetector.h \
../src/gesture_manager.h ../src/curl_handler.h ../src/sha1.h \
../src/libs/json.hpp
../src/gesture_manager.h
../src/gesture_manager_impl.cpp:
../src/gesture_manager_impl.h:
../admobilize-detection-manager/lib/pico/facedetect.hpp:
Expand All @@ -18,6 +17,3 @@ Release/obj.target/gesture/src/gesture_manager_impl.o: \
../admobilize-detection-manager/lib/pico/facedetect.hpp:
../admobilize-detection-manager/lib/pico/posedetector.h:
../src/gesture_manager.h:
../src/curl_handler.h:
../src/sha1.h:
../src/libs/json.hpp:
Binary file modified docker/build/Release/gesture.node
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docker/build/Release/obj.target/gesture.node
Binary file not shown.
Binary file not shown.
Binary file modified docker/build/Release/obj.target/gesture/src/gesture_manager.o
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 2 additions & 7 deletions docker/build/gesture.target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,10 @@ INCS_Release := \

OBJS := \
$(obj).target/$(TARGET)/admobilize-detection-manager/lib/pico/facedetect.o \
$(obj).target/$(TARGET)/admobilize-detection-manager/lib/pico/motiondetector.o \
$(obj).target/$(TARGET)/admobilize-detection-manager/lib/pico/picornt.o \
$(obj).target/$(TARGET)/admobilize-detection-manager/lib/pico/uniqueness2.o \
$(obj).target/$(TARGET)/admobilize-detection-manager/lib/pico/motiondetector.o \
$(obj).target/$(TARGET)/src/gesture_manager.o \
$(obj).target/$(TARGET)/src/gesture_manager_impl.o \
$(obj).target/$(TARGET)/src/curl_handler.o \
$(obj).target/$(TARGET)/src/drawing.o \
$(obj).target/$(TARGET)/src/sha1.o \
$(obj).target/$(TARGET)/src/gesture_recognition.o

# Add to the list of files we specially track dependencies for.
Expand Down Expand Up @@ -151,8 +147,7 @@ LIBS := \
-lopencv_ml \
-lopencv_imgproc \
-lopencv_flann \
-lopencv_core \
-lcurl
-lopencv_core

$(obj).target/gesture.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(obj).target/gesture.node: LIBS := $(LIBS)
Expand Down
14 changes: 4 additions & 10 deletions docker/examples/detection-server/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,11 @@
<video autoplay id="video" width="640" height="480"></video>
<canvas id="canvas" width="640" height="480"></canvas>
<div>
<div id="scroll"><div id="results"></div></div>
<div id="scroll">
<div id="results"></div>
</div>
<div id="scrollThis">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi nec ex hendrerit, ultrices risus vitae, imperdiet ex. Curabitur justo quam, porta nec lectus at, lobortis lobortis urna. Nulla maximus sagittis velit, eu dignissim arcu rhoncus a. Morbi metus metus, feugiat pharetra velit vel, egestas iaculis mauris. Nam malesuada neque eget aliquet ultricies. Curabitur elementum varius metus, nec fringilla dolor congue laoreet. Aliquam a enim sem. Curabitur ac laoreet leo. Morbi sed orci erat.

Phasellus non libero massa. Proin posuere viverra orci eu dignissim. Suspendisse viverra, tellus a lacinia porttitor, nisl dolor facilisis lectus, nec rutrum massa ante non mauris. Morbi sodales tempor turpis ut aliquam. Mauris aliquam sit amet elit ac euismod. Nulla non euismod enim. Suspendisse semper ipsum quis massa facilisis, quis facilisis enim auctor. Duis leo turpis, maximus et pharetra sed, posuere sed nulla. Mauris vel sem eget nulla pulvinar tempor interdum vel lectus. Duis sit amet consectetur justo. Ut in eros vel mauris eleifend luctus.

Pellentesque feugiat blandit ullamcorper. Donec eget purus nec augue tincidunt dapibus. Aliquam eget felis posuere, egestas lorem vitae, malesuada arcu. Morbi velit tortor, dictum nec consequat vitae, congue eu urna. Sed auctor accumsan bibendum. Sed non auctor sem. Nullam hendrerit pretium ex, ut scelerisque lorem luctus eget. Morbi lacinia accumsan eros at posuere. Quisque vestibulum et odio sed luctus. Nunc neque orci, vehicula vel pulvinar et, maximus quis purus. Donec pretium sed orci sed porta.

Integer ultrices condimentum mauris, vel rutrum risus auctor mattis. Praesent fringilla eleifend tellus, at laoreet quam vehicula in. Praesent commodo imperdiet odio in laoreet. Sed hendrerit velit et lectus interdum, sit amet luctus metus commodo. Aliquam erat volutpat. Morbi aliquet eros quis consectetur condimentum. Curabitur suscipit, sapien et placerat ultricies, enim arcu lobortis nulla, ut varius augue nulla in metus. Cras porta sed lorem non sodales. Suspendisse faucibus, justo sit amet euismod posuere, diam quam efficitur nisl, at imperdiet metus nisi in orci. In a leo pulvinar, lobortis ex vitae, dapibus dolor. Nulla sodales arcu ut dolor tristique, quis suscipit urna maximus. Sed accumsan sapien id ante egestas ullamcorper. Aenean ac elit a purus porttitor hendrerit vel a nisl.

Mauris magna ligula, pretium sed volutpat sit amet, porta id erat. Nulla aliquet commodo tellus, ut aliquet diam tincidunt non. Aliquam condimentum tincidunt fringilla. Quisque sed laoreet nibh. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum tincidunt porttitor eros, eget tristique neque venenatis ac. Donec cursus blandit tellus, vel consequat eros eleifend egestas. Pellentesque sagittis lobortis eros eget accumsan. Pellentesque consequat ex eget felis semper hendrerit. Suspendisse cursus elit id metus mattis, consectetur lacinia nunc ornare. Mauris ut odio sed nunc dignissim porta.
<h2>Hello David</h2>
</div>
</div>

Expand Down
Loading