-
Notifications
You must be signed in to change notification settings - Fork 561
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
feat: use DTO for NCNN init parameters #1147
base: master
Are you sure you want to change the base?
Conversation
Thanks, sounds simple. What do think about putting the backend DTOs headers into |
This pull request is now in conflict :( |
bcf2ebb
to
9d688cc
Compare
109e8c4
to
45db8cd
Compare
tests/ut-ncnnapi.cc
Outdated
@@ -312,7 +320,18 @@ TEST(ncnnapi, ocr) | |||
+ ocr_repo | |||
+ "\"},\"parameters\":{\"input\":{\"connector\":\"image\",\"ctc\":" | |||
"true, \"height\":136,\"width\":220},\"mllib\":{\"nclasses\":69}}}"; | |||
std::string joutstr = japi.jrender(japi.service_create(sname, jstr)); | |||
|
|||
auto service_create = dd::DTO::ServiceCreate::createShared(); |
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.
Is there a way of creating the DTO object directly from the JSON string ?
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.
Yes, and that's a good idea to do it in tests, it will ensure the current json string still work as-is.
The Service Create call works, but most parameters doesn't. Supported parameters are only those declared in the DTO files. To not update all input/output connector code. This PR just convert the DTO into APIData to pass it to connector. /!\ But beware if a parameters is not present in the DTO it will be ignored and will not be present in the generated APIData passed to the connectors. /!\ That's why we need first to fill the InputConnector and OutputConnector with all possible option from all type and all backends. cmake .. -D USE_HTTP_SERVER_OATPP=ON -D USE_HTTP_SERVER=OFF -D USE_NCNN=ON -D USE_CAFFE=OFF -DUSE_COMMAND_LINE=OFF
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
This pull request is now in conflict :( |
feat: use DTO for NCNN init parameters
refactor(dto): example service_create+ncnn
The Service Create call works, but most parameters doesn't.
Supported parameters are only those declared in the DTO files.
To not update all input/output connector code. This PR just
convert the DTO into APIData to pass it to connector.
/!\ But beware if a parameters is not present in the DTO it will be
ignored and will not be present in the generated APIData passed to the
connectors. /!\
That's why we need first to fill the InputConnector and OutputConnector
with all possible option from all type and all backends.
cmake .. -D USE_HTTP_SERVER_OATPP=ON -D USE_HTTP_SERVER=OFF -D USE_NCNN=ON -D USE_CAFFE=OFF -DUSE_COMMAND_LINE=OFF