mscsasem3 commited on
Commit
0f3f00d
1 Parent(s): e5856b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -27,6 +27,7 @@ import os
27
  from tensorflow.keras.applications.resnet50 import ResNet50,preprocess_input, decode_predictions
28
  from tensorflow.keras.preprocessing import image
29
  from sklearn.feature_extraction.text import TfidfVectorizer
 
30
 
31
 
32
 
@@ -185,6 +186,7 @@ def extract_line_from_image(image, lower_line, upper_line):
185
  return img_copy[lower_boundary:upper_boundary, :]
186
 
187
  def extract(image):
 
188
  img = rgb2gray(image)
189
 
190
  #img = rgb2gray(imread("Penwritten_2048x.jpeg"))
@@ -440,6 +442,7 @@ def compute_tfidf_embeddings(documents1, documents2):
440
 
441
 
442
  def extract_eval(image1,image2,image3,image4):
 
443
  ideal_text=extract(image1)
444
  print("Extracting Ideal Text \n")
445
  print(ideal_text)
 
27
  from tensorflow.keras.applications.resnet50 import ResNet50,preprocess_input, decode_predictions
28
  from tensorflow.keras.preprocessing import image
29
  from sklearn.feature_extraction.text import TfidfVectorizer
30
+ import imageio
31
 
32
 
33
 
 
186
  return img_copy[lower_boundary:upper_boundary, :]
187
 
188
  def extract(image):
189
+ image = imageio.imread(image)[:,:,:3]
190
  img = rgb2gray(image)
191
 
192
  #img = rgb2gray(imread("Penwritten_2048x.jpeg"))
 
442
 
443
 
444
  def extract_eval(image1,image2,image3,image4):
445
+ print(image1)
446
  ideal_text=extract(image1)
447
  print("Extracting Ideal Text \n")
448
  print(ideal_text)