Commit
·
0a1dfbd
1
Parent(s):
a32fe0f
Update files/functions.py
Browse files- files/functions.py +3 -3
files/functions.py
CHANGED
|
@@ -593,8 +593,8 @@ def predictions_token_level(images, custom_encoded_dataset):
|
|
| 593 |
|
| 594 |
from functools import reduce
|
| 595 |
|
| 596 |
-
# Get predictions (
|
| 597 |
-
def
|
| 598 |
|
| 599 |
ten_probs_dict, ten_input_ids_dict, ten_bboxes_dict = dict(), dict(), dict()
|
| 600 |
bboxes_list_dict, input_ids_dict_dict, probs_dict_dict, df = dict(), dict(), dict(), dict()
|
|
@@ -805,6 +805,6 @@ def display_chunk_paragraphs_inference(index_chunk=None):
|
|
| 805 |
|
| 806 |
# display image dataframe
|
| 807 |
print("\n>> Dataframe of annotated lines\n")
|
| 808 |
-
cols = ["texts",
|
| 809 |
df = df[cols]
|
| 810 |
display(df)
|
|
|
|
| 593 |
|
| 594 |
from functools import reduce
|
| 595 |
|
| 596 |
+
# Get predictions (paragraph level)
|
| 597 |
+
def predictions_paragraph_level(dataset, outputs, images_ids_list, chunk_ids, input_ids, bboxes):
|
| 598 |
|
| 599 |
ten_probs_dict, ten_input_ids_dict, ten_bboxes_dict = dict(), dict(), dict()
|
| 600 |
bboxes_list_dict, input_ids_dict_dict, probs_dict_dict, df = dict(), dict(), dict(), dict()
|
|
|
|
| 805 |
|
| 806 |
# display image dataframe
|
| 807 |
print("\n>> Dataframe of annotated lines\n")
|
| 808 |
+
cols = ["texts", "bboxes"]
|
| 809 |
df = df[cols]
|
| 810 |
display(df)
|