<jupyter_start><jupyter_text>Plotting images<jupyter_code>ds = pd.read_csv(IN_CSV_PATH)
ds_sampled = ds[ds["Frontal/Lateral"] != "Lateral"]
ds_sampled.to_csv("./temp_df.csv")
dataloader_test = DataLoader(
    ImageDataset("./temp_df.csv", cfg, mode='valid', sample_n=110),
    batch_size=1, num_workers=1,
    drop_last=False, shuffle=False)


fig, axs = plt.subplots(2,2, figsize=(10, 10))
axs = axs.flatten()
examples = 0
for img, path, label in tqdm(dataloader_test):
    ax = axs[examples]
    img = img.to(args.device)
    label = label.to(args.device)
    ax.imshow(img[0].cpu().permute(1,2,0).numpy()*std_pxs + mean_pxs)
    ax.axis("off")
    examples += 1
    if examples == 4:
        break
fig.tight_layout()
fig.savefig("../paper_figures/cxr/frontal_view.png")
plt.show(fig)
    
ds = pd.read_csv(IN_CSV_PATH)
ds_sampled = ds[ds["Frontal/Lateral"] == "Lateral"]
ds_sampled.to_csv("./temp_df.csv")
dataloader_test = DataLoader(
    ImageDataset("./temp_df.csv", cfg, mode='valid', sample_n=110),
    batch_size=1, num_workers=1,
    drop_last=False, shuffle=False)


fig, axs = plt.subplots(2,2, figsize=(10, 10))
axs = axs.flatten()
examples = 0
for img, path, label in tqdm(dataloader_test):
    ax = axs[examples]
    img = img.to(args.device)
    label = label.to(args.device)
    ax.imshow(img[0].cpu().permute(1,2,0).numpy()*std_pxs + mean_pxs)
    ax.axis("off")
    examples += 1
    if examples == 4:
        break
fig.tight_layout()
fig.savefig("../paper_figures/cxr/lateral_view.png")
plt.show(fig)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17161290322580644, 'fraction_numerical': 0.023225806451612905, 'mean_word_length': 4.385416666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '20286', 'license': 'MIT', 'n_tokens_mistral': 669, 'n_tokens_neox': 637, 'n_words': 99, 'path': 'cxr/Evaluate CXR.ipynb', 'repo_name': 'conceptualcounterfactuals/icml2022', 'size': '1550'}