File size: 1,771 Bytes
7e3773e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import matplotlib.pyplot as plt
import numpy as np

# 层数和数据
layers = ["3", "6", "9", "12"]
segmentation_MIoU = [39.58625, 43.8675, 43.6925, 44.1]
detection_ap = [31.4, 35.6, 39.5, 43.3]

# 曲线样式(继承原风格)
curve_configs = [
    {
        "label": "Avg. mIoU",
        "color": "#2077b4",   # 蓝色
        "marker": "o",
        "linestyle": "--",
        "linewidth": 3,
        "markersize": 9,
        "zorder": 3,
    },
    {
        "label": "mAP (Novel)",
        "color": "#ff7f0e",   # 橙色
        "marker": "s",
        "linestyle": "--",
        "linewidth": 3,
        "markersize": 9,
        "zorder": 2,
    },
]

plt.figure(figsize=(4, 3))

# 画两条折线
plt.plot(
    layers, segmentation_MIoU,
    label=curve_configs[0]["label"],
    linestyle=curve_configs[0]["linestyle"],
    marker=curve_configs[0]["marker"],
    color=curve_configs[0]["color"],
    linewidth=curve_configs[0]["linewidth"],
    markersize=curve_configs[0]["markersize"],
    zorder=curve_configs[0]["zorder"],
)
plt.plot(
    layers, detection_ap,
    label=curve_configs[1]["label"],
    linestyle=curve_configs[1]["linestyle"],
    marker=curve_configs[1]["marker"],
    color=curve_configs[1]["color"],
    linewidth=curve_configs[1]["linewidth"],
    markersize=curve_configs[1]["markersize"],
    zorder=curve_configs[1]["zorder"],
)

# plt.xlabel("Layer Number", fontsize=12)
# plt.ylabel("Score", fontsize=12)
plt.grid(True, linestyle='--', alpha=0.6)
# plt.tick_params(axis='both', which='major', labelsize=12)
plt.tick_params(axis='x', labelsize=14)  # x轴刻度大
plt.tick_params(axis='y', labelsize=12)  # y轴刻度不变
plt.tight_layout()

plt.legend(fontsize=14, loc='best')
plt.savefig("layers_effect.pdf", dpi=300)
plt.close()