-
Notifications
You must be signed in to change notification settings - Fork 363
Expand file tree
/
Copy pathreco_lab_web_page.json
More file actions
148 lines (146 loc) · 4.38 KB
/
reco_lab_web_page.json
File metadata and controls
148 lines (146 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[
{
"id":"b0f2aa76.928498",
"type":"visual-recognition-v3",
"z":"274f0a8.f9064f6",
"name":"",
"apikey":"",
"image-feature":"classifyImage",
"lang":"en",
"x":550,
"y":680,
"wires":[
[
"dbc4d416.747658"
]
]
},
{
"id":"200c4f58.a5c23",
"type":"http in",
"z":"274f0a8.f9064f6",
"name":"",
"url":"/reco",
"method":"get",
"swaggerDoc":"",
"x":168,
"y":498,
"wires":[
[
"207f68ae.f4b228"
]
]
},
{
"id":"dd1b7f97.62c5e",
"type":"http response",
"z":"274f0a8.f9064f6",
"name":"HTTP Response",
"x":836,
"y":563,
"wires":[
]
},
{
"id":"207f68ae.f4b228",
"type":"switch",
"z":"274f0a8.f9064f6",
"name":"Check image param",
"property":"payload.imageurl",
"propertyType":"msg",
"rules":[
{
"t":"null"
},
{
"t":"else"
}
],
"checkall":"false",
"outputs":2,
"x":292,
"y":560,
"wires":[
[
"ec216151.18c94"
],
[
"ab3ecd7f.78f4b"
]
]
},
{
"id":"ec216151.18c94",
"type":"template",
"z":"274f0a8.f9064f6",
"name":"Get Image URL",
"field":"payload",
"fieldType":"msg",
"format":"html",
"syntax":"mustache",
"template":"<html>\n<head><title>Watson Visual Recognition on Node-RED</title></head>\n<body>\n<h1>Welcome to the Watson Visual Recognition Demo on Node-RED</h1>\n <h2>Select an image URL</h2>\n <form action=\"{{req._parsedUrl.pathname}}\">\n <img src=\"https://raw.githubusercontent.com/watson-developer-cloud/visual-recognition-nodejs/master/public/images/samples/1.jpg\" height='100'/>\n <img src=\"https://raw.githubusercontent.com/watson-developer-cloud/visual-recognition-nodejs/master/public/images/samples/2.jpg\" height='100'/>\n <img src=\"https://raw.githubusercontent.com/watson-developer-cloud/visual-recognition-nodejs/master/public/images/samples/3.jpg\" height='100'/>\n <img src=\"https://raw.githubusercontent.com/watson-developer-cloud/visual-recognition-nodejs/master/public/images/samples/4.jpg\" height='100'/>\n <br/>Copy above image location URL or enter any image URL:<br/>\n <input type=\"text\" name=\"imageurl\"/>\n <input type=\"submit\" value=\"Analyze\"/>\n </form>\n</body>\n</html>",
"x":586,
"y":529,
"wires":[
[
"dd1b7f97.62c5e"
]
]
},
{
"id":"dbc4d416.747658",
"type":"template",
"z":"274f0a8.f9064f6",
"name":"Report",
"field":"payload",
"fieldType":"msg",
"format":"html",
"syntax":"mustache",
"template":"<html>\n<head><title>Watson Visual Recognition on Node-RED</title></head>\n<body>\n<h1>Node-RED Watson Visual Recognition output</h1>\n<p>Analyzed image: {{payload}}<br/><img src=\"{{payload}}\" height='100'/></p>\n<table border='1'>\n <thead><tr><th>Name</th><th>Score</th></tr></thead>\n{{#result.images.0.classifiers.0.classes}}\n <tr><td><b>{{class}}</b></td><td><i>{{score}}</i></td></tr>\n{{/result.images.0.classifiers.0.classes}}\n</table>\n<form action=\"{{req._parsedUrl.pathname}}\">\n <input type=\"submit\" value=\"Try again\"/>\n</form>\n</body>\n</html>",
"x":681,
"y":597,
"wires":[
[
"dd1b7f97.62c5e"
]
]
},
{
"id":"ab3ecd7f.78f4b",
"type":"change",
"z":"274f0a8.f9064f6",
"name":"Extract img URL",
"rules":[
{
"t":"set",
"p":"payload",
"pt":"msg",
"to":"payload.imageurl",
"tot":"msg"
}
],
"action":"",
"property":"",
"from":"",
"to":"",
"reg":false,
"x":378,
"y":618,
"wires":[
[
"b0f2aa76.928498"
]
]
},
{
"id":"54a05b1c.3cd854",
"type":"comment",
"z":"274f0a8.f9064f6",
"name":"!!Make sure you bind Visual Recognition Service to Node-RED App!!",
"info":"When running in BlueMix, the credentials for the service will be filled-in from BMix credentials management.\nFor this to work, the Visual Recognition Service has to be bound to the Node-RED application.\n",
"x":557,
"y":715,
"wires":[
]
}
]