-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pure-Python implementations of patch extraction (#818)
* Add "clean" target to makefile Removes the .so files from python C-extensions * Delete the Cython patch extraction code This is in preparation for adding a Pure Python implementation * Tiny speedup in interpolation code Pre-allocate the output array to avoid allocating the output memory twice - once during sampling and once during concatenation * Change to pure Python patch extraction This is slower than the Cython implementation but reduces the maintenance of the package as a whole by removing the need for C-extension compilation. It also adds the ability to interpolate patches with strategies other than nearest neighbour aka slicing. For example, bilinear interpolation can now be used. Note this also changes how boundaries are handled as patches are now always returned and filled with a constant value rather than being truncated. For reference, on the masked Takeo image - extracting patches around the landmarks previously took ~300us on my 2013 Macbook Pro and now takes ~550us - so close to twice as slow. Co-authored-by: Patrick Snape <708474+patricksnape@users.noreply.github.com>
- Loading branch information
1 parent
6006c32
commit 48237d9
Showing
9 changed files
with
404 additions
and
354 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
execute: | ||
python setup.py build_ext --inplace | ||
|
||
clean: | ||
find . -name "*.so" -delete |
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
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
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.