Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Model] add pptracking model #357

Merged
merged 57 commits into from
Oct 26, 2022
Merged

[Model] add pptracking model #357

merged 57 commits into from
Oct 26, 2022

Conversation

ChaoII
Copy link
Collaborator

@ChaoII ChaoII commented Oct 13, 2022

PR types

New features

PR changes

Others

Describe

新增pptracking JDE模型
模型效果:
222

ChaoII and others added 22 commits September 30, 2022 16:08
@jiangjiajun
Copy link
Collaborator

Hi, @ChaoII 我看ci仍然没有通过,如果有需要帮助的地方,可以随时联系我

@ChaoII
Copy link
Collaborator Author

ChaoII commented Oct 13, 2022

Hi, @ChaoII 我看ci仍然没有通过,如果有需要帮助的地方,可以随时联系我

好的,我已经发现问题了,我再试试

Copy link
Collaborator

@jiangjiajun jiangjiajun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个PR很棒!有一些小建议可以再改下,有问题可微信随时跟我讨论哈

std::vector<int> ids;
std::vector<float> scores;
std::vector<int> class_ids;
ResultType type = ResultType::MOT;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MOTResult和DetectionResult会有什么差别吗,看这里的定义基本是跟DetectionResult一致的

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MOTResult 和DetectionResult 不同主要在于除了label_id 还多了一个id 类似于 reid

@@ -0,0 +1,413 @@
// Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright都更新为2022

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更新

}

bool PPTracking::Postprocess(std::vector<FDTensor>& infer_result, MOTResult *result){

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处两行空行可删除

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已删除

private:
std::vector<int> target_size_;
std::vector<float> color_;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此代码移到pptracking/letter_box.hpptracking/letter_box.cc提升可读性

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

另外ImplByOpenCV里面,就默认调用OpenCV即可,或者是

Resize::Run(mat,new_shape_w,new_shape_h, ProcLib::OPENCV)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

重新组织结构,到那时为了保证前处理的一致性,还是继承Processor (重载ImplByOpenCV)


std::string ModelName() const override { return "pptracking"; }

virtual bool Predict(cv::Mat* img, MOTResult* result);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处3个public函数,采用doxygen语法写上注释,便于FastDeploy自动生成C++ API文档, 可参考PPYOLOE头文件的注释

本地生成文档
参考https://github.com/PaddlePaddle/FastDeploy/tree/develop/.new_docs/api_docs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

增加doxygen 注释

@jiangjiajun jiangjiajun changed the title [vision] add pptracking model [Model] add pptracking model Oct 18, 2022
@@ -154,6 +155,21 @@ struct FASTDEPLOY_DECL OCRResult : public BaseResult {
std::string Str();
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需添加注释(下一个PR完成)

target_size_=target_size;
color_=color;
}
bool LetterBoxResize::ImplByOpenCV(Mat* mat){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个需要修改下(下个PR,会使得切换其它预处理库时出错)

model_format)
assert self.initialized, "PPTracking model initialize failed."

def predict(self, input_image):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

添加注释(下个PR)


bool PPTracking::Initialize() {
// remove multiclass_nms3 now
// this is a trick operation for ppyoloe while inference on trt
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个模型没有NMS之类的操作,可以删除以下的代码

  GetNmsInfo();
  runtime_option.remove_multiclass_nms_ = true;
  runtime_option.custom_op_info_["multiclass_nms3"] = "MultiClassNMS";

return false;
}

if (has_nms_ && runtime_option.backend == Backend::TRT) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同理,这个判断可以删除

@jiangjiajun jiangjiajun merged commit ba501fd into PaddlePaddle:develop Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants