Skip to content

Instantly share code, notes, and snippets.

View RameshKamath's full-sized avatar
🎯
Focusing

Ramesh Kamath RameshKamath

🎯
Focusing
View GitHub Profile
@RameshKamath
RameshKamath / Torch_DDP_Example.py
Created April 26, 2021 06:37
Distributed Data Parallel for Training Torch Model Parallely
import os
import sys
import tempfile
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.optim as optim
import torch.multiprocessing as mp
from torch.nn.parallel import DistributedDataParallel as DDP
@RameshKamath
RameshKamath / boost-windows.md
Last active May 13, 2020 12:20 — forked from sim642/boost-windows.md
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for Windows

Folder setup

  1. Extract downloaded Boost Source, e.g. C:\Program Files\boost_1_59_0.
  2. Create a folder for Boost.Build installation, e.g. C:\Program Files\boost-build.
  3. Create a folder within boost source for building, i.e. C:\Program Files\boost_1_59_0\build.
  4. Create a folder as Boost Binary location for installation, e.g. C:\Program Files\boost.

Compiler Setup

  1. Open Command prompt/Terminal.
@RameshKamath
RameshKamath / Instrumentor.h
Created February 7, 2020 05:53 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }
@RameshKamath
RameshKamath / tensorflow_pb_load_to_tensorboard.py
Last active April 27, 2018 10:40
To load saved .pb Graph in tensorboard with logs
import tensorflow as tf
with tf.Session() as sess:
model_filename ='insert .pb File here' #insert location of .pb file with mane of file
with tf.gfile.FastGFile(model_filename, 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
g_in = tf.import_graph_def(graph_def,name="Model")
# for Log dir of tensorboard
LOGDIR='./logs'
@RameshKamath
RameshKamath / elevation_google_maps_API.py
Last active April 12, 2018 08:41 — forked from Alliages/elevation.py
A very simple python script that get elevation from latitude and longitude with google maps API
#
# elevation_google_maps: A very simple python script that get elevation from latitude and longitude with google maps API by Guillaume Meunier
# -- with edits from Ramesh Kamath <[email protected]>
#
# -----------------------------------
# NO DEPENDANCIES except JSON and REQUESTS
# -----------------------------------
#
# Copyright (c) 2016, Guillaume Meunier <[email protected]>
# GEOJSON_export is free software; you can redistribute it and/or modify
@RameshKamath
RameshKamath / cvs_access.py
Created March 15, 2018 05:51
simple code for accessing CVS file and getting data
"""simple code for accessing csv file and getting data"""
dic={}
import csv
with open('filename.csv') as f:
ln= f.readlines()
for i in ln[1:]:
dic[i.split(',')[0]]=int(i.split(',')[1])
@RameshKamath
RameshKamath / kitti_lidar.py
Last active February 25, 2020 00:01 — forked from ronrest/kitti_lidar.py
Visualize Lidar Data in Kitti Data
"""
VISUALISE THE LIDAR DATA FROM THE KITTI DATASET
Based on the sample code from
https://github.com/utiasSTARS/pykitti/blob/master/demos/demo_raw.py
And:
http://stackoverflow.com/a/37863912
Contains two methods of visualizing lidar data interactively.
- Matplotlib - very slow, and likely to crash, so only 1 out of every 100