Spaces:
Sleeping
Sleeping
kasper-boy
commited on
Update app_pages/ocr_comparator.py
Browse files
app_pages/ocr_comparator.py
CHANGED
@@ -27,6 +27,15 @@ from pytesseract import Output
|
|
27 |
import os
|
28 |
from mycolorpy import colorlist as mcp
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
###################################################################################################
|
32 |
## MAIN
|
|
|
27 |
import os
|
28 |
from mycolorpy import colorlist as mcp
|
29 |
|
30 |
+
from matplotlib.cm import get_cmap
|
31 |
+
import numpy as np
|
32 |
+
|
33 |
+
def gen_color_normalized(cmap_name, data_arr):
|
34 |
+
cmap = get_cmap(cmap_name)
|
35 |
+
norm_colors = cmap(data_arr / np.max(data_arr)) # normalize data and apply colormap
|
36 |
+
return norm_colors
|
37 |
+
|
38 |
+
|
39 |
|
40 |
###################################################################################################
|
41 |
## MAIN
|