質問編集履歴
7
エラーコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -202,6 +202,40 @@
|
|
202
202
|
|
203
203
|
```
|
204
204
|
|
205
|
+
conn.request("POST", "/face/v1.0/detect?returnFaceAttributes=emotions", image, headers)のemotionに書き直した場合
|
206
|
+
|
207
|
+
```Python
|
208
|
+
|
209
|
+
captured!
|
210
|
+
|
211
|
+
face rectangle
|
212
|
+
|
213
|
+
[[174 170 240 240]]
|
214
|
+
|
215
|
+
[{"faceId":"222cb191-eac7-4f4d-bd12-85804a4f06ae","faceRectangle":{"top":186,"left":182,"width":237,"height":237},"faceAttributes":{"emotion":{"anger":0.0,"contempt":0.0,"disgust":0.0,"fear":0.0,"happiness":0.0,"neutral":0.956,"sadness":0.043,"surprise":0.0}}}]
|
216
|
+
|
217
|
+
Traceback (most recent call last):
|
218
|
+
|
219
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 127, in <module>
|
220
|
+
|
221
|
+
drawEmotion(data)
|
222
|
+
|
223
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 78, in drawEmotion
|
224
|
+
|
225
|
+
f_rec = face['scores']
|
226
|
+
|
227
|
+
KeyError: 'scores'
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
```
|
232
|
+
|
233
|
+
キャプチャした表情の感情はフィードバックされるものの、
|
234
|
+
|
235
|
+
最終的に達成したいRaspberry PiのHATに感情に適した絵文字を表示させることができない。
|
236
|
+
|
237
|
+
|
238
|
+
|
205
239
|
|
206
240
|
|
207
241
|
### 使用しているコード
|
6
エラーコードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -124,7 +124,83 @@
|
|
124
124
|
|
125
125
|
```
|
126
126
|
|
127
|
-
|
127
|
+
リクエストURLを私のエンドポイントにした場合
|
128
|
+
|
129
|
+
conn = httplib.HTTPSConnection('私の名前.cognitiveservices.azure.com')
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
```Python
|
134
|
+
|
135
|
+
captured!
|
136
|
+
|
137
|
+
face rectangle
|
138
|
+
|
139
|
+
[[442 327 76 76]]
|
140
|
+
|
141
|
+
[Errno -3] Temporary failure in name resolution
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
None
|
146
|
+
|
147
|
+
Traceback (most recent call last):
|
148
|
+
|
149
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 127, in <module>
|
150
|
+
|
151
|
+
drawEmotion(data)
|
152
|
+
|
153
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 76, in drawEmotion
|
154
|
+
|
155
|
+
data = json.loads(data)
|
156
|
+
|
157
|
+
File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
|
158
|
+
|
159
|
+
return _default_decoder.decode(s)
|
160
|
+
|
161
|
+
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
|
162
|
+
|
163
|
+
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
|
164
|
+
|
165
|
+
TypeError: expected string or buffer
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
```
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
リクエストURLをconn = httplib.HTTPSConnection('japaneast.api.cognitive.microsoft.com')にした場合
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
```Python
|
178
|
+
|
179
|
+
captured!
|
180
|
+
|
181
|
+
face rectangle
|
182
|
+
|
183
|
+
[[212 106 220 220]
|
184
|
+
|
185
|
+
[544 392 46 46]]
|
186
|
+
|
187
|
+
{"error":{"code":"BadArgument","message":"Invalid argument returnFaceAttributes."}}
|
188
|
+
|
189
|
+
Traceback (most recent call last):
|
190
|
+
|
191
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 127, in <module>
|
192
|
+
|
193
|
+
drawEmotion(data)
|
194
|
+
|
195
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 78, in drawEmotion
|
196
|
+
|
197
|
+
f_rec = face['scores']
|
198
|
+
|
199
|
+
TypeError: string indices must be integers
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
```
|
128
204
|
|
129
205
|
|
130
206
|
|
5
変更した際のエラーメッセージの追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -76,6 +76,56 @@
|
|
76
76
|
|
77
77
|
```
|
78
78
|
|
79
|
+
「/face/v1.0/detect?」を「/face/v1.0/detect?returnFaceAttributes=emotions」に変更した場合
|
80
|
+
|
81
|
+
```Python
|
82
|
+
|
83
|
+
pi@raspberrypi:~ $ python /home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py
|
84
|
+
|
85
|
+
unicorn hat hd detected
|
86
|
+
|
87
|
+
Unicorn HAT HD: Emoji
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
Press Ctrl+C to exit!
|
92
|
+
|
93
|
+
.
|
94
|
+
|
95
|
+
.
|
96
|
+
|
97
|
+
.
|
98
|
+
|
99
|
+
.
|
100
|
+
|
101
|
+
captured!
|
102
|
+
|
103
|
+
face rectangle
|
104
|
+
|
105
|
+
[[250 106 225 225]]
|
106
|
+
|
107
|
+
{"error":{"code":"BadArgument","message":"Invalid argument returnFaceAttributes."}}
|
108
|
+
|
109
|
+
Traceback (most recent call last):
|
110
|
+
|
111
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 126, in <module>
|
112
|
+
|
113
|
+
drawEmotion(data)
|
114
|
+
|
115
|
+
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 77, in drawEmotion
|
116
|
+
|
117
|
+
f_rec = face['scores']
|
118
|
+
|
119
|
+
TypeError: string indices must be integers
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
```
|
126
|
+
|
127
|
+
|
128
|
+
|
79
129
|
|
80
130
|
|
81
131
|
### 使用しているコード
|
4
エラーメッセージの全文追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,6 +24,44 @@
|
|
24
24
|
|
25
25
|
```
|
26
26
|
|
27
|
+
pi@raspberrypi:~ $ python /home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py
|
28
|
+
|
29
|
+
unicorn hat hd detected
|
30
|
+
|
31
|
+
Unicorn HAT HD: Emoji
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
Press Ctrl+C to exit!
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
captured!
|
42
|
+
|
43
|
+
face rectangle
|
44
|
+
|
45
|
+
[]
|
46
|
+
|
47
|
+
.
|
48
|
+
|
49
|
+
.
|
50
|
+
|
51
|
+
.
|
52
|
+
|
53
|
+
.
|
54
|
+
|
55
|
+
.
|
56
|
+
|
57
|
+
captured!
|
58
|
+
|
59
|
+
face rectangle
|
60
|
+
|
61
|
+
[[224 130 172 172]]
|
62
|
+
|
63
|
+
[{"faceId":"c5ed71c5-706a-4f25-b408-75189dd0f58a","faceRectangle":{"top":144,"left":223,"width":172,"height":172}}]
|
64
|
+
|
27
65
|
Traceback (most recent call last):
|
28
66
|
|
29
67
|
File "/home/pi/emoji-unicornhathd/emoji-unicornhathd-stream.py", line 123, in <module>
|
3
エラー部分の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -328,7 +328,9 @@
|
|
328
328
|
|
329
329
|
HATにフィードバックする際にエラーが起きます。
|
330
330
|
|
331
|
+
いろいろ試しては見ましたがどうも、
|
332
|
+
|
331
|
-
|
333
|
+
「def drawEmotion(data)」**「f_rec = face['scores']」**辺りでエラーが発生します。
|
332
334
|
|
333
335
|
解決法方法などあればご教授お願いします。
|
334
336
|
|
2
URLの表記の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -340,11 +340,11 @@
|
|
340
340
|
|
341
341
|
・Raspberry Pi 3B+
|
342
342
|
|
343
|
-
Description: Raspbian GNU/Linux 10 (buster)
|
343
|
+
Description: Raspbian GNU/Linux 10 (buster)
|
344
|
-
|
344
|
+
|
345
|
-
Release: 10
|
345
|
+
Release: 10
|
346
|
-
|
346
|
+
|
347
|
-
Codename: buster
|
347
|
+
Codename: buster
|
348
348
|
|
349
349
|
|
350
350
|
|
1
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,9 +6,9 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
https://fabcross.jp/category/make/sorepi/20171206_face.html
|
9
|
+
[emoji-unicornhathd](https://fabcross.jp/category/make/sorepi/20171206_face.html)
|
10
|
-
|
10
|
+
|
11
|
-
https://github.com/kazme-egawa/emoji-unicornhathd
|
11
|
+
[github](https://github.com/kazme-egawa/emoji-unicornhathd)
|
12
12
|
|
13
13
|
|
14
14
|
|