Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from tkinter import * | |
from tkinter import ttk | |
import sys | |
import pandas as pd | |
from PIL import ImageTk,Image | |
base = Tk() | |
base.geometry("500x500") | |
base.resizable(width = True, height = True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random as rand | |
import shutil | |
if not os.path.exists('val'): | |
os.makedirs('val') | |
if not os.path.exists('test'): | |
os.makedirs('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import numpy as np | |
import os | |
import cv2 | |
import matplotlib.image as mpimg | |
current_dir = os.getcwd() | |
files = os.listdir(current_dir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from google.cloud import vision | |
import io | |
import os | |
import os | |
os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="/home/devarshi/gcloud.json" | |
def detect_text(path): | |
"""Detects text in the file.""" | |
client = vision.ImageAnnotatorClient() |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pdf2image import convert_from_path, convert_from_bytes | |
from PIL import Image | |
import os | |
files = os.listdir() | |
for f in files: | |
if '.PDF' in f: | |
imgs = convert_from_path(f) | |
for i,im in enumerate(imgs): | |
im.save('.'.join(f.split('.')[:-1])+"_"+str(i)+".JPEG","JPEG") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import random | |
TASK_SIZE = 25 | |
dir_names = [ | |
"cheque", | |
"nach", | |
"pan_and_aadhaar" | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import cv2 | |
import sys | |
textBB_items = ["Printed Key","Written Key","Check Box Key","Comment/Info" ] | |
fieldBB_items = [None,"detectorPrediction","None","Printed Value", "Written Value", "Check Box Value", "Logo", "Signature", "Photograph"] | |
extensions = ['.JPEG','.png','.jpg','.tif','.tiff'] | |
folder_names = ['internal28','internal17','internal7','internal8','internal9'] | |
#folder_names = ['internal7'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import sys | |
import random | |
data = {} | |
dir_names = sys.argv[1:] | |
current_dir = os.getcwd() | |
train = {} |
OlderNewer