Skip to content

Instantly share code, notes, and snippets.

View nprithviraj24's full-sized avatar
🎯
Focusing

Prithvi Raju nprithviraj24

🎯
Focusing
View GitHub Profile
@travishsu
travishsu / coco2labelme.py
Last active May 20, 2025 14:21
Convert COCO format segmentation annotation to LabelMe format
import os
import json
import subprocess
import numpy as np
import pandas as pd
from skimage.measure import find_contours
class CocoDatasetHandler:
def __init__(self, jsonpath, imgpath):
import torchvision.datasets as datasets
import torchvision.transforms as transforms
import torch
import torchvision
import matplotlib.pyplot as plt
import numpy as np
from custom_transforms import NRandomCrop
set-window-option -g mode-keys vi
# set -g default-terminal "screen"
# enable mouse
set -g mouse on
# vi like navigation
bind h select-pane -L
bind j select-pane -D
@sonots
sonots / nvvp.md
Last active April 11, 2025 05:02
How to use NVIDIA profiler

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@fchollet
fchollet / classifier_from_little_data_script_1.py
Last active February 26, 2025 01:37
Updated to the Keras 2.0 API.
'''This script goes along the blog post
"Building powerful image classification models using very little data"
from blog.keras.io.
It uses data that can be downloaded at:
https://www.kaggle.com/c/dogs-vs-cats/data
In our setup, we:
- created a data/ folder
- created train/ and validation/ subfolders inside data/
- created cats/ and dogs/ subfolders inside train/ and validation/
- put the cat pictures index 0-999 in data/train/cats
@drmalex07
drmalex07 / getopt-example.sh
Last active May 3, 2025 11:08
A small example on Bash getopts. #bash #getopt #getopts
#!/bin/bash
#
# Example using getopt (vs builtin getopts) that can also handle long options.
# Another clean example can be found at:
# http://www.bahmanm.com/blogs/command-line-options-how-to-parse-in-bash-using-getopt
#
aflag=n
bflag=n
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')