Skip to content

Instantly share code, notes, and snippets.

View devarshi16's full-sized avatar
💭
Curiosity, always there

Devarshi Aggarwal devarshi16

💭
Curiosity, always there
View GitHub Profile
@devarshi16
devarshi16 / gocr_image_annotation.py
Last active November 26, 2019 10:53
Annotate text images using GOCR
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()
@devarshi16
devarshi16 / img_crop_save.py
Created November 26, 2019 08:55
Script for cropping images using bounding boxes in correspoding json file
import json
import numpy as np
import os
import cv2
import matplotlib.image as mpimg
current_dir = os.getcwd()
files = os.listdir(current_dir)
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')
@devarshi16
devarshi16 / quick_and_easy_annotator.py
Created November 12, 2019 12:32
Quickly annotate cropped text images for training your OCR-model
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)
@devarshi16
devarshi16 / cloth-generator-64.ipynb
Created April 30, 2019 09:05
cloth generator 64.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.