<commit_before>from datasets.data_manager import DataManager
from utils.boxes import create_prior_boxes
from utils.inference import plot_box_data
from utils.inference import get_colors
from utils.boxes import unregress_boxes
from utils.data_augmentation import ImageGenerator
import matplotlib.pyplot as plt

# parameters
dataset_name = 'VOC2012'
batch_size = 20
colors = get_colors(25)
prior_boxes = create_prior_boxes()

# loading training data
data_manager = DataManager(dataset_name, 'train')
train_data = data_manager.load_data()
arg_to_class = data_manager.arg_to_class
# loading validation data
val_data = DataManager(dataset_name, 'val').load_data()

# generating output
generator = ImageGenerator(train_data, val_data, prior_boxes, batch_size)
generated_data = next(generator.flow('train'))
transformed_image_batch = generated_data[0]['input_1']
generated_output = generated_data[1]['predictions']

for batch_arg, transformed_image in enumerate(transformed_image_batch):
    positive_mask = generated_output[batch_arg, :, 4] != 1<commit_msg>Added test for unregressing boxes<commit_after>from datasets.data_manager import DataManager
from utils.boxes import create_prior_boxes
from utils.inference import plot_box_data
from utils.inference import get_colors
from utils.boxes import unregress_boxes
from utils.boxes import to_point_form
from utils.generator import ImageGenerator
import matplotlib.pyplot as plt

# parameters
dataset_name = 'VOC2012'
batch_size = 20
colors = get_colors(25)
prior_boxes = to_point_form(create_prior_boxes())

# loading training data
data_manager = DataManager(dataset_name, 'train')
train_data = data_manager.load_data()
arg_to_class = data_manager.arg_to_class
# loading validation data
val_data = DataManager(dataset_name, 'val').load_data()

# generating output
generator = ImageGenerator(train_data, val_data, prior_boxes, batch_size)
generated_data = next(generator.flow('train'))
transformed_image_batch = generated_data[0]['input_1']
generated_output = generated_data[1]['predictions']

for batch_arg, transformed_image in enumerate(transformed_image_batch):
    positive_mask = generated_output[batch_arg, :, 4] != 1
{'fraction_non_alphanumeric': 0.07990762124711316, 'fraction_numerical': 0.012009237875288684, 'mean_word_length': 8.256410256410257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '621425', 'n_tokens_mistral': 663, 'n_tokens_neox': 645, 'n_words': 157}