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
" Personal neovim config file. NOTETOSELF: paste in ~/.config/nvim/ | |
:set number | |
:set autoindent | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:set smarttab | |
:set softtabstop=4 | |
:set mouse=a | |
call plug#begin('~/.config/nvim/plugged') |
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 numpy as np | |
import time | |
import matplotlib.pyplot as plt | |
from tqdm import tqdm | |
import requests | |
import gzip | |
from numpy import loadtxt,savetxt | |
np.seterr(divide='ignore',invalid='ignore') |
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 numpy as np | |
import matplotlib.pyplot as plt | |
import random | |
import time | |
def one_hot(Y): | |
data_size=Y.shape[0] | |
classes=np.unique(Y).reshape(-1,1) | |
num_classes=classes.shape[0] | |
class_mappings=np.arange(0,max(Y)+1) |
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 cv2 | |
import numpy as np | |
# Finds distance between two points | |
def points_distance(pt1,pt2): | |
return (((pt1[0]-pt2[0])**2 + (pt1[1]-pt2[1])**2)**(1/2)) | |
# Orders points clockwise | |
# Credits pyimagesearch.com | |
def order_points(pts): |
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
# This is the problem for First technical round for the role of Computer Vision Engineer at Vectorly | |
# More details at https://www.linkedin.com/jobs/view/1629909785/ | |
# | |
# Write a function which will segment and extract the text overlay "Bart & Homer's EXCELLENT Adventure" | |
# Input image is at https://vectorly.io/demo/simpsons_frame0.png | |
# Output : Image with only the overlay visible and everything else white | |
# | |
# Note that you don't need to extract the text, the output is an image with only | |
# the overlay visible and everything else (background) white | |
# |
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 = {} |
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 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
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") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder