Skip to content

Instantly share code, notes, and snippets.

View gautamchitnis's full-sized avatar
🎯
Focusing

Gautam Chitnis gautamchitnis

🎯
Focusing
View GitHub Profile
Data Structures
- Stacks
- Queues
- Linked lists
- Graphs
- Trees
- Tries
Concepts
- Big O Notation
@bmabir17
bmabir17 / convert.py
Last active February 6, 2022 20:54
Converts the mask-rcnn keras model https://github.com/matterport/Mask_RCNN/releases/tag/v2.0 to tflite
import tensorflow as tf
import numpy as np
import mrcnn.model as modellib # https://github.com/matterport/Mask_RCNN/
from mrcnn.config import Config
import keras.backend as keras
PATH_TO_SAVE_FROZEN_PB ="./"
FROZEN_NAME ="saved_model.pb"
@OldMetalmind
OldMetalmind / OnlineWorkshopScenes.json
Created March 16, 2020 22:51
OBS Scenes used in FlutterPortugal+GDGLisbon Online Workshop
{
"AuxAudioDevice1": {
"balance": 0.5,
"deinterlace_field_order": 0,
"deinterlace_mode": 0,
"enabled": true,
"flags": 0,
"hotkeys": {
"libobs.mute": [],
"libobs.push-to-mute": [],
import json
import numpy as np
import pandas as pd
from pycocotools import mask as cocomask
# global order used when doing annotations, used when people tag without adding id's (because it's faster)
# I use this because when I tagged stuff with other people we didn't manually add the tags, but we tagged always
# in the same order so I can auto-tag the ID now.
tag_order = ['right_ankle', 'right_knee', 'right_hip', 'left_hip', 'left_knee', 'left_ankle', 'pelvis', 'thorax',
@att288
att288 / load_multiple_keras_models_django.py
Created May 4, 2019 17:24
load_multiple_keras_models_django.py
###################################################
# settings.py/the file where to load the models
###################################################
def load_model_from_path(path):
graph = tf.get_default_graph()
model = load_model(path)
return graph, model
def load_all_models():
global gModelObjs # each object is a tuple of graph, model
@korakot
korakot / bucket.py
Last active September 29, 2022 21:40
Mount GCS bucket on Colab
from google.colab import auth
auth.authenticate_user()
!echo "deb http://packages.cloud.google.com/apt gcsfuse-bionic main" > /etc/apt/sources.list.d/gcsfuse.list
!curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
!apt -qq update
!apt -qq install gcsfuse
!mkdir co-lab
!gcsfuse co-lab /content/co-lab
@kauffmanes
kauffmanes / install_anaconda.md
Last active November 16, 2024 21:45
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
@branflake2267
branflake2267 / main.dart
Last active May 7, 2021 03:36
Flutter - Navigation Drawer Left or Right
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: 'Flutter Demo',
theme: new ThemeData(
@bigsnarfdude
bigsnarfdude / gist:d811e31ee17495f82f10db12651ae82d
Last active May 19, 2022 12:18
[boundingBox] opencv example python - Contours – bounding box, minimum area rectangle, and minimum enclosing circle
import cv2
import numpy as np
# read and scale down image
# wget https://bigsnarf.files.wordpress.com/2017/05/hammer.png #black and white
# wget https://i1.wp.com/images.hgmsites.net/hug/2011-volvo-s60_100323431_h.jpg
img = cv2.pyrDown(cv2.imread('2011-volvo-s60_100323431_h.jpg', cv2.IMREAD_UNCHANGED))
# threshold image
ret, threshed_img = cv2.threshold(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY),
@zcaceres
zcaceres / Nested-Routers-Express.md
Last active September 6, 2024 16:45
Child Routers in Express

Nested Routers in Express.js

Express makes it easy to nest routes in your routers. But I always had trouble accessing the request object's .params when you had a long URI with multiple parameters and nested routes.

Let's say you're building routes for a website www.music.com. Music is organized into albums with multiple tracks. Users can click to see a track list. Then they can select a single track and see a sub-page about that specific track.

At our application level, we could first have a Router to handle any requests to our albums.

const express = require('express');