зеркало из https://github.com/microsoft/torchgeo.git
Update VHR-10 dataset plotting (#2092)
* Update VHR10 dataset visualization method * Update VHR10 info in readme * isort * Missing annotations handling in plotting * Update VHR10 dataset handling and visualization * remove whitespace * Fix whitespace issue in VHR10 dataset handling * black format * ruff format * revert readme changes
This commit is contained in:
Родитель
9cf5f0ff7d
Коммит
6a9cd53969
|
@ -22,6 +22,7 @@ from .utils import (
|
|||
download_and_extract_archive,
|
||||
download_url,
|
||||
lazy_import,
|
||||
percentile_normalization,
|
||||
)
|
||||
|
||||
|
||||
|
@ -386,10 +387,11 @@ class VHR10(NonGeoDataset):
|
|||
.. versionadded:: 0.4
|
||||
"""
|
||||
assert show_feats in {'boxes', 'masks', 'both'}
|
||||
image = percentile_normalization(sample['image'].permute(1, 2, 0).numpy())
|
||||
|
||||
if self.split == 'negative':
|
||||
fig, axs = plt.subplots(squeeze=False)
|
||||
axs[0, 0].imshow(sample['image'].permute(1, 2, 0))
|
||||
axs[0, 0].imshow(image)
|
||||
axs[0, 0].axis('off')
|
||||
|
||||
if suptitle is not None:
|
||||
|
@ -399,9 +401,9 @@ class VHR10(NonGeoDataset):
|
|||
if show_feats != 'boxes':
|
||||
skimage = lazy_import('skimage')
|
||||
|
||||
image = sample['image'].permute(1, 2, 0).numpy()
|
||||
boxes = sample['boxes'].cpu().numpy()
|
||||
labels = sample['labels'].cpu().numpy()
|
||||
|
||||
if 'masks' in sample:
|
||||
masks = [mask.squeeze().cpu().numpy() for mask in sample['masks']]
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче