-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding MoveNet to Pose Detection API (#627)
* Adding MoveNet skeleton and support files * Adding MoveNet implementation and supporting files * Lint MoveNet files (except for line length) Line lengths will be updated in an upcoming commit. * Use correct formatting, which includes line lengths * Remove test URL * Addressing code review comments * Fix MoveNet visualization in live demo * Updates after review comments MoveNet determineCropRegion refactored and moved OneEuroFilter to common filters directory * Remove configurable keypoint threshold This threshold was mostly used for internal cropping logic. * Merge Model and KeypointModel, plus additional updates after review * Move one euro filter back to MoveNet with TODO * Add test for MoveNet * Use MoveNet as default model in pose demo * Add MoveNet model type selection to pose demo * Run models at highest possible speed in pose demo * Fix error in cropping code * Remove comment * Updates to resolve review comments * Fix CI test * Simplify pose array creation
- Loading branch information
1 parent
2b3484c
commit 8717622
Showing
16 changed files
with
826 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* @license | ||
* Copyright 2021 Google LLC. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* ============================================================================= | ||
*/ | ||
|
||
import {MoveNetEstimationConfig, MoveNetModelConfig} from './types'; | ||
|
||
export const SINGLEPOSE_LIGHTNING = 'SinglePose.Lightning'; | ||
export const SINGLEPOSE_THUNDER = 'SinglePose.Thunder'; | ||
|
||
export const VALID_MODELS = [SINGLEPOSE_LIGHTNING, SINGLEPOSE_THUNDER]; | ||
|
||
export const MOVENET_SINGLEPOSE_LIGHTNING_URL = | ||
'https://tfhub.dev/google/tfjs-model/movenet/singlepose/lightning/1'; | ||
export const MOVENET_SINGLEPOSE_THUNDER_URL = | ||
'https://tfhub.dev/google/tfjs-model/movenet/singlepose/thunder/1'; | ||
|
||
export const MOVENET_SINGLEPOSE_LIGHTNING_RESOLUTION = 192; | ||
export const MOVENET_SINGLEPOSE_THUNDER_RESOLUTION = 256; | ||
|
||
// The default configuration for loading MoveNet. | ||
export const MOVENET_CONFIG: MoveNetModelConfig = { | ||
modelType: SINGLEPOSE_LIGHTNING | ||
}; | ||
|
||
export const MOVENET_SINGLE_POSE_ESTIMATION_CONFIG: MoveNetEstimationConfig = { | ||
maxPoses: 1 | ||
}; | ||
|
||
export const MIN_CROP_KEYPOINT_SCORE = 0.3; |
Oops, something went wrong.