回答編集履歴

1

改善

2020/10/06 16:37

投稿

shiosako
shiosako

スコア6

test CHANGED
@@ -1,23 +1,39 @@
1
1
  ```python
2
2
 
3
- vertices = (['({},{})'.format(vertex.x, vertex.y)
3
+ for face in faces:
4
4
 
5
- for vertex in face.bounding_poly.vertices])
5
+ print('anger: {}'.format(likelihood_name[face.anger_likelihood]))
6
6
 
7
- #座標取り出し
7
+ print('joy: {}'.format(likelihood_name[face.joy_likelihood]))
8
8
 
9
- for i, dot in enumerate(vertices,1) :
9
+ print('surprise: {}'.format(likelihood_name[face.surprise_likelihood]))
10
10
 
11
- if i == 1 :
11
+
12
12
 
13
- global ver1
13
+ for i, vertex in enumerate(face.bounding_poly.vertices,0):
14
14
 
15
- ver1 = dot
15
+ if i == 0 :
16
16
 
17
- if i == 3 :
17
+ global ver1x
18
18
 
19
- global ver2
19
+ global ver1y
20
20
 
21
+ ver1x = vertex.x #左上のx座標
22
+
23
+ ver1y = vertex.y #左上のy座標
24
+
25
+
26
+
21
- ver2 = dot
27
+ if i == 2 :
28
+
29
+ global ver2x
30
+
31
+ global ver2y
32
+
33
+ ver2x = vertex.x #右下のx座標
34
+
35
+ ver2y = vertex.y #右下のy座標
36
+
37
+
22
38
 
23
39
  ```