Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ramesh Kamath RameshKamath

🎯
Focusing
View GitHub Profile
@RameshKamath
RameshKamath / Torch_DDP_Example.py
Created Apr 26, 2021
Distributed Data Parallel for Training Torch Model Parallely
View Torch_DDP_Example.py
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 — forked from sim642/boost-windows.md
Installing boost libraries for GCC (MinGW) on Windows
View boost-windows.md

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 Feb 7, 2020 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler
View Instrumentor.h
//
// 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 Apr 27, 2018
To load saved .pb Graph in tensorboard with logs
View tensorflow_pb_load_to_tensorboard.py
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 Apr 12, 2018 — forked from Alliages/elevation.py
A very simple python script that get elevation from latitude and longitude with google maps API
View elevation_google_maps_API.py
#
# 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 <rkamath.1995@gmail.com>
#
# -----------------------------------
# NO DEPENDANCIES except JSON and REQUESTS
# -----------------------------------
#
# Copyright (c) 2016, Guillaume Meunier <alliages@gmail.com>
# GEOJSON_export is free software; you can redistribute it and/or modify
@RameshKamath
RameshKamath / cvs_access.py
Created Mar 15, 2018
simple code for accessing CVS file and getting data
View cvs_access.py
"""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 Feb 25, 2020 — forked from ronrest/kitti_lidar.py
Visualize Lidar Data in Kitti Data
View kitti_lidar.py
"""
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