<jupyter_start><jupyter_text>Generate Deep MatchesFor performance reasons we need to pre-generate the deep matches using the API functions<jupyter_code>dm.generate_matches(img_loc, VIDEO)<jupyter_output>{DM}: solve 8 -> 8
{DM}: solve 8 -> 9
{DM}: solve 8 -> 10
{DM}: solve 8 -> 11
{DM}: solve 8 -> 12
{DM}: solve 8 -> 13
{DM}: solve 9 -> 9
{DM}: solve 9 -> 10
{DM}: solve 9 -> 11
{DM}: solve 9 -> 12
{DM}: solve 9 -> 13
{DM}: solve 9 -> 14
{DM}: solve 10 -> 10
{DM}: solve 10 -> 11
{DM}: solve 10 -> 12
{DM}: solve 10 -> 13
{DM}: solve 10 -> 14
{DM}: solve 10 -> 15
{DM}: solve 11 -> 11
{DM}: solve 11 -> 12
{DM}: solve 11 -> 13
{DM}: solve 11 -> 14
{DM}: solve 11 -> 15
{DM}: solve 11 -> 16
{DM}: solve 12 -> 12
{DM}: solve 12 -> 13
{DM}: solve 12 -> 14
{DM}: solve 12 -> 15
{DM}: solve 12 -> 16
{DM}: solve 12 -> 17
{DM}: solve 13 -> 13
{DM}: solve 13 -> 14
{DM}: solve 13 -> 15
{DM}: solve 13 -> 16
{DM}: solve 13 -> 17
{DM}: solve 13 -> 18
{DM}: solve 14 -> 14
{DM}: solve 14 -> 15
{DM}: solve 14 -> 16
{DM}: solve 14 -> 17
{DM}: solve 14 -> 18
{DM}: solve 14 -> 19
{DM}: solve 15 -> 15
{DM}: solve 15 -> 16
{DM}: solve 15 -> 17
{DM}: solve 15 -> 18
{DM}: solve 15 -> 19
{DM}: solve 15 -> 20
{DM}: s[...]<jupyter_text>Get a Match<jupyter_code>M = dm.get_match(VIDEO, frame1=1, frame2=2)
print(M.shape)
frame1, _, x, y, w, h, _, _, _ = Y_gt[0]


fig = plt.figure(figsize=(16,8))
ax = fig.add_subplot(121)
ax.imshow(X[0])
bbX, bbY = utils.bb_to_plt_plot(x, y, w, h)
ax.plot(bbX, bbY, linewidth=3, c='red')
bb1 = (x,y,w,h)

frame2, _, x, y, w, h, _, _, _ = Y_gt[2]
ax = fig.add_subplot(122)
ax.imshow(X[1])
bbX, bbY = utils.bb_to_plt_plot(x, y, w, h)
ax.plot(bbX, bbY, linewidth=3, c='red')
bb2 = (x,y,w,h)


frame3, _, x, y, w, h, _, _, _ = Y_gt[601]
bbX, bbY = utils.bb_to_plt_plot(x, y, w, h)
ax.plot(bbX, bbY, linewidth=3, c='blue')
bb3 = (x,y,w,h)
# ----------------------

cost1 = dm.calculate_cost(VIDEO, frame1, bb1, frame2, bb2)
cost2 = dm.calculate_cost(VIDEO, frame1, bb1, frame3, bb3)
print("dm cost (red vs red):\t", cost1)
print("dm cost (red vs blue):\t", cost2)

cost1 = st.calculate(bb1, bb2)
cost2 = st.calculate(bb1, bb3)
print("st cost (red vs red):\t", cost1)
print("st cost (red vs blue):\t", cost2)
print(X.shape)

plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.22027204914436158, 'fraction_numerical': 0.09916630100921457, 'mean_word_length': 3.497041420118343, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 56, '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': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '296161', 'license': 'MIT', 'n_tokens_mistral': 1184, 'n_tokens_neox': 983, 'n_words': 322, 'path': 'prototyping/Test_Features.ipynb', 'repo_name': 'mkhozin/cabbage', 'size': '2279'}