<jupyter_start><jupyter_text>**ALL JUNK BELOW THIS**<jupyter_code>col=np.expand_dims(thresh_column[0][0], axis=2) 
col=col.astype('float32')*255
ret,thresh = cv2.threshold(col,254,255,cv2.THRESH_BINARY)
plt.imshow(thresh)
thresh = np.uint8(thresh)
contours,hierarchy = cv2.findContours(thresh, 1, 2)
cnt = contours[0]
boxes_list = []
for cnt in contours:
  x,y,w,h = cv2.boundingRect(cnt)
  boxes_list.append((x,y,w,h))
  if cv2.contourArea(cnt)>10:
    cv2.rectangle(thresh,(x,y),(x+w,y+h),(0,255,0),2)

plt.imshow(thresh)


plt.imshow(mask_table[0])
plt.imshow(mask_column[0])
plt.imshow(thresh_table[0][0],cmap='gray') # 20 epochs on invoice
plt.imshow(thresh_column[0][0],cmap='gray')
plt.imshow(thresh_table[0][0],cmap='gray')# 10 epochs on invoice
plt.imshow(thresh_column[0][0],cmap='gray')
plt.imshow(thresh_table[0][0],cmap='gray')
plt.imshow(thresh_column[0][0],cmap='gray')
out=table_model(img)
thresh_table = np.where(out[0]>0.9,1,0)
thresh_column = np.where(out[1]>0.9,1,0)
plt.imshow(thresh_table[0][0],cmap='gray')
plt.imshow(thresh_column[0][0],cmap='gray')
plt.imshow(img[0][0])
plt.imshow(mask_table[0])
plt.imshow(mask_column[0])
plt.imshow(thresh_table[0][0],cmap='gray')
plt.imshow(thresh_column[0][0],cmap='gray')
!pip install pytorch-lightning
import pytorch_lightning as pl
plt.imshow(img[0][0].detach().numpy())
plt.imshow(out[0][0][0].detach().numpy())
plt.imshow(out[1][0][0].detach().numpy())
img,mt,mc=train_dataset[3]
model = TableNet(num_class=2)
img = cv2.resize(img,(1024,1024))
ten_img=torch.from_numpy(img)
ten_img.shape
plt.imshow(img)
plt.imshow(ten_img)
per=ten_img.permute(2,0,1)
plt.imshow(per[0])
result=model(per.unsqueeze(0)*1.)
result[0].shape
ptm=tm[0][0]
plt.imshow(ptm.detach().numpy())
plt.imshow(cm.detach().numpy()[0][0])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21488062187673515, 'fraction_numerical': 0.056635202665186006, 'mean_word_length': 9.855421686746988, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '99917', 'license': 'MIT', 'n_tokens_mistral': 888, 'n_tokens_neox': 832, 'n_words': 83, 'path': 'tablenet.ipynb', 'repo_name': 'shrikumaran/ABInBev-Hackathon', 'size': '1801'}