-
Notifications
You must be signed in to change notification settings - Fork 471
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
Conversation
Hi, @ChaoII 我看ci仍然没有通过,如果有需要帮助的地方,可以随时联系我 |
好的,我已经发现问题了,我再试试 |
Signed-off-by: ChaoII <[email protected]>
There was a problem hiding this 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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MOTResult和DetectionResult会有什么差别吗,看这里的定义基本是跟DetectionResult一致的
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyright都更新为2022
There was a problem hiding this comment.
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){ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此处两行空行可删除
There was a problem hiding this comment.
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_; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
此代码移到pptracking/letter_box.h
和pptracking/letter_box.cc
提升可读性
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
增加doxygen 注释
Signed-off-by: ChaoII <[email protected]>
Signed-off-by: ChaoII <[email protected]>
Signed-off-by: ChaoII <[email protected]>
Signed-off-by: ChaoII <[email protected]>
Signed-off-by: ChaoII <[email protected]>
Signed-off-by: ChaoII <[email protected]>
Signed-off-by: ChaoII <[email protected]>
@@ -154,6 +155,21 @@ struct FASTDEPLOY_DECL OCRResult : public BaseResult { | |||
std::string Str(); | |||
}; | |||
|
There was a problem hiding this comment.
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){ |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同理,这个判断可以删除
PR types
New features
PR changes
Others
Describe
新增pptracking JDE模型
模型效果: