Skip to content

Instantly share code, notes, and snippets.

View bhaskara's full-sized avatar

Bhaskara Marthi bhaskara

  • San Francisco, USA
View GitHub Profile
@bhaskara
bhaskara / openni_record_player.launch
Created April 16, 2012 17:38
Example ROS launch file that uses depth_image_proc to convert an RGB-depth image pair into a point cloud
<launch>
<!--
To distinguish between the cases where the rgb image is
1280x1024 versus 640x480. This affects the pipeline.
-->
<arg name="high_res_rgb" default="true"/>
<arg name="cloud_input_ns" value="camera/rgb_downsampled"
if="$(arg high_res_rgb)"/>
<arg name="cloud_input_ns" value="camera/rgb" unless="$(arg high_res_rgb)"/>
@bhaskara
bhaskara / rewriting.py
Last active December 14, 2015 03:39
rewriting.py
from collections import defaultdict
def best_rewrites(q, n=10):
"""Return N best rewrites of query Q.
Q: string of space-separated words
Also depends on the two dictionaries frequencies and substitutions."""
from sklearn.cluster import DBSCAN
class OutlierDetector(object):
"""Detect outlier users
Parameters
----------
users : [User]
outlier_detector : DBScan or IsolationForest or other outlier detector or None
Defaults to DBScan