You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-245
Original file line number
Diff line number
Diff line change
@@ -113,251 +113,7 @@ NOTE: We provide 3 ways of uploading image to our SDK. They are url, blob and re
113
113
| Nodejs | ✔ | ✔ | ✔ |
114
114
115
115
### Webcam demo
116
-
117
-
In this part of docs we show how to use our detection service with webcamera. **NOTE:** we have chosen reactjs as it is today's one of the most popular UI library.
118
-
119
-
1. Clone our repository
120
-
2. Enter to ```webcam_demo``` folder and install packages
121
-
122
-
``` cd webcam_demo```
123
-
124
-
```npm install```
125
-
126
-
3. Change detection API key inside ```src > App.js``` line ```40```
127
-
128
-
4. Start project
129
-
130
-
```npm start```
131
-
132
-
5. Click ```video start``` button to start your webcamera
133
-
134
-
*OR follow below instructions to create project by yourself*
135
-
136
-
1. Install reactjs
137
-
138
-
```npx create-react-app compreface-demo```
139
-
140
-
2. Enter to project folder
141
-
142
-
```cd compreface-demo```
143
-
144
-
3. Install CompreFace SDK
145
-
146
-
```npm i @exadel/compreface-js-sdk```
147
-
148
-
4. Create your component and copy/past following code. NOTE: We have used functional component and video tag used to connect to your webcamera and canvas tags used for drawing square and some extra data.
149
-
150
-
```
151
-
import { useRef } from 'react'
152
-
import { CompreFace } from '@exadel/compreface-js-sdk';
5. Add ability to start webcamera when user clicks "Start video" button. Put following code into ```handleVideoStart()``` function. ```Navigator.mediaDevices``` is built in read-only property of browser which enables user to access webcamera.
6. Initialize CompreFace instances and catch video event which fired when webcamera starts working. Your code should look like as following example. ```Play``` event listener fires when webcamera starts working and this is place where we need to use CompreFace SDK. NOTE: ```next_frame``` custom event created in order to create kind of recursion effect when we drawing square on face.
190
-
```
191
-
import { useRef } from 'react'
192
-
import { CompreFace } from '@exadel/compreface-js-sdk';
0 commit comments