- cmc_dict: python dictionary of cmc values. Key is the method name (string). Value is the cmc values.
- The last dictionary item must be set to your proposed method's result.
cmc_dict ={
'SDALF': [0.10, 0.21, 0.29, 0.34, 0.40, 0.44, 0.47, 0.51, 0.54, 0.57],
'ImprovedReID': [0.65, 0.75, 0.81, 0.85, 0.89, 0.90, 0.91, 0.91, 0.93, 0.94],
'Proposed Method': [0.65, 0.75, 0.81, 0.85, 0.89, 0.90, 0.91, 0.91, 0.93, 0.94]
}
- color (optional): a list of colors for ploting (the first color will be used for your proposed method's cmc curve). detail document for color is here
- 7 default colors is alrady set up in the class:
color = ['r','g','b','c','m','y','orange','brown']
- 7 default colors is alrady set up in the class:
- marker (optional): a list of markers for ploting (the first marker will be used for your proposed method's cmc curve). detail document for marker is here.
- 7 default marker is alrady set up in the class:
marker = ['*','o','s','v','X','*','.','P']
- 7 default marker is alrady set up in the class:
from CMC import CMC
cmc = CMC(cmc_dict)
#custimised color and marker
new_color = ['r','g','b','c','m','y','orange','brown']
new_marker = ['*','o','s','v','X','*','.','P']
cmc = CMC(cmc_dict,color=new_color,marker=new_marker)
- title: title of the cmc curve (string)
- rank(optional): top n value for ploting (integer), default is 20
- xlabel (optional): label for x-axis (string), default is
Rank
- ylabel (optional): label for y-axis (sting). default is
Matching Rates (%)
- show_grid (optional): turn on or off grid in the graph (boolean). default is
True
#simple plot
cmc.plot(title = 'CMC on CUHK01 (100 test IDs)')
#custimised color and marker
cmc.plot(title = 'CMC on CUHK01', rank=10,
xlabel='Rank Score',
ylabel='Recognition Rate', show_grid=False)
- title: title of the cmc curve (string)
- filename: filename for saved figure (string)
- rank(optional): top n value for ploting (integer), default is 20
- xlabel (optional): label for x-axis (string), default is
Rank
- ylabel (optional): label for y-axis (sting). default is
Matching Rates (%)
- show_grid (optional): turn on or off grid in the graph (boolean). default is
True
- save_path (optional): figure saving directory (default is the current working directory)
- format (optional): figure saving fomate (jpg, jpeg, png, pdf, ps, eps and svg), default is png
- other parameters from pyplot.savefig can be used here
# simple save
cmc.save(title = 'CMC on CUHK01 (100 test IDs)', filename='cmc_result_1')
#custimised save
cmc.save(title = 'CMC on CUHK01', filename='cmc_result_2',
rank=10,xlabel='Rank Score', ylabel='Recognition Rate',
show_grid=False, format='png')