Quickest way to test on arbitrary images
Do you have huggingface pipeline or a quick script to test on arbitrary RGB images?
Dear @Ouz-G , unfortunately not. You can however download some toy dataset here : https://ignf.github.io/FLAIR/
I have created a colab notebook to give a first impression on the classification quality. I'm pretty sure it does not show the optimal performance of the model but I hope it can be a starting point.
https://colab.research.google.com/drive/1aB-fZeXx_0mYUO59inQTZnLPJYRLKSGw
Thank you very much @redadmiral !
I managed to replicate the notebook as it is. But when I run a simple RGB image (not tiff, not retrieved from WebMapService), I get the following error:
/usr/local/lib/python3.10/dist-packages/rasterio/init.py:356: NotGeoreferencedWarning: Dataset has no geotransform, gcps, or rpcs. The identity matrix will be returned.
dataset = DatasetReader(path, driver=driver, sharing=sharing, **kwargs)
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py", line 362, in set_geometry
level = frame[col]
File "/usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py", line 1750, in getitem
result = super().getitem(key)
File "/usr/local/lib/python3.10/dist-packages/pandas/core/frame.py", line 4102, in getitem
indexer = self.columns.get_loc(key)
File "/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/range.py", line 417, in get_loc
raise KeyError(key)
KeyError: 'geometry'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/flair-detect", line 33, in
sys.exit(load_entry_point('flair', 'console_scripts', 'flair-detect')())
File "/content/FLAIR-1/src/zone_detect/main.py", line 141, in main
sliced_dataframe, profile, resolution, model = prepare(config, device)
File "/content/FLAIR-1/src/zone_detect/main.py", line 103, in prepare
sliced_dataframe, profile, resolution = slice_extent(in_img=config['input_img_path'],
File "/content/FLAIR-1/src/zone_detect/slicing_job.py", line 74, in slice_extent
gdf_output = gpd.GeoDataFrame(tmp_list, crs=profile['crs'], geometry="geometry")
File "/usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py", line 209, in init
self.set_geometry(geometry, inplace=True, crs=crs)
File "/usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py", line 364, in set_geometry
raise ValueError("Unknown column %s" % col)
ValueError: Unknown column geometry
Which comes down to my original question. Does the inference require other than RGB pixel values? Why do I need "geometry" or other metadata if it is a Unet model?