Skip to content

Commit c37b119

Browse files
authored
[posenet] Update docs. (#459)
1 parent 6849175 commit c37b119

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

posenet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const net = await posenet.load({
7474

7575
* **architecture** - Can be either `MobileNetV1` or `ResNet50`. It determines which PoseNet architecture to load.
7676

77-
* **outputStride** - Can be one of `8`, `16`, `32` (Stride `16`, `32` are supported for the ResNet architecture and stride `8`, `16`, `32` are supported for the MobileNetV1 architecture). It specifies the output stride of the PoseNet model. The smaller the value, the larger the output resolution, and more accurate the model at the cost of speed. Set this to a larger value to increase speed at the cost of accuracy.
77+
* **outputStride** - Can be one of `8`, `16`, `32` (Stride `16`, `32` are supported for the ResNet architecture and stride `8`, `16`, `32` are supported for the MobileNetV1 architecture. However if you are using stride `32` you must set the multiplier to `1.0`). It specifies the output stride of the PoseNet model. The smaller the value, the larger the output resolution, and more accurate the model at the cost of speed. Set this to a larger value to increase speed at the cost of accuracy.
7878

7979
* **inputResolution** - A `number` or an `Object` of type `{width: number, height: number}`. Defaults to `257.` It specifies the size the image is resized and padded to before it is fed into the PoseNet model. The larger the value, the more accurate the model at the cost of speed. Set this to a smaller value to increase speed at the cost of accuracy. If a number is provided, the image will be resized and padded to be a square with the same width and height. If `width` and `height` are provided, the image will be resized and padded to the specified width and height.
8080

posenet/src/posenet_model.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ function validateModelConfig(config: ModelConfig) {
153153
`for architecture ${config.architecture}.`);
154154
}
155155

156+
if (config.architecture === 'MobileNetV1' && config.outputStride === 32 &&
157+
config.multiplier !== 1) {
158+
throw new Error(
159+
`When using an output stride of 32, ` +
160+
`you must select 1 as the multiplier.`);
161+
}
162+
156163
return config;
157164
}
158165

0 commit comments

Comments
 (0)