mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-01 03:32:00 +02:00
do_prediction_new_concept: aggregate confidence for all classes…
(not just text; will still have to pass that on to the writer...)
This commit is contained in:
parent
5a27e46b22
commit
0f82b568ba
1 changed files with 4 additions and 3 deletions
|
|
@ -657,8 +657,9 @@ class Eynollah:
|
||||||
dilate=3,
|
dilate=3,
|
||||||
keep=separator_class)
|
keep=separator_class)
|
||||||
|
|
||||||
conf_text = resize_image(label_p_pred[:, :, 1], img_h_page, img_w_page)
|
conf = label_p_pred[tuple(np.indices(seg.shape)) + (seg,)]
|
||||||
return prediction, conf_text
|
conf = resize_image(conf, img_h_page, img_w_page)
|
||||||
|
return prediction, conf
|
||||||
|
|
||||||
if img.shape[0] < img_height_model:
|
if img.shape[0] < img_height_model:
|
||||||
img = resize_image(img, img_height_model, img.shape[1])
|
img = resize_image(img, img_height_model, img.shape[1])
|
||||||
|
|
@ -717,7 +718,7 @@ class Eynollah:
|
||||||
self.logger.debug("predicting patches on %s", str(img_patch.shape))
|
self.logger.debug("predicting patches on %s", str(img_patch.shape))
|
||||||
label_p_pred = model.predict(img_patch,verbose=0)
|
label_p_pred = model.predict(img_patch,verbose=0)
|
||||||
seg = np.argmax(label_p_pred, axis=3)
|
seg = np.argmax(label_p_pred, axis=3)
|
||||||
conf = label_p_pred[:, :, :, 1]
|
conf = label_p_pred[tuple(np.indices(seg.shape)) + (seg,)]
|
||||||
|
|
||||||
if thresholding_for_artificial_class:
|
if thresholding_for_artificial_class:
|
||||||
seg_art = label_p_pred[:, :, :, artificial_class] >= threshold_art_class
|
seg_art = label_p_pred[:, :, :, artificial_class] >= threshold_art_class
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue