For more info about the implementation details check the project source code at https://github.com/esimov/colidr.
To run the function locally you have to make sure OpenFaaS is up and running. Read the official documentation for more help. https://docs.openfaas.com/
Clone the repository:
$ git clone https://github.com/esimov/openfaas-coherent-line-drawing
$ faas-cli template pull https://github.com/alexellis/opencv-openfaas-template
$ faas-cli build -f stack.yml --gateway=http://<GATEWAY-IP>
$ faas-cli deploy -f stack.yml --gateway=http://<GATEWAY-IP>
You can access the UI on the url provided to --gateway
.
Note: in case of large images you need to increase write_timeout
in stack.yml.
After deployment the coherent-line-drawing
function will show up in the function list. You have to provide an image URL then hit invoke. This will generate a contoured, sketch-liked image.
You can also provide different values as query parameters. The follwing parameters are supported:
Flag | Default value | Description |
---|---|---|
aa |
false | Anti aliasing |
bl |
3 | New height |
di |
1 | Number of FDoG iteration |
ei |
2 | Number of Etf iteration |
k |
2 | Etf kernel |
rho |
0.98 | Rho |
sc |
1 | Sigma C |
sm |
3 | Sigma M |
sr |
2.6 | Sigma R |
tau |
0.98 | Tau |
Below is an example with query parameters you can try out:
https://user-images.githubusercontent.com/883386/61370913-30e21c00-a89c-11e9-8edf-f4b59b59793c.jpg?k=2&sr=2.9&sm=3.5&tau=0.999&aa=1&ei=2&di=1
Input | Output |
---|---|
Copyright © 2019 Endre Simo
This project is under the MIT License. See the LICENSE file for the full license text.