I have .tif raster files from the SpaceNet dataset, along with corresponding object descriptions in geojson files. I want to be able to generate Darknet style bounding box information ([object_class, x_center, y_center, width, height]) from this data. Note that the class is same for all objects in one geojson file.
I am unable to find any suitable tutorial or guide to perform this transformation. The spacenet utilities guide on GitHub is old and doesn't work. Could anybody please help me with this transformation? I am not sure if rasterio can be used to do this.
Edit: Please note that the Darknet style bounding box ([object_class, x_center, y_center, width, height]) assumes a rectangle in output, rather than a polygon.