| import matplotlib.pyplot as plt |
| import seaborn as sns |
| import pandas as pd |
|
|
| |
| |
| |
| resolution = [336.00, 448.00, 560.00, 672.00, 784.00, 896.00, 1024.00] |
|
|
| roi_thing = { |
| "Resolution": resolution, |
| "CLIPself": [65.90, 69.50, 70.90, 71.70, 72.00, 72.60, 72.30], |
| "RegionCLIP": [66.40, 70.00, 71.20, 72.10, 72.10, 72.00, 71.90], |
| "DeCLIP": [68.90, 72.10, 74.30, 75.20, 75.50, 75.70, 75.40] |
| } |
|
|
| mask_thing = { |
| "Resolution": resolution, |
| "CLIPself": [60.10, 66.00, 69.50, 71.40, 72.70, 74.00, 74.60], |
| "RegionCLIP": [60.60, 66.90, 69.70, 72.50, 73.50, 73.90, 74.70], |
| "DeCLIP": [62.00, 68.40, 72.20, 74.50, 75.80, 76.80, 77.20] |
| } |
|
|
| mask_stuff = { |
| "Resolution": resolution, |
| "CLIPself": [40.80, 43.10, 44.60, 45.40, 45.90, 46.50, 46.90], |
| "RegionCLIP": [28.20, 30.10, 30.30, 31.10, 32.50, 35.00, 34.80], |
| "DeCLIP": [45.50, 49.10, 50.40, 51.20, 51.30, 52.70, 52.50] |
| } |
|
|
| df_roi_thing = pd.DataFrame(roi_thing) |
| df_mask_thing = pd.DataFrame(mask_thing) |
| df_mask_stuff = pd.DataFrame(mask_stuff) |
|
|
| |
| |
| |
| sns.set_style('white') |
| plt.rcParams.update({ |
| 'font.size' : 10, |
| 'axes.labelsize' : 10, |
| 'xtick.labelsize' : 8, |
| 'ytick.labelsize' : 8, |
|
|
| |
| 'lines.linewidth' : 1.5, |
| 'lines.markersize' : 8, |
| 'lines.markeredgewidth': 0.8, |
|
|
| |
| 'legend.fontsize' : 9, |
|
|
| |
| 'axes.grid' : True, |
| 'grid.linestyle' : '--', |
| 'grid.alpha' : 0.3, |
| 'grid.color' : 'gray', |
| 'grid.linewidth' : 0.5, |
|
|
| |
| 'axes.spines.right': False, |
| 'axes.spines.top' : False, |
| 'axes.linewidth' : 1.2 |
| }) |
|
|
| |
| palette = { |
| 'CLIPself' : '#80b1d3', |
| 'RegionCLIP': '#fb8072', |
| 'DeCLIP' : '#8dd3c7' |
| } |
| markers = { |
| 'CLIPself' : 'o', |
| 'RegionCLIP': '^', |
| 'DeCLIP' : 'D' |
| } |
|
|
| |
| |
| |
| def plot_and_save(df, y_label, filename): |
| fig, ax = plt.subplots(figsize=(4, 3)) |
|
|
| for key in ['CLIPself', 'RegionCLIP', 'DeCLIP']: |
| ax.plot( |
| df['Resolution'], df[key], |
| linestyle='-', |
| marker=markers[key], |
| color=palette[key], |
| markeredgecolor='black', |
| label=key |
| ) |
|
|
| ax.set_xlabel('Resolution') |
| ax.set_ylabel(y_label) |
| ax.set_xticks(resolution) |
|
|
| ax.legend(frameon=False, loc='best') |
| fig.tight_layout() |
| fig.savefig(filename, dpi=300) |
| plt.close(fig) |
|
|
| |
| |
| |
| plot_and_save(df_roi_thing, 'RoI Align (Thing) mAcc', 'roi_thing.png') |
| plot_and_save(df_mask_thing, 'Mask Pooling (Thing) mAcc', 'mask_thing.png') |
| plot_and_save(df_mask_stuff, 'Mask Pooling (Stuff) mAcc', 'mask_stuff.png') |