Skip to content

Instantly share code, notes, and snippets.

View peteflorence's full-sized avatar

Pete Florence peteflorence

View GitHub Profile
@peteflorence
peteflorence / gist:4b6e15aeb419c727fc0d39ca47eb96fc
Created January 24, 2019 20:04
current spartan build error
[ 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 August 11, 2022 09:15
Pixelwise Contrastive Loss in PyTorch
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
@peteflorence
peteflorence / pytorch-finding-correspondences.ipynb
Last active May 23, 2020 20:37
pytorch_finding_correspondences
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 January 16, 2024 14:18
Bilinear interpolation in PyTorch, and benchmarking vs. numpy

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

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
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
startIndex: 0, endIndex: 18
BEFORE
startWord: 0011101011110100101010010001110111111111111111111111111111111111
endWord: 1001000110110110111100001000100000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000010001000011110110110110001001
endWord: 1111111111111111111111111111111110111000100101010010111101011100
AFTER RE-ADDING STARTSAVE AND ENDSAVE
startWord: 0011101011110100101010010001110100000000000000000000000000000000
endWord: 0000000000000000000100001000100000000000000000000000000000000000
BEFORE
startWord: 1111111111110101101010010001110100000000000000000000000000000000
endWord: 0000000000000000000000000000000000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000000000000000000000000000000000
endWord: 0000000000000000000000000000000010111000100101011010111111111111
BEFORE
startWord: 1111111111110101101010010001110100000000000000000000000000000000
endWord: 1111001100100011100100100000000000000000000000000000000000000000
BEFORE
startWord: 1111111111110101101010010001110100000000000000000000000000000000
endWord: 1111001100100011100100100000000000000000000000000000000000000000
AFTER
startWord: 0000000000000000000000000000000000000000010010011100010011001111
endWord: 0000000000000000000000000000000010111000100101011010111111111111
BEFORE
startWord: 0000000000000000000000000000000000000000000000000000000000000000
endWord: 0000000000000000000000000000000000000000000000000000000000000000
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">