forked from aleju/imgaug
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve Performance of Segment Replacement (aleju#640)
This patch improves the performance of segment replacement (by average colors within the segments), used in `Superpixels` and `segment_voronoi()`. The new method is up to around 7x faster, more for smaller images and more segments. It can be slightly slower in some cases for large images (512x512 and larger). This change seems to improve the overall performance of `Superpixels` by a factor of around 1.1x to 1.4x (more for smaller images). It improves the overall performance of `segment_voronoi()` by about 1.1x to 2.0x and can reach much higher improvements in the case of very few segments that have to be replaced. Note that `segment_voronoi()` is used in `Voronoi`. Added functions: * `imgaug.augmenters.segmentation.replace_segments_` Added classes: * `imgaug.testutils.temporary_constants` (context)
- Loading branch information
Showing
5 changed files
with
426 additions
and
239 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
changelogs/master/improved/20200315_segment_replacement.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Improved Performance of Segment Replacement #640 | ||
|
||
This patch improves the performance of segment | ||
replacement (by average colors within the segments), | ||
used in `Superpixels` and `segment_voronoi()`. | ||
The new method is up to around 7x faster, more for | ||
smaller images and more segments. It can be slightly | ||
slower in some cases for large images (512x512 and | ||
larger). | ||
|
||
This change seems to improve the overall performance | ||
of `Superpixels` by a factor of around 1.1x to 1.4x | ||
(more for smaller images). | ||
It improves the overall performance of | ||
`segment_voronoi()` by about 1.1x to 2.0x and can | ||
reach much higher improvements in the case of very few | ||
segments that have to be replaced. | ||
|
||
Note that `segment_voronoi()` is used in `Voronoi`. | ||
|
||
Added functions: | ||
* `imgaug.augmenters.segmentation.replace_segments_` | ||
|
||
Added classes: | ||
* `imgaug.testutils.temporary_constants` (context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.