diff --git a/README.md b/README.md index 474c7eb..3002fc9 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ $ faas-cli deploy --image alexellis/inception --name inception --fprocess "pytho Invoke via `curl` or `faas-cli invoke`: -``` -$ URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg \ - echo -n $URL | faas-cli invoke inception +```sh +export URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg +echo -n $URL | faas-cli invoke inception [{"name": "great white shark", "score": 0.5343291759490967}, {"name": "tiger shark", "score": 0.09276486188173294}, {"name": "grey whale", "score": 0.05899052694439888}, {"name": "sea lion", "score": 0.05105864629149437}, {"name": "hammerhead", "score": 0.019910583272576332}, {"name": "sturgeon", "score": 0.013177040033042431}, {"name": "stingray", "score": 0.00763126602396369}, {"name": "electric ray", "score": 0.006749240681529045}, {"name": "killer whale", "score": 0.005086909048259258}, {"name": "ice bear", "score": 0.003828041721135378}] ``` @@ -28,11 +28,12 @@ $ URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwa * Use `jq` tool to filter the top matches: +```sh +export URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg +echo -n $URL | faas-cli invoke inception | jq '.[] | select(.score > 0.05)' ``` -$ URL=https://upload.wikimedia.org/wikipedia/commons/6/61/Humpback_Whale_underwater_shot.jpg \ - echo -n $URL | faas-cli invoke inception \ - | jq '.[] | select(.score > 0.05)' +```json { "name": "great white shark", "score": 0.5343291759490967