Closed venuswku closed 1 year ago
Excellent, thanks @venuswku. I like all these changes, and will accept and merge your PR today
I tested the output geotiff files in QGIS. They appear in the correct place, and look good
I like the output json file, "info.json", containing metadata.
There are three further changes I would like to see
The first relates to your question The doodles image might be used to test other segmentation models, but it's not super useful to view it on a map so I don't think it needs to contain any geographic information. What do you think?
I think there are good reasons to make the doodles image a geotiff, if the inputs are geotiffs. It would be valuable to see where in space those doodles were made.
The second request is to make only the following outputs
The "input" file that is currently an output is surplus to requirements - it merely duplicates the input file
The third request is to name the output files with the same root as the input file. So, if the input file is called samplegeotiff.tif
, the outputs should be called 1) samplegeotiff_doodles.tif
, 2) samplegeotiff_colorlabel.tif
, 3) samplegeotiff_label.tif
, and 4) samplegeotiff_info.json
. This will be easier to match input files with outputs, based on filename. The info.json files could later be consolidated into a single JSON file containing all metadata info for all doodled images
Thanks!
Thanks for testing the output files in QGIS, @dbuscombe-usgs!
The info.json
file is actually Maxime's idea.😄 I just modified it a little bit to reflect my changes.
I made a pull request for your three changes here: https://github.com/Doodleverse/holodoodler/pull/7. Feel free to check it out when you have time! Here are the new outputs if the input is another_geotiff.tif.zip: 20221021-201048.zip.
another_geotiff_doodles.tif
another_geotiff_label.tif
(grayscale)
another_geotiff_colorlabel.tif
another_geotiff_info.json
{
"time": "20221021-201048",
"user": "placeholder",
"settings": {
"crf_downsample_factor": 2,
"crf_mu": 1,
"crf_theta": 1,
"edges": true,
"intensity": true,
"multichannel": true,
"n_sigmas": 2,
"rf_downsample_value": 1,
"sigma_max": 16,
"sigma_min": 1,
"texture": true
},
"classes": [
"no_data",
"whitewater",
"water",
"sand",
"grassy",
"woody",
"green_marsh",
"gray_marsh",
"anthro"
],
"colormap": [
"#D3D3D3",
"#d8e8ed",
"#0f5e9c",
"#deb42a",
"#C5e946",
"#997548",
"#169156",
"#8fa89c",
"#af4fa2"
],
"input": {
"image": "examples\\images\\Klamath river mouth\\another_geotiff.tif"
},
"output": {
"doodles": "results\\20221021-201048\\another_geotiff_doodles.tif",
"label": "results\\20221021-201048\\another_geotiff_label.tif",
"colorlabel": "results\\20221021-201048\\another_geotiff_colorlabel.tif"
}
}
New Feature Request
colorized_segmentation.png
,input.jpeg
, anddoodles.jpeg
. @dbuscombe-usgs suggested that it be useful for the format of the outputted images (colorized_segmentation
andinput
) to match the format of the input image.colorized_segmentation
andinput
images had the same geographic information as the input. When these output images are displayed on a map with GIS software, they will be placed at the map coordinates that the input image is georeferenced to.doodles
image might be used to test other segmentation models, but it's not super useful to view it on a map so I don't think it needs to contain any geographic information. What do you think?overlay
image should match the format of the input image since it contains both thecolorized_segmentation
andinput
images.Suggested Solution
gdal
module and Pillow'sImage
module to save thecolorized_segmentation
,input
, andoverlay
images in specific formats.gdal
before, so I added it as a new dependency inenvironment_dev.yaml
.leafmap
. Can someone check if the output images can be viewed with other GIS software like QGIS? I'll be testing with QGIS once I make some space to download it on my laptop.leafmap
:input.tif
colorized_segmentation.tif
overlay.tif
Notes
colorized_segmentation
andoverlay
images as PNGs because JPG/JPEG images don't support alpha/transparency channels. Theinput
image is saved as a JPG/JPEG though!colorized_segmentation
,input
, andoverlay
as TIFF files. You just can't view them on a map with GIS software.doodler-engine
. See more details here: https://github.com/Doodleverse/holodoodler/issues/6../doodler/components.py
's_load_image()
function: