koito19960406 / ZenSVI

This package is a one-stop solution for downloading, cleaning, analyzing street view imagery
https://zensvi.readthedocs.io/en/latest/
Creative Commons Attribution Share Alike 4.0 International
20 stars 2 forks source link

Consider using the tidy (long) format for the output #15

Closed fbiljecki closed 1 year ago

fbiljecki commented 1 year ago

Perhaps it would make downstream analyses easier than the wide format.

koito19960406 commented 1 year ago

This was addressed in v0.6.0. You can now set csv_format argument like below:

# initialize the segmenter
dataset="mapillary"
task="panoptic"
segmenter  = Segmenter(dataset=dataset, task=task)

# set arguments
dir_input = "path/to/input"
dir_image_output = "path/to/image_output"
dir_pixel_ratio_output = "path/to/pixel_ratio_output"
save_image_options = ["segmented_image", "blend_image"]
pixel_ratio_save_format = ["csv", "json"]
csv_format = "long" # "long" or "wide"
segmenter.segment(dir_input, 
                dir_image_output = dir_image_output,
                dir_pixel_ratio_output = dir_pixel_ratio_output,
                save_image_options = save_image_options,
                pixel_ratio_save_format = pixel_ratio_save_format,
                csv_format = csv_format)