R3ab / ttpla_dataset

aerial images dataset on transmission towers and power lines
Apache License 2.0
135 stars 31 forks source link

Resize image script has a problem #2

Closed winter2897 closed 3 years ago

winter2897 commented 3 years ago

Resize image script has a problem

Hi @R3ab, Can you give me some advice?

Resize command

python ./scripts/resize_image_and_annotation-final.py -t ./images

Sized_data Folder

Images have been resized!

Screenshot from 2021-03-30 16-52-49

View on labelme

But, when I show dataset on labelme.

Screenshot from 2021-03-30 16-47-56

Labelme Error Logs

[ERROR  ] label_file:_check_image_height_and_width:160 - imageWidth does not match with imageData or imagePath, so getting imageWidth from actual image.

reason

I think this error is caused by the "imageData" in the .json file of the image is encrypted.

R3ab commented 3 years ago

This script resize the polygon and update the imageWidth and imagePath. However, it does not update the hash of the image in the json file. So, when you open the json file in labelme, it reads the hashed image with its original size and loads the polygons with the resized one.

So, if you want to visualize this, you can write script to load the resized polygon on resized images or update the hash image in the json file.

winter2897 commented 3 years ago

Thank you!