Skip to content

Instantly share code, notes, and snippets.

@tejus-gupta
tejus-gupta / median_filter_multilevel.jl
Created October 9, 2018 15:25
Code for median filter based on 'A coarse-to-fine algorithm for fast median filtering of image data with a huge number of levels' by Alparone et al.
using Images, TestImages, Statistics, BenchmarkTools, Test
img = testimage("lena_gray")
function median_filter_multilevel(img::Array{Gray{Normed{T,f}}, 2}, window_size::Tuple{Int64,Int64}) where {T,f}
nlevels = 2^f
course_nlevels = 2^(f>>1)
bin_bits = f>>1
@tejus-gupta
tejus-gupta / setup.sh
Last active October 10, 2018 17:37
Download dataset and training code for tensorpad
mkdir train_set
cd train_set
wget https://gist.githubusercontent.com/tejus-gupta/3d4564e624cad79691706a5c1303f4c6/raw/3cafe4877f981e3f3c481727d0a90db519a4e95b/download.py
python download.py
unzip -qq masks.zip
unzip -qq train_data.zip
cd ..
git clone https://github.com/tejus-gupta/Segmentation
cd Segmentation
git checkout modelD
\begin{figure}[t]
\begin{center}
\includegraphics[width=1in,height=1in]{images/flute.png}
\hspace{0.1cm}
\includegraphics[width=1in,height=1in]{pictures/adv12.png}
\hspace{0.1cm}
\includegraphics[width=1in,height=1in]{images/carpenter_kit.png}
\hspace{0.1cm}
\includegraphics[width=1in,height=1in]{images/iron.png}
\end{center}
\begin{figure}[t]
\begin{center}
\includegraphics[width=1in,height=1in]{images/flute.png}
\hspace{0.1cm}
\includegraphics[width=1in,height=1in]{pictures/adv12.png}
\hspace{0.1cm}
\includegraphics[width=1in,height=1in]{images/carpenter_kit.png}
\end{center}
\begin{center}
\begin{figure*}
\begin{center}
\includegraphics[width=3.132in,height=2.349in]{Figure_1-11.png}
\hspace{0.2cm}
\includegraphics[width=3.132in,height=2.349in]{Figure_1-6.png}
\end{center}
\begin{center}
\caption{A. (left) Ratio of $i^{th}$ singular value to first singular value of matrix $P$ containing example-wise adversarial perturbations. B. (right) Cosine similarity of our universal perturbation for class '0' with singular vectors of matrix $P$.}
\begin{figure*}[t]
\begin{center}
\includegraphics[width=1.4in,height=1.4in]{pictures/vgg16_envelope.png}
\hspace{0.2cm}
\includegraphics[width=1.4in,height=1.4in]{pictures/vgg16_horsecart.png}
\hspace{0.2cm}
\includegraphics[width=1.4in,height=1.4in]{pictures/vgg16_tablelamp.png}
\end{center}
\begin{center}
import os
import sys
import yaml
import time
import shutil
import torch
import random
import argparse
import datetime
import numpy as np
import os
import sys
import yaml
import time
import shutil
import torch
import random
import argparse
import datetime
import numpy as np
to_remove = []
for class_idx in selected_classes:
if np.sum(y_train[:, class_idx] < 0.5) < 5 or np.sum(y_train[:, class_idx] > 0.5) < 5:
to_remove.append(class_idx)
for class_idx in to_remove:
selected_classes.remove(class_idx)
print('Removed classes with too few examples')

State lattice-based planning

tl;dr

The kinodynamics constraints of the robot are encoded in the state lattice graph and any path in this graph is feasible. After constructing the graph, any graph search algorithm can be used for planning.

Algorithm

A robot's configuration space is usually discretized to reduce computational complexity of planning at the expense of completeness. However, it is difficult to search this space while satisfying the robot's differential constraints. State lattices are a special way of discretization of robot state space that ensures (by construction) that any path in the graph complies with the robot's constraints, thereby eliminating the need to consider them explicitly during planning.