Replies: 1 comment
-
Quick follow up with some errors I ran into while doing this and their solutions! If you're going to coarsen the resolution of images and annotations from the NeonTreeEvaluations dataset (which I think was used for DeepForest, right?) annotations are given in format "filename, xmin, xmax, ymin, ymax, name" for the columns (at least if you read them into R using xml_parse from the NeonTreeEvaluations package, which I did because I was having trouble with the read_pascal_voc function in python). However, albumentations expects the format for the bounding box coordinates to be xmin, ymin, xmax, ymax (I think DeepForest does as well). Also, training the DeepForest model you need the first column to be changed to "input_path", and the last column should be changed to "label" |
Beta Was this translation helpful? Give feedback.
-
If you want to predict into new resolutions, or train annotations taken from higher resolution data, what strategies should you use? A user wrote
If you had a box at xmin=20, ymin=20, xmax=30, ymax=30, your box starts at the pixel coordinate (20,30). If you change the resolution of your image, you would need to change the coordinates to put the object in the same place. You could use albumentations, I think they call it medianblur. https://huggingface.co/spaces/qubvel-hf/albumentations-demo?transform=MedianBlur, or you could calculate the change yourself using rasterio.
Gemini is fun for these kinds of questions
https://g.co/gemini/share/cf316eb4a8df
"if you had a bounding box and an image, explain in python how to use rasterio and numpy to change the resolution of a raster and alter the bounding box to maintain its position"
Beta Was this translation helpful? Give feedback.
All reactions