Open
Conversation
|
Thanks for your contribution! |
Collaborator
|
感谢贡献代码,不过有个注意点,需要将代码提到develop分支上,之后会在适当的时候合入到稳定分支中。 |
| # 支持"module.submodule:ClassName"格式的字符串导入 | ||
| if ":" in pipeline_cls: | ||
| module_path, class_name = pipeline_cls.rsplit(":", 1) | ||
| __import__(module_path, fromlist=[class_name]) |
Member
There was a problem hiding this comment.
建议使用importlib API。此外,此处不做安全性的检查,是否存在注入攻击的风险?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在自定义产线yml配置文件中使用pipeline_cls属性声明"module.submodule:ClassName"格式的字符串自定义产线类路径即可。注意:此类需使用pip install提前注册到当前python环境中。同时如果要使用paddlex --serve --pipeline运行还需要在自定义产线类所在文件添加create_pipeline_app函数的实现,参考paddlex\inference\serving\basic_serving_pipeline_apps\object_detection.py。