This file contains hidden or 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 tensorflow as tf | |
from keras.preprocessing.image import ImageDataGenerator | |
# creating a sequential model | |
cnn = tf.keras.models.Sequential() | |
# adding convolution layer to network | |
cnn.add(tf.keras.layers.Conv2D(filters=32, kernel_size=3, activation='relu', input_shape=[64, 64, 3])) | |
# adding pooling layer to network |
This file contains hidden or 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 pytesseract | |
pytesseract.pytesseract.tesseract_cmd = r'C:\Users\Akash.Chauhan1\AppData\Local\Tesseract-OCR\tesseract.exe' | |
# load the original image | |
image = cv2.imread('Original_Image.jpg') | |
# get co-ordinates to crop the image | |
c = line_items_coordinates[1] | |
# cropping image img = image[y0:y1, x0:x1] |
This file contains hidden or 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
# use this command to install open cv2 | |
# pip install opencv-python | |
# use this command to install PIL | |
# pip install Pillow | |
import cv2 | |
from PIL import Image | |
def mark_region(imagE_path): |
This file contains hidden or 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 | |
pdfs = r"provide path to pdf file" | |
pages = convert_from_path(pdfs, 350) | |
i = 1 | |
for page in pages: | |
image_name = "Page_" + str(i) + ".jpg" | |
page.save(image_name, "JPEG") | |
i = i+1 |
NewerOlder