Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Enhance] Support multi-band image for Mosaic#2748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
MeowZheng merged 3 commits intoopen-mmlab:dev-1.xfromKKIEEK:feat/multidim-mosaic
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletionmmseg/datasets/transforms/transforms.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1062,8 +1062,9 @@ def _mosaic_transform_img(self, results: dict) -> dict:

assert 'mix_results' in results
if len(results['img'].shape) == 3:
c = results['img'].shape[2]
mosaic_img = np.full(
(int(self.img_scale[0] * 2), int(self.img_scale[1] * 2),3),
(int(self.img_scale[0] * 2), int(self.img_scale[1] * 2),c),
self.pad_val,
dtype=results['img'].dtype)
else:
Expand Down
11 changes: 11 additions & 0 deletionstests/test_datasets/test_transform.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -639,6 +639,17 @@ def test_mosaic():
results = mosaic_module(results)
assert results['img'].shape[:2] == (20, 24)

results = dict()
results['img'] = np.concatenate((img, img), axis=2)
results['gt_semantic_seg'] = seg
results['seg_fields'] = ['gt_semantic_seg']

transform = dict(type='RandomMosaic', prob=1, img_scale=(10, 12))
mosaic_module = TRANSFORMS.build(transform)
results['mix_results'] = [copy.deepcopy(results)] * 3
results = mosaic_module(results)
assert results['img'].shape[2] == 6


def test_cutout():
# test prob
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp