<jupyter_start><jupyter_text>Pre and Post Together<jupyter_code>%matplotlib inline
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
from skimage import color
import matplotlib.pyplot as plt
import cv2
import os
import glob
from PIL import Image
# The images where the COCO dataset lives.
dataDir='data/test/images'
output='data/test_pre_post'
pre_images = sorted(glob.glob(os.path.join(dataDir, "*pre*")))
post_images = sorted(glob.glob(os.path.join(dataDir, "*post*")))
print("num images: ", len(pre_images))
# Go through all images.
zeros = np.zeros((1024, 1024)).astype(int)
from tqdm import tqdm
for pre_filename, post_filename in tqdm(zip(pre_images, post_images)):
    pre_image = cv2.imread(pre_filename, cv2.IMREAD_GRAYSCALE)
    post_image = cv2.imread(post_filename, cv2.IMREAD_GRAYSCALE)
    rgbArray = np.zeros((1024, 1024, 3), 'uint8')
    rgbArray[..., 0] = pre_image
    rgbArray[..., 1] = post_image
    rgbArray[..., 2] = zeros
    basename = os.path.basename(post_filename)
    write_filename = os.path.join(output, basename)
    cv2.imwrite(write_filename, rgbArray)<jupyter_output>933it [00:58, 15.50it/s]
{'fraction_non_alphanumeric': 0.12575888985255854, 'fraction_numerical': 0.03295750216825672, 'mean_word_length': 5.204301075268817, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '258487', 'license': 'MIT', 'n_tokens_mistral': 452, 'n_tokens_neox': 421, 'n_words': 99, 'path': 'notebooks/NB_put_pre_and_post_together.ipynb', 'repo_name': 'VotaverUno/xview2', 'size': '1153'}