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: docs/reference/depthestimation.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,13 +14,13 @@ Get up and running with the [webcam example](https://editor.p5js.org/ml5/sketche
14
14
## Examples
15
15
-[Webcam](https://editor.p5js.org/ml5/sketches/1AlSdDhwA): Show the live depth map of the video captured by the webcam.
16
16
-[Video](https://editor.p5js.org/ml5/sketches/YGAqvhn1o): Generate the depth map of a video file as it plays.
17
-
-[Single Image](https://editor.p5js.org/ml5/sketches/VpVUFgtOU): Depth map of an image using single-shot estimation.
17
+
-[Single Image](https://editor.p5js.org/ml5/sketches/VpVUFgtOU): Depth map of an image using single frame estimation.
18
18
-[Mask Background](https://editor.p5js.org/ml5/sketches/zxi8xUuq4): Showcases how to mask out the background from the depth result.
19
19
-[Point Cloud](https://editor.p5js.org/ml5/sketches/7EOC8txJ1): Creates a live 3D point cloud visualization of the webcam video.
20
20
-[Mesh](https://editor.p5js.org/ml5/sketches/CE2f9l38k): Creates a live 3D mesh geometry of the webcam video.
21
21
22
22
## Step-by-Step Guide
23
-
### Initialization and options
23
+
### Initialization and Options
24
24
Before starting, make sure you have included the ml5 library in your `index.html` file:
25
25
26
26
```html
@@ -52,12 +52,12 @@ async function setup() {
52
52
}
53
53
```
54
54
55
-
### Estimating depth
56
-
As with many other ml5 models, you have two options to run depth estimation on the image, video or webcam of your choice: _Continuous Estimation_ and _Single Shot Estimation_ .
55
+
### Estimating Depth
56
+
As with many other ml5 models, you have two options to run depth estimation on the image, video or webcam of your choice: _Continuous Estimation_ and _Single Frame Estimation_ .
57
57
58
58
For any of these, make sure you first load the image, video or start the webcam capture. This is the media we will pass to the model.
59
59
60
-
#### Continuous estimation
60
+
#### Continuous Estimation
61
61
This method is used to continuously estimate depth on every frame of a video or webcam feed.
62
62
```js
63
63
// Make sure to load the model in preload or async in p5 2.0!
@@ -75,7 +75,7 @@ function gotResults(result) {
75
75
```
76
76
Using this method, the depth estimator will take care of doing estimation of a frame and waiting for it to finish before working on the next frame. Any time a depth map is ready, it will fire the callback function to provide it.
77
77
78
-
#### Single shot estimation
78
+
#### Single Frame Estimation
79
79
This method is used to estimate depth once, for a single image:
80
80
```js
81
81
// Make sure to load the image and the model in preload or asyn in p5 2.0!
@@ -90,7 +90,7 @@ function gotResults(result) {
90
90
```
91
91
Because the estimation takes time, we pass in a callback function that will fire when estimation is ready. The `estimate` method is called in setup because it **will only run once**. If calling it multiple times, it is prudent to wait for each operation to finish before starting the next one.
92
92
93
-
### Using the depth result
93
+
### Using the Depth Result
94
94
Whenever the callback function fires, we have acces to the depth result that contains all the depth information.
95
95
```js
96
96
let depthMap;
@@ -171,7 +171,7 @@ depthEstimator.estimateStop()
171
171
```
172
172
173
173
### depthEstimator.estimate()
174
-
This method is used for _Single Shot Estimation_: estimating depth one time on a single image or video/webcam frame.
174
+
This method is used for _Single Frame Estimation_: estimating depth one time on a single image or video/webcam frame.
0 commit comments