Comments (2)
cibot: Thank you for posting issue #415. The person in charge will reply soon.
from api.
How about creating the following APIs for remote services?
static void API_NAME (handle *handle,
const char *pipeline_description, const char *file_name, const char *file_path,
const char *file_desccription, const char *service_type, const char *service_key, const char *topic)
{
int ret = ML_ERROR_NONE;
gsize len = 0;
ret = ml_option_create (&handle->option_h);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_option_set (handle->option_h, "node-type", "remote_sender", NULL);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_option_set (handle->option_h, "dest-host", handle->broker_ip, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_option_set (handle->option_h, "dest-port", &handle->broker_port, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_option_set (handle->option_h, "connect-type", handle->connect_type, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
if (g_strcmp0(handle->connect_type, "HYBRID") == 0) {
ret = ml_option_set (handle->option_h, "host", handle->local_ip, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
}
ret = ml_option_set (handle->option_h, "topic", (void *)topic, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_service_remote_create (handle->option_h, NULL, NULL, &handle->service_h);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_option_create (&handle->service_option_h);
if (ML_ERROR_NONE != ret) {
return;
}
ret =
ml_option_set (handle->service_option_h, "service-type", (void *)service_type, NULL); //service_type = model_raw
if (ML_ERROR_NONE != ret) {
return;
}
ret =
ml_option_set (handle->service_option_h, "service-key", (void *)service_key, g_free); // service-key = model_registration_key
if (ML_ERROR_NONE != ret) {
return;
}
// ret = ml_option_set (handle->service_option_h, "activate", "true", NULL);
// if (ML_ERROR_NONE != ret) {
// return;
// }
if (file_name && file_path && file_desccription) {
ret = ml_option_set (handle->service_option_h, "name", (void *)file_name, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
ret = ml_option_set (handle->service_option_h, "description", (void *)file_desccription, NULL);
if (ML_ERROR_NONE != ret) {
return;
}
dlog_print (DLOG_INFO, LOG_TAG, "transmission data:%s", file_path);
ret = g_file_get_contents (file_path, &handle->contents, &len, NULL);
if (FALSE == ret) {
return;
}
ret = ml_service_remote_register (handle->service_h, handle->service_option_h, handle->contents, len);
if (ML_ERROR_NONE != ret) {
return;
}
} else if (pipeline_description) {
ret =
ml_service_remote_register (handle->service_h, handle->service_option_h, (void *)pipeline_description, strlen (pipeline_description) + 1);
if (ML_ERROR_NONE != ret) {
return;
}
} else {
return;
}
return;
}
from api.
Related Issues (10)
- Create a mirroring repo at tizen.org
- Feature check is prohibiting calling ml-api from ml-train api side which is at another repo. HOT 5
- [Android] Add android build script and setup CI HOT 1
- DBus Interface HOT 1
- Invite SNAP developers and let them migrate headers
- [android][bug] Android singleshot test fail HOT 2
- Test failure of ML-service-agent HOT 2
- Capi-ml-common is depending on capi-base-common HOT 1
- Migrate ML inference API from nnstreamer HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api.