Update app.py
Browse files
app.py
CHANGED
@@ -440,21 +440,21 @@ def compute_tfidf_embeddings(documents1, documents2):
|
|
440 |
|
441 |
|
442 |
def extract_eval(image1,image2,image3,image4):
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
diagram_1_embed=return_image_embedding(model,image2)
|
454 |
-
diagram_2_embed=return_image_embedding(model,image4)
|
455 |
-
diagram_embed_sim_score=util.pytorch_cos_sim(embedding_1, embedding_2)
|
456 |
-
print("Diagram Embedding Similarity Score \n")
|
457 |
-
print(diagram_embed_sim_score)
|
458 |
|
459 |
|
460 |
|
|
|
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)
|
446 |
+
submitted_text=extract(image3)
|
447 |
+
print("Extracting Submitted Text \n")
|
448 |
+
print(submitted_text_text)
|
449 |
+
a,b=sim(ideal_text,submitted_text)
|
450 |
+
print(a)
|
451 |
+
text_sim_score=b
|
452 |
+
model = ResNet50(include_top=False, weights='imagenet', pooling='avg')
|
453 |
+
# diagram_1_embed=return_image_embedding(model,image2)
|
454 |
+
# diagram_2_embed=return_image_embedding(model,image4)
|
455 |
+
# diagram_embed_sim_score=util.pytorch_cos_sim(embedding_1, embedding_2)
|
456 |
+
# print("Diagram Embedding Similarity Score \n")
|
457 |
+
# print(diagram_embed_sim_score)
|
458 |
|
459 |
|
460 |
|