Skip to content

Instantly share code, notes, and snippets.

View shravankumar147's full-sized avatar
🎯
Focusing

Shravankumar shravankumar147

🎯
Focusing
View GitHub Profile
@shravankumar147
shravankumar147 / mnist_estimator.py
Created July 3, 2018 18:38 — forked from peterroelants/mnist_estimator.py
Example using TensorFlow Estimator, Experiment & Dataset on MNIST data.
"""Script to illustrate usage of tf.estimator.Estimator in TF v1.3"""
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensorflow.contrib import slim
from tensorflow.contrib.learn import ModeKeys
from tensorflow.contrib.learn import learn_runner
# Show debugging output
@shravankumar147
shravankumar147 / count_islands-dfs.ipynb
Created August 28, 2023 17:40
count_islands(DFS).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / EarlyStoppingCheckpoint.py
Created April 6, 2023 10:10
Implementation of early stopping and checkpointing in PyTorch
import torch
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from torchvision.utils import save_image
from tqdm import tqdm
from collections import defaultdict
class EarlyStoppingCheckpoint:
def __init__(self, model, save_path, metric_name, mode='max', patience=10):
self.model = model
@shravankumar147
shravankumar147 / yolov6_object_detection.ipynb
Created October 16, 2022 08:19
YOLOv6_object_detection.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / detectron2_coco128_custom_data_training.ipynb
Created October 26, 2022 17:53
detectron2_coco128_custom_data_training.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / jupyter_kernel_restart.py
Created December 9, 2022 12:49
Restart kernel after installing new python packages
# Restart kernel after installation
import IPython
IPython.Application.instance().kernel.do_shutdown(True)
@shravankumar147
shravankumar147 / face_detection.py
Last active September 1, 2022 09:27
Face Detection using dlib and opencv. It detects even multi-faces.
# USAGE
# python face_detection.py --image face1.jpg
# import the necessary packages
# from imutils import face_utils
# import numpy as np
import argparse
import imutils
import dlib
import cv2
@shravankumar147
shravankumar147 / lmdbloader.py
Created August 2, 2022 15:10
LMDB Pytorch Data Loader
# lmdbloader.py
import os
import lmdb
import pyarrow
import lz4framed
import numpy as np
from typing import Any
import nonechucks as nc
from torch.utils.data import Dataset, DataLoader
@shravankumar147
shravankumar147 / lmdbconverter.py
Created August 2, 2022 10:49
LMDB dataset creation from images directory
# lmdbconverter.py
import os
import cv2
import fire
import glob
import lmdb
import logging
import pyarrow
import lz4framed
@shravankumar147
shravankumar147 / gcn2_cora.ipynb
Last active March 5, 2022 04:31
GCN2_CORA.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.