Skip to content

Instantly share code, notes, and snippets.

Pete Florence peteflorence

View GitHub Profile
View gist:4b6e15aeb419c727fc0d39ca47eb96fc
[ 60%] Built target python_byte_compile
[ 60%] Building CXX object src/vtk/DRCFilters/CMakeFiles/vtkDRCFilters.dir/vtkFrameWidgetRepresentation.cxx.o
In file included from /home/peteflo/spartan/build/director/src/PointCloudLibraryPlugin/Filters/vtkPCLSACSegmentationCylinder.cxx:31:0:
/home/peteflo/spartan/build/install/include/pcl-1.8/pcl/sample_consensus/model_types.h: In function 'void __static_initialization_and_destruction_0(int, int)':
/home/peteflo/spartan/build/install/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: warning: 'pcl::SAC_SAMPLE_SIZE' is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
^
/home/peteflo/spartan/build/install/include/pcl-1.8/pcl/sample_consensus/model_types.h:99:3: note: declared here
@peteflorence
peteflorence / pixelwise_contrastive_loss.py
Last active Feb 28, 2018
Pixelwise Contrastive Loss in PyTorch
View pixelwise_contrastive_loss.py
import torch
class PixelwiseContrastiveLoss(torch.nn.Module):
def __init__(self):
super(PixelwiseContrastiveLoss, self).__init__()
self.num_non_matches_per_match = 150
def forward(self, image_a_pred, image_b_pred, matches_a, matches_b, non_matches_a, non_matches_b):
loss = 0
View pytorch-finding-correspondences.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peteflorence
peteflorence / pytorch_bilinear_interpolation.md
Last active Apr 10, 2019
Bilinear interpolation in PyTorch, and benchmarking vs. numpy
View pytorch_bilinear_interpolation.md

Here's a simple implementation of bilinear interpolation on tensors using PyTorch.

I wrote this up since I ended up learning a lot about options for interpolation in both the numpy and PyTorch ecosystems. More generally than just interpolation, too, it's also a nice case study in how PyTorch magically can put very numpy-like code on the GPU (and by the way, do autodiff for you too).

For interpolation in PyTorch, this open issue calls for more interpolation features. There is now a nn.functional.grid_sample() feature but at least at first this didn't look like what I needed (but we'll come back to this later).

In particular I wanted to take an image, W x H x C, and sample it many times at different random locations. Note also that this is different than upsampling which exhaustively samples and also doesn't give us fle

View gist:3db5b7c010bac098b9e0486ec8e6ed65
startIndex: 0, endIndex: 2
quick 0 8 16 24 32 40 48 56 64
index # # # # # # # #
BEFORE
startWord: 10111100
endWord: 00010101
AFTER
startWord: 10101000
endWord: 00111101
AFTER RE-ADDING STARTSAVE AND ENDSAVE
View gist:60d0d227ba19d6aff59caa6868ab8604
startIndex: 0, endIndex: 18
quick 0 8 16 24 32 40 48 56 64
index # # # # # # # #
BEFORE
startWord: 0011101011110100101010010001110111111111111111111111111111111111
endWord: 1001000110110110111100001000100000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000010001000011110110110110001001
endWord: 1111111111111111111111111111111110111000100101010010111101011100
AFTER RE-ADDING STARTSAVE AND ENDSAVE
View gist:113c5a24fd63974afb8f929040ca806c
startIndex: 0, endIndex: 18
BEFORE
startWord: 0011101011110100101010010001110111111111111111111111111111111111
endWord: 1001000110110110111100001000100000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000010001000011110110110110001001
endWord: 1111111111111111111111111111111110111000100101010010111101011100
AFTER RE-ADDING STARTSAVE AND ENDSAVE
startWord: 0011101011110100101010010001110100000000000000000000000000000000
endWord: 0000000000000000000100001000100000000000000000000000000000000000
View gist:72045bca0ec234fb7fe4f1e326805ddb
BEFORE
startWord: 1111111111110101101010010001110100000000000000000000000000000000
endWord: 0000000000000000000000000000000000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000000000000000000000000000000000
endWord: 0000000000000000000000000000000010111000100101011010111111111111
BEFORE
startWord: 1111111111110101101010010001110100000000000000000000000000000000
endWord: 1111001100100011100100100000000000000000000000000000000000000000
View gist:f2116e12d80e5b1b693ad5ae78e8d5a4
BEFORE
startWord: 1111111111110101101010010001110100000000000000000000000000000000
endWord: 1111001100100011100100100000000000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000000000010010011100010011001111
endWord: 0000000000000000000000000000000010111000100101011010111111111111
BEFORE
startWord: 0000000000000000000000000000000000000000000000000000000000000000
endWord: 0000000000000000000000000000000000000000000000000000000000000000
View foo.diff
diff --git a/whoweare.html b/whoweare.html
index da7251b..48ab9e9 100644
--- a/whoweare.html
+++ b/whoweare.html
@@ -217,15 +217,6 @@ img.emoji {
</div>
<div class="member bg-white">
<div class="inner clearfix">
- <img src="http://itsjusth.com/wp-content/uploads/2016/11/IMG_0378.jpg" class="profile-pic">
- <div class="member-meta">
You can’t perform that action at this time.