Files
clip-symnets/clip_make_pic.py
2024-05-21 19:41:56 +08:00

606 lines
25 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import matplotlib
import numpy as np
from matplotlib import pyplot as plt
# matplotlib画图中中文显示会有问题需要这两行设置默认字体.没中文可以去掉
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['axes.unicode_minus'] = False
# 设置figure_size尺寸
# plt.rcParams['figure.figsize'] = (22.0, 22.0)
plt.rcParams['figure.figsize'] = (5.0,5.0)
fig = plt.figure()
# 设定图表颜色
fig.set(alpha=0.2)
#fig.suptitle('suptitle', fontsize=24, x=0.6,y=0.9, horizontalalignment='left', va='bottom')
# 输入数据
# plt.subplot2grid((4,3),(0,0))
#Average over 11 datasets
#
#
# CR_CLIP=[65.67090909,68.98363636,72.51636364,75.58,78.20090909]
#
# GPT_CLIP=[65.54,68.59,72.23,75.31,77.94]
#
# DA_CLIP=[65.27,68.20,72.01,75.21,77.70]
#
#
# y_tip_adapter=[62.3282,64.6182,66.5327,68.4955,70.3182]
#
# y_tip_adapter_f=[63.2982,65.93913,68.9836,72.1573,75.1346]
#
# y_clip_adapter=[62.6745,65.5527,68.6055,71.3964,74.4436]
#
# y_imagenet_CoOp=[59.5882,62.3236,66.7664,69.8918,73.4251]
# y_clip=[58.9627]
# x=[1,2,4,8,16]
# x_zero=[0]
# #
# # #数据及线属性
# # #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #
# #
# #
# #
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('Average over 11 datasets',fontproperties='Times New Roman', fontsize=15,fontweight='bold')
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("Average.png", dpi=600)
# #
# #
# #
#
#
# # 输入数据
# plt.subplot2grid((4,3),(0,1))
# CR_CLIP=[90.3,90.82,92.45,92.77,94.22]
# GPT_CLIP=[89.73,90.54,92.26,92.57,93.96]
# DA_CLIP=[89.45,90.34,91.89,92.09,93.79]
#
# y_tip_adapter=[87.18,88.44,89.39,89.83,90.18]
# y_tip_adapter_f=[87.9,89.4,90.78,91.1,92.28]
# y_imagenet_CoOp=[87.53,87.93,89.55,90.21,91.83]
# y_clip_adapter=[88.6,89.37,89.98,91.4,92.49]
#
# y_clip=[86.29]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('Caltech101',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("Caltech101.png", dpi=600)
#
#
# #
#
# # 输入数据
# plt.subplot2grid((4,3),(0,2))
# #
# CR_CLIP=[50.73,56.51,62.2,66.76,69.71]
#
# GPT_CLIP=[50.52,56.21,61.92,66.58,69.31]
#
# DA_CLIP=[46.28,52.19,61.76,66.19,68.79]
#
# y_tip_adapter=[46.22,49.47,53.96,58.63,60.93]
#
# y_tip_adapter_f=[48.58,51.64,57.21,61.92,66.23]
#
# y_imagenet_CoOp=[44.39,45.15,53.49,59.97,63.58]
#
# y_clip_adapter=[45.8,51.48,56.86,61,65.96]
#
# y_clip=[42.32]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('DTD',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("DTD.png", dpi=600)
#
#
#
#
#
#
# # 输入数据
# # plt.subplot2grid((4,3),(1,0))
# # #EuroSAT
# CR_CLIP=[58.85,67.38,78.54,84.84,84.90]
#
# GPT_CLIP=[58.46,66.96,78.34,84.24,84.44]
#
# DA_CLIP=[57.41,66.41,77.95,83.90,84.17]
#
# y_tip_adapter=[54.38,61.68,65.32,67.95,70.54]
#
# y_tip_adapter_f=[51.81,66.32,69.23,77.69,81.96]
#
# y_clip_adapter=[61.4,63.9,73.38,77.93,84.43]
#
# y_imagenet_CoOp=[50.63,61.5,70.18,76.73,83.53]
#
# y_clip=[37.56]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('EuroSAT',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("EuroSAT.png", dpi=600)
#
#
# # 输入数据
# plt.subplot2grid((4,3),(1,1))
# #FGVCAircraft
# CR_CLIP=[22.92,24.82,28.68,34.88,42.66]
#
# GPT_CLIP=[22.70,24.62,28.18,34.59,42.30]
#
# DA_CLIP=[22.53,24.48,28.08,34.26,41.34]
#
# y_tip_adapter=[19.05,21.2,22.41,25.59,29.76]
#
# y_tip_adapter_f=[20.06,21.17,24.97,28.13,34.83]
#
# y_imagenet_CoOp=[9.64,18.68,21.87,26.13,31.26]
#
# y_clip_adapter=[17.49,20.1,22.59,26.25,32.1]
#
# y_clip=[17.28]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('FGVCAircraft',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("FGVCAircraft.png", dpi=600)
# #
# #
# # 输入数据
# plt.subplot2grid((4,3),(1,2))
# #Flowers102
# CR_CLIP=[80.88,88.8,93.68,96.20,96.7]
#
# GPT_CLIP=[80.76,87.80,93.32,95.67,96.66]
#
# DA_CLIP=[80.88,87.78,93.26,95.82,96.80]
#
# y_tip_adapter=[73.12,79.13,83.8,87.98,89.89]
#
# y_tip_adapter_f=[76.7,79.5,89,92.4,93.9]
#
# y_imagenet_CoOp=[68.12,77.51,86.2,91.18,94.51]
#
# y_clip_adapter=[73.49,81.61,87.17,91.72,93.9]
#
# y_clip=[66.14]
# x=[1,2,4,8,16]
# x_zero=[0]
#
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('Flowers102',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("Flowers102.png", dpi=600)
#
# # 输入数据
# plt.subplot2grid((4,3),(2,0))
#Food101
# CR_CLIP=[78.44,78.67,78.81,78.96,79.72]
#
# GPT_CLIP=[78.24,78.56,78.67,78.82,79.59]
#
# DA_CLIP=[78.17,78.34,78.50,78.55,79.40]
#
# y_tip_adapter=[77.42,77.52,77.54,77.76,77.83]
#
# y_tip_adapter_f=[77.27,77.44,77.2,78.36,79.05]
#
# y_imagenet_CoOp=[74.32,72.49,73.33,71.82,74.67]
#
# y_clip_adapter=[76.82,77.22,77.92,78.04,78.25]
#
# y_clip=[77.31]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('Food101',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("Food101.png", dpi=600)
# #
#
# # 输入数据
# plt.subplot2grid((4,3),(2,1))
# #imagenet
# CR_CLIP=[62,63.14,63.52,65.02,66.46]
# GPT_CLIP=[61.82,62.83,63.27,64.72,66.25]
# DA_CLIP=[61.41,61.83,62.91,64.54,66.09]
#
# y_tip_adapter=[60.7,60.96,60.98,61.45,62.03]
# y_tip_adapter_f=[61.32,61.69,62.52,64,65.51]
# y_clip_adapter=[61.2,61.52,61.84,62.68,63.59]
# y_imagenet_CoOp=[57.15,57.81,59.99,61.56,62.95]
# y_clip=[60.33]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('ImageNet',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# #plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
#
# plt.savefig("ImageNet.png", dpi=600)
#
#
#
# # 输入数据
# plt.subplot2grid((4,3),(2,2))
# #OxfordPets
# CR_CLIP=[86.1,87.94,88.74,89.25,90.13]
#
# GPT_CLIP=[85.94,86.79,88.63,89.01,89.92]
#
# DA_CLIP=[85.91,86.75,88.50,88.96,89.86]
#
# y_tip_adapter=[86.1,87.03,86.45,87.03,88.14]
#
# y_tip_adapter_f=[86.44,86.44,87,88.11,89.13]
# y_imagenet_CoOp=[85.89,82.64,86.7,85.32,87.01]
# y_clip_adapter=[85.99,86.73,87.46,87.65,87.84]
# y_clip=[85.77]
# x=[1,2,4,8,16]
# x_zero=[0]
#
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('OxfordPets',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
#
# plt.savefig("OxfordPets.png", dpi=600)
# # 输入数据
# plt.subplot2grid((4,3),(3,0))
# #StanfordCars
# CR_CLIP=[60.17,62.57,66.92,73.92,78]
#
# GPT_CLIP=[60.13,62.46,66.73,73.81,79.72]
#
# DA_CLIP=[59.77,62.12,66.30,73.35,79.54]
#
# y_tip_adapter=[57.54,57.93,61.45,62.93,66.77]
#
# y_tip_adapter_f=[58.42,61.06,64.54,69.32,75.08]
#
# y_imagenet_CoOp=[55.59,58.28,62.62,68.43,73.3659]
#
# y_clip_adapter=[55.13,58.74,62.45,67.89,74.01]
#
# y_clip=[55.61]
# x=[1,2,4,8,16]
# x_zero=[0]
#
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('StanfordCars',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# #plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("StanfordCars.png", dpi=600)
# # 输入数据
# plt.subplot2grid((4,3),(3,1))
# #SUN397
# CR_CLIP=[64.1,66.34,69.24,70.78,73.21]
#
# GPT_CLIP=[63.91,66.23,68.52,70.59,72.98]
#
# DA_CLIP=[63.42,65.24,68.13,70.10,72.69]
#
# y_tip_adapter=[61.3,62.7,64.1,65.62,66.85]
#
# y_tip_adapter_f=[62.4,63.22,65.75,68.28,71.27]
# y_imagenet_CoOp=[60.29,59.48,63.47,65.52,69.26]
#
# y_clip_adapter=[61.3,63.29,65.96,67.5,69.55]
#
# y_clip=[58.52]
# x=[1,2,4,8,16]
# x_zero=[0]
#
# #数据及线属性
# #cacfc
# plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
# plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
# plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
# plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
# plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
# plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
# plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
# plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
# #clip_adapter
#
# plt.grid(linestyle="--")
# # 修改坐标轴字体及大小
# plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
# plt.xticks(fontproperties='Times New Roman', size=14)
# #标题设置
# plt.title('SUN397',fontproperties='Times New Roman', fontsize=15)
# plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
# plt.ylabel('Score(%)',fontproperties='Times New Roman')
# # plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# # 添加标签
# plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
# ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
# plt.savefig("SUN397.png", dpi=600)
#
#
#
#
# # 输入数据
# plt.subplot2grid((4,3),(3,2))
# #UCF101
CR_CLIP=[67.86,71.73,75,78.2,82.5]
GPT_CLIP=[67.60,71.46,74.72,77.86,82.26]
DA_CLIP=[67.46,71.27,74.49,77.77,82.08]
y_tip_adapter=[62.6,64.74,66.46,68.68,70.58]
y_tip_adapter_f=[65.38,67.45,71.17,74.42,77.24]
y_imagenet_CoOp=[61.92,64.09,67.03,71.94,75.71]
y_clip_adapter=[62.2,67.12,69.05,73.3,76.76]
y_clip=[61.46]
x=[1,2,4,8,16]
x_zero=[0]
# 数据及线属性
# cacfc
plt.plot(x, CR_CLIP, color='r', linestyle='-', marker='*', linewidth=1, label='CR-CLIP')
plt.plot(x, GPT_CLIP, color='#4169E1', linestyle='-', marker='*', linewidth=1, label='GPT-CLIP')
plt.plot(x, DA_CLIP, color='g', linestyle='-', marker='*', linewidth=1, label='DA-CLIP')
plt.plot(x, y_tip_adapter, color='cyan', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter')
plt.plot(x, y_tip_adapter_f, color='orange', linestyle='-', marker='*', linewidth=1, label='Tip-Adapter-F')
plt.plot(x, y_clip_adapter, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='CLIP-Adapter')
plt.plot(x, y_imagenet_CoOp, color='hotpink', linestyle='-', marker='*', linewidth=1, label='CoOp')
plt.plot(x_zero, y_clip, color='mediumpurple', linestyle='-', marker='*', linewidth=1, label='Zero-shot CLIP')
#clip_adapter
plt.grid(linestyle="--")
# 修改坐标轴字体及大小
plt.yticks(fontproperties='Times New Roman', size=14)#设置大小及加粗
plt.xticks(fontproperties='Times New Roman', size=14)
#标题设置
plt.title('UCF101',fontproperties='Times New Roman', fontsize=15)
plt.xlabel('Number of labeled training examples per class',fontproperties='Times New Roman', fontsize=12)
plt.ylabel('Score(%)',fontproperties='Times New Roman')
# plt.legend(loc='lower right',prop={'family' : 'Times New Roman', 'size': 13})
# 添加标签
plt.annotate('Zero-shot\n CLIP', xy=(x_zero[0], y_clip[0]), xytext=(x_zero[0]+0.3, y_clip[0]-0.9),
ha='center', fontproperties='Times New Roman', fontsize=10, color='mediumpurple')
plt.savefig("UCF101.png", dpi=600)
# plt.show()