Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bhairavmehta95's full-sized avatar

Bhairav Mehta bhairavmehta95

View GitHub Profile
@bhairavmehta95
bhairavmehta95 / crawl_basic.py
Last active February 7, 2019 03:51
A simple text extraction and preprocessing script
import requests
from bs4 import BeautifulSoup
import re
import numpy as np
def preprocess_raw_text(raw_text):
raw_text = raw_text.replace('-', ' ')
raw_text = raw_text.replace('\n', ' ')
raw_text = raw_text.replace('...', ' ')
raw_text = raw_text.replace(' ', ' ').encode('ascii', 'ignore')
@bhairavmehta95
bhairavmehta95 / bag_converter.py
Created July 19, 2018 21:26
Converts rosbags from duckietown to s/a pair pickle files
import rospy, rosbag
import numpy as np
import cv2
import pickle
import argparse
def image_to_numpy(msg):
"""
Convert a sensor_msgs/CompressedImage to numpy array
@bhairavmehta95
bhairavmehta95 / oriented-bounding-boxes-python-example.ipynb
Last active June 26, 2018 23:13
Oriented Bounding Boxes (Creation) and Collision Example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.