Skip to content
Snippets Groups Projects

Input prediction folder

Merged Thibault Lavigne requested to merge input-prediction-folder into main
All threads resolved!
1 file
+ 6
12
Compare changes
  • Side-by-side
  • Inline
+ 6
12
@@ -270,18 +270,13 @@ def process_image(
threshold_value,
):
# Load image and pre-process it
try:
if image_max_width:
_, w, _ = read_image(image, scale=1).shape
ratio = image_max_width / w
im = read_image(image, ratio)
else:
im = read_image(image, scale=scale)
except Exception as e:
print(e)
print(image)
if image_max_width:
_, w, _ = read_image(image, scale=1).shape
ratio = image_max_width / w
im = read_image(image, ratio)
else:
im = read_image(image, scale=scale)
raise e
logger.info("Image loaded.")
im_p = dan_model.preprocess(im)
logger.debug("Image pre-processed.")
@@ -333,7 +328,6 @@ def process_image(
}
for current, next_token in pairwise(index + [0])
]
assert len(index) == len(result["confidences"]["by ner token"])
result["confidences"]["total"] = np.around(np.mean(char_confidences), 2)
for level in confidence_score_levels:
Loading