hugobaudchon / geodataset

MIT License
6 stars 1 forks source link

PointCloud Label Coco dataset bug #87

Open itsmohitanand opened 1 month ago

itsmohitanand commented 1 month ago

Hi Hugo

I realised a potential issue in saving the coco dataset. To debug this I need to understand two things.

First is why do we need to translate the geometry? https://github.com/hugobaudchon/geodataset/blob/389f3c82af22878939589d75e0fceb94009f596e/geodataset/tilerize/labeled_raster_tilerizer.py#L237

Secondly how does cv2.fillpoly works? https://github.com/hugobaudchon/geodataset/blob/389f3c82af22878939589d75e0fceb94009f596e/geodataset/utils/utils.py#L77

For example this is how my binary_mask and polygon looks like. Do you have any suggestion on how can I generate the binary mask accurately?

ic| binary_mask: array([[0, 0, 0, ..., 0, 0, 0],
                        [0, 0, 0, ..., 0, 0, 0],
                        [0, 0, 0, ..., 0, 0, 0],
                        ...,
                        [0, 0, 0, ..., 0, 0, 0],
                        [0, 0, 0, ..., 0, 0, 0],
                        [0, 0, 0, ..., 0, 0, 0]], dtype=uint8)
ic| contours: array([[[ 577115, 5093416]],

                     [[ 577115, 5093416]],

                     [[ 577115, 5093416]],

                     [[ 577116, 5093417]],

                     [[ 577116, 5093417]],

                     [[ 577116, 5093417]],

                     [[ 577116, 5093417]],

                     [[ 577116, 5093417]],

                     [[ 577116, 5093417]],

                     [[ 577116, 5093418]],

                     [[ 577117, 5093418]],

                     [[ 577117, 5093418]],

                     [[ 577117, 5093418]],

                     [[ 577117, 5093418]],

                     [[ 577117, 5093418]],

                     [[ 577118, 5093418]],

                     [[ 577118, 5093418]],

                     [[ 577118, 5093418]],

                     [[ 577118, 5093417]],

                     [[ 577118, 5093417]],

                     [[ 577118, 5093417]],

                     [[ 577118, 5093416]],

                     [[ 577118, 5093416]],

                     [[ 577118, 5093416]],

                     [[ 577118, 5093416]],

                     [[ 577118, 5093416]],

                     [[ 577115, 5093416]],

                     [[ 577115, 5093416]]], dtype=int32)
itsmohitanand commented 1 month ago

On further inspection I found that we need to have the correct height and width of the image for RLE representations. Right now the RLE is being disabled if tile metadata is not being provided with correct height and width. Working without RLE works as expected.