kopia lustrzana https://github.com/OpenDroneMap/WebODM
Fixed logging in console
rodzic
734b7ebd86
commit
90bd0917d1
|
@ -1,6 +1,5 @@
|
||||||
import matplotlib
|
import matplotlib
|
||||||
import numpy
|
import numpy
|
||||||
|
|
||||||
def generate_discrete_color_map_from_list_of_hex(list_of_hex_colors):
|
def generate_discrete_color_map_from_list_of_hex(list_of_hex_colors):
|
||||||
colormap = matplotlib.colors.ListedColormap(list_of_hex_colors)
|
colormap = matplotlib.colors.ListedColormap(list_of_hex_colors)
|
||||||
color_map_dict = extract_colormap_dict_from_arr(colormap)
|
color_map_dict = extract_colormap_dict_from_arr(colormap)
|
||||||
|
@ -15,6 +14,7 @@ def extract_colormap_dict_from_arr(colormap):
|
||||||
cmap_uint8 = (cmap_vals * 255).astype('uint8')
|
cmap_uint8 = (cmap_vals * 255).astype('uint8')
|
||||||
ndvi_dict = {idx: value.tolist() for idx, value in enumerate(cmap_uint8)}
|
ndvi_dict = {idx: value.tolist() for idx, value in enumerate(cmap_uint8)}
|
||||||
return ndvi_dict
|
return ndvi_dict
|
||||||
|
|
||||||
ndvi_arr = [
|
ndvi_arr = [
|
||||||
'#AD0028',
|
'#AD0028',
|
||||||
'#C5142A',
|
'#C5142A',
|
||||||
|
|
|
@ -157,8 +157,6 @@ class Metadata(TaskNestedView):
|
||||||
}
|
}
|
||||||
stats = {b: ImageStatistics(**s) for b, s in stats.items()}
|
stats = {b: ImageStatistics(**s) for b, s in stats.items()}
|
||||||
metadata = RioMetadata(statistics=stats, **src.info().dict())
|
metadata = RioMetadata(statistics=stats, **src.info().dict())
|
||||||
print(metadata)
|
|
||||||
print(metadata.json())
|
|
||||||
info = json.loads(metadata.json())
|
info = json.loads(metadata.json())
|
||||||
except IndexError as e:
|
except IndexError as e:
|
||||||
# Caught when trying to get an invalid raster metadata
|
# Caught when trying to get an invalid raster metadata
|
||||||
|
|
Ładowanie…
Reference in New Issue