[Model] Add tinypose single && pipeline model (#177)

* Add tinypose model

* Add PPTinypose python API

* Fix picodet preprocess bug && Add Tinypose examples

* Update tinypose example code

* Update ppseg preprocess if condition

* Update ppseg backend support type

* Update permute.h

* Update README.md

* Update code with comments

* Move files dir

* Delete premute.cc

* Add single model pptinypose

* Delete pptinypose old code in ppdet

* Code format

* Add ppdet + pptinypose pipeline model

* Fix bug for posedetpipeline

* Change Frontend to ModelFormat

* Change Frontend to ModelFormat in __init__.py

* Add python posedetpipeline/

* Update pptinypose example dir name

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Create keypointdetection_result.md

* Create README.md

* Create README.md

* Create README.md

* Update README.md

* Update README.md

* Create README.md

* Fix det_keypoint_unite_infer.py bug

* Create README.md

* Update PP-Tinypose by comment

* Update by comment

* Add pipeline directory

* Add pptinypose dir

* Update pptinypose to align accuracy

* Addd warpAffine processor

* Update GetCpuMat to  GetOpenCVMat

* Add comment for pptinypose && pipline

* Update docs/main_page.md

* Add README.md for pptinypose

* Add README for det_keypoint_unite

* Remove ENABLE_PIPELINE option

* Remove ENABLE_PIPELINE option

* Change pptinypose default backend

* PP-TinyPose Pipeline support multi PP-Detection models

* Update pp-tinypose comment

* Update by comments

* Add single test example

Co-authored-by: Jason <jiangjiajun@baidu.com>
This commit is contained in:
huangjianhui
2022-10-21 09:28:23 +08:00
committed by GitHub
parent 49ab773d22
commit b565c15bf7
62 changed files with 2583 additions and 20 deletions

View File

@@ -14,6 +14,7 @@
#pragma once
#include <opencv2/opencv.hpp>
#include <set>
#include <vector>
#include "fastdeploy/core/fd_tensor.h"
@@ -24,6 +25,7 @@
#include "fastdeploy/function/reduce.h"
#include "fastdeploy/function/softmax.h"
#include "fastdeploy/function/transpose.h"
#include "fastdeploy/vision/common/processors/mat.h"
namespace fastdeploy {
namespace vision {
@@ -73,6 +75,27 @@ FASTDEPLOY_DECL float CosineSimilarity(const std::vector<float>& a,
const std::vector<float>& b,
bool normalized = true);
bool CropImageByBox(const Mat& src_im, Mat* dst_im,
const std::vector<float>& box, std::vector<float>* center,
std::vector<float>* scale, const float expandratio = 0.3);
/**
* Function: for keypoint detection model, fine positioning of keypoints in postprocess
* Parameters:
* heatmap: model inference results for keypoint detection models
* dim: shape information of the inference result
* coords: coordinates after refined positioning
* px: px = int(coords[ch * 2] + 0.5) , refer to API detection::GetFinalPredictions
* py: px = int(coords[ch * 2 + 1] + 0.5), refer to API detection::GetFinalPredictions
* index: index information of heatmap pixels
* ch: channel
* Paper reference: DARK postpocessing, Zhang et al. Distribution-Aware Coordinate
* Representation for Human Pose Estimation (CVPR 2020).
*/
void DarkParse(const std::vector<float>& heatmap, const std::vector<int>& dim,
std::vector<float>* coords, const int px, const int py,
const int index, const int ch);
} // namespace utils
} // namespace vision
} // namespace fastdeploy