Simple image classification service compatible with the SingularityNET daemon
- Clone the git repository
$ git clone git@github.com:singnet/example-service.git
$ cd example-service
- Install the dependencies
$ pip install -r requirements.txt
- The following default configuration can be overridden by populating configuration/config.json in the source tree with the desired values
{
"SERVER_PORT": 5001,
"MINIMUM_SCORE": 0.20,
"LOG_LEVEL": 10
}
- SERVER_PORT: the port on which the example service will listen for incoming JSON-RPC calls over http
- MINIMUM_SCORE: the minimum confidence score (between 0 and 1 inclusive) required to return a given prediction
- LOG_LEVEL: the logging verbosity
- Invoke the example service directly
$ python image_classification_service
Create snetd.config.json
file containing the following:
{
"passthrough_enabled": true
}
in order to enable example service work with daemon. See SingularityNet daemon configuration for detailed configuration description.
- Invoke the run-snet-service script which launches both snetd and the example service
$ ./scripts/run-snet-service
- Ensure that PASSTHROUGH_ENDPOINT is configured to be "http://127.0.0.1:5001" in your daemon configuration
- Run the docker image with your daemon configuration (where HOST_PORT is the port you want the daemon bound to on your host)
$ docker run --detach -p HOST_PORT:DAEMON_LISTENING_PORT -v /path/to/config:/snetd.config singularitynet/example-service:latest
- Invoke the test-call script against a running instance of the example service
$ ./scripts/test-call
- Invoke the docker build script
$ ./scripts/build-docker
This project is licensed under the MIT License - see the LICENSE file for details.