Skip to content

Instantly share code, notes, and snippets.

View shravankumar147's full-sized avatar
🎯
Focusing

Shravankumar shravankumar147

🎯
Focusing
View GitHub Profile
@shravankumar147
shravankumar147 / count_islands-dfs.ipynb
Created August 28, 2023 17:40
count_islands(DFS).ipynb
Loading
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 / 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 / detectron2_coco128_custom_data_training.ipynb
Created October 26, 2022 17:53
detectron2_coco128_custom_data_training.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / yolov6_object_detection.ipynb
Created October 16, 2022 08:19
YOLOv6_object_detection.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / bert-model-download-to-local.ipynb
Created February 28, 2022 15:56
Bert Model Download to Local.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shravankumar147
shravankumar147 / bert-model-download-to-local.ipynb
Created December 27, 2021 17:58
Bert Model Download to Local.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.