<jupyter_start><jupyter_text>Ground Truth<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
import os
import pickle

plt.rcParams['figure.figsize'] = (8, 8)<jupyter_output><empty_output><jupyter_text>Pascal VOC<jupyter_code>from data_voc import GTUtility
gt_util = GTUtility('data/VOC2007/')
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt)
plt.show()
print(gt_util)<jupyter_output><empty_output><jupyter_text>MS COCO<jupyter_code>from data_coco import GTUtility
gt_util = GTUtility('data/COCO', validation=True)
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt)
plt.show()
print('image %i' % (gt_util.num_samples))
print('objects %i' % (gt_util.num_objects))
print('objects per image %.2f' % (gt_util.num_objects / gt_util.num_samples))

plt.figure(figsize=(12,16))
y = range(gt_util.num_classes)
plt.barh(y, gt_util.stats, align='center')
plt.yticks(y, gt_util.classes)
plt.ylim(y[0]-1, y[-1]+1)
plt.grid()
ax = plt.gca()
for i, v in enumerate(gt_util.stats):
    ax.text(v+200, i-.25, int(v), color='b')
plt.show()
gt = gt_util.convert_to_voc()
gt1, gt2 = gt.split(0.6)
gt3 = gt1.merge(gt2)
gt4 = gt1.subset(100,200)
gt.num_samples, gt3.num_samples, gt4.num_samples<jupyter_output><empty_output><jupyter_text>ICDAR2015 FST<jupyter_code>from data_icdar2015fst import GTUtility
gt_util = GTUtility('data/ICDAR2015_FST/')
gt_util_test = GTUtility('data/ICDAR2015_FST/', test=True, polygon=False)
idx, img, gt = gt_util.sample() # TODO: index 83 is fucked up?
plt.imshow(img)
gt_util.plot_gt(gt, show_labels=False)
plt.show()
print(gt_util.text[idx])
print(gt_util.num_samples, gt_util_test.num_samples)<jupyter_output><empty_output><jupyter_text>ICDAR2015 IST<jupyter_code>from data_icdar2015ist import GTUtility
gt_util = GTUtility('data/ICDAR2015_IST/')
gt_util_test = GTUtility('data/ICDAR2015_IST/', test=True)
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt, show_labels=False)
plt.show()
print(gt_util.text[idx])
print(gt_util.num_samples, gt_util_test.num_samples)<jupyter_output><empty_output><jupyter_text>MSRA TD500<jupyter_code>from data_td500 import GTUtility
gt_util = GTUtility('data/MSRA-TD500/')
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt, show_labels=False)
plt.show()<jupyter_output><empty_output><jupyter_text>SVT<jupyter_code>from data_svt import GTUtility
gt_util = GTUtility('data/SVT/')
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt, show_labels=False)
plt.show()<jupyter_output><empty_output><jupyter_text>COCO-Text<jupyter_code>from data_cocotext import GTUtility
gt_util = GTUtility('data/COCO-Text', polygon=False)
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt, show_labels=False)
plt.show()<jupyter_output><empty_output><jupyter_text>SynthText<jupyter_code># for TextBoxes

from data_synthtext import GTUtility
gt_util = GTUtility('data/SynthText/', max_slope=10)

file_name = 'gt_util_synthtext_horizontal10.pkl'
pickle.dump(gt_util, open(file_name,'wb'))
#with open(file_name, 'rb') as f:
#    gt_util = pickle.load(f)

print(gt_util)
# for SegLink and TextBoxes++

from data_synthtext import GTUtility
gt_util = GTUtility('data/SynthText/', polygon=True)

file_name = 'gt_util_synthtext_seglink.pkl'
pickle.dump(gt_util, open(file_name,'wb'))
#with open(file_name, 'rb') as f:
#    gt_util = pickle.load(f)

print(gt_util)
gtu1, gtu2 = gt_util.split(0.001)

file_name = 'gt_util_synthtext_seglink_xxs.pkl'
pickle.dump(gtu1, open(file_name,'wb'))
#with open(file_name, 'rb') as f:
#    gtu1 = pickle.load(f)
idx, img, gt = gt_util.sample()
plt.imshow(img)
gt_util.plot_gt(gt, show_labels=False)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14644690624155635, 'fraction_numerical': 0.024858146446906242, 'mean_word_length': 7.942028985507246, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '9', 'dir': 'jupyter-structured-clean-dedup', 'id': '184644', 'license': 'MIT', 'n_tokens_mistral': 1673, 'n_tokens_neox': 1609, 'n_words': 245, 'path': 'datasets.ipynb', 'repo_name': 'sloppyjuicy/ssd_detectors', 'size': '3701'}