-
Notifications
You must be signed in to change notification settings - Fork 6
/
leidatu.py
59 lines (47 loc) · 1.82 KB
/
leidatu.py
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
# import numpy as np
# import matplotlib.pyplot as plt
# # angry, fear, happy, neutral, sad, surprise
# def ratio_pic(data):
# # 定义各个参数的值
# # 标签
# labels = np.array(['angry', 'fear', 'happy', 'neutral', 'sad', 'surprise'])
# # 数据个数
# dataLenth = 6
# # 数据
# # data = np.array([angry, fear, happy, neutral, sad, surprise])
# # data = np.array(data)
# angles = np.linspace(0, 2 * np.pi, dataLenth, endpoint=False)
# data = np.concatenate((data, [data[0]])) # 闭合
# angles = np.concatenate((angles, [angles[0]])) # 闭合
# fig = plt.figure()
# # polar参数
# ax = fig.add_subplot(111, polar=True)
# ax.plot(angles, data, 'bo-', linewidth=2)
# ax.fill(angles, data, facecolor='r', alpha=0.25)
# ax.set_thetagrids(angles * 180 / np.pi, labels, fontproperties="SimHei")
# ax.set_title("Emotion Recognition", va='bottom', fontproperties="SimHei")
# # 在这里设置雷达图的数据最大值
# ax.set_rlim(0, 1)
# ax.grid(True)
# plt.ion()
# plt.show()
# plt.pause(4)
# plt.close()
# def Radar(data_prob, class_labels: Tuple, num_classes: int):
# angles = np.linspace(0, 2 * np.pi, num_classes, endpoint=False)
# data = np.concatenate((data_prob, [data_prob[0]])) # 闭合
# angles = np.concatenate((angles, [angles[0]])) # 闭合
# fig = plt.figure()
# # polar参数
# ax = fig.add_subplot(111, polar=True)
# ax.plot(angles, data, 'bo-', linewidth=2)
# ax.fill(angles, data, facecolor='r', alpha=0.25)
# ax.set_thetagrids(angles * 180 / np.pi, class_labels)
# ax.set_title("Emotion Recognition", va='bottom')
# # 设置雷达图的数据最大值
# ax.set_rlim(0, 1)
# ax.grid(True)
# # plt.ion()
# plt.show()
# # plt.pause(4)
# # plt.close()