Skip to content

Instantly share code, notes, and snippets.

View gumdropsteve's full-sized avatar

Winston Robson gumdropsteve

View GitHub Profile
@gumdropsteve
gumdropsteve / nested_queries.ipynb
Last active November 25, 2020 13:58
Run these notebooks on app.blazingsql.com
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gumdropsteve
gumdropsteve / draw_boxes_and_save.py
Last active April 6, 2022 11:09
Convert attribute columns from VGG Image Annotator CSV to lists, then to pandas DataFrame. Draw the bounding boxes on og images and save the new image.
# folder where the image is already saved (without bounding boxes)
data_dir = 'media/stable_numbers/number_crops/'
# folder where the new image with bounding boxes should be saved
out_dir = 'media/copy_labeled_number_crops/'
# go through the unique file names (because files can have more than 1 bounding box)
for file in new_df.filename.unique():
# load in the image and .loc[] the rows where it's referenced (each row represents 1 bounding box)
@gumdropsteve
gumdropsteve / check_colab_gpu.py
Created August 10, 2020 04:21
Check Google Colab GPU Type for RAPIDS Compatibility
import pynvml
pynvml.nvmlInit()
handle = pynvml.nvmlDeviceGetHandleByIndex(0)
device_name = pynvml.nvmlDeviceGetName(handle)
if (device_name != b'Tesla T4') and (device_name != b'Tesla P4') and (device_name != b'Tesla P100-PCIE-16GB'):
raise Exception("""
Unfortunately this instance does not have a T4, P4 or P100 GPU.\n
Please make sure you've configured Colab to request a GPU instance type.\n
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gumdropsteve
gumdropsteve / download_nyc_yellow_taxi.py
Created May 6, 2020 00:01
January 2009 thru June 2016 - Download TLC Yellow Cab dataset from AWS.
import os
import urllib
def data_check(file_name, data_dir='', base_url='https://s3.amazonaws.com/nyc-tlc/trip+data/'):
"""
1. check if the given {file_name} exists locally in {data_dir}
2. download from {base_url} & save in {data_dir) if not
INPUTS
> file_name
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gumdropsteve
gumdropsteve / openpilot-sim-old-README.md
Created February 29, 2020 06:53
readme for openpilot/tools/sim from the friday afternoon update 28 feb 2020 (before hackathon update)

Tested in Ubuntu 16.04 (test machine has GPUs. may need some modification if have no GPU)

How-To-Use:

== 0. Have a working python 3.7.3 with pip ==

== 1. Checkout openpilot ==

cd ~/
git clone -b sim https://github.com/commaai/openpilot.git