Skip to content

Instantly share code, notes, and snippets.

View deebuls's full-sized avatar
🏠
Working from home

Deebul Nair deebuls

🏠
Working from home
View GitHub Profile
@deebuls
deebuls / bag_to_images.py
Last active May 29, 2024 10:02
Convert rosbag to images with python 3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Massachusetts Institute of Technology
# Copyright 2024 Massachusetts Institute of Technology
"""Extract images from a rosbag.
"""
@deebuls
deebuls / 1-pw_op_fusion.py
Created January 22, 2023 11:35 — forked from Chillee/1-pw_op_fusion.py
PT 2.0 Benchmarks
import torch
import torch._inductor.config
import time
torch._inductor.config.triton.cudagraphs = False
torch.set_float32_matmul_precision('high')
def bench(f, name=None, iters=100, warmup=5, display=True, profile=False):
for _ in range(warmup):
f()
@deebuls
deebuls / fomo.ipynb
Created November 22, 2022 19:29
fomo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
""" refer to https://github.com/jfzhang95/pytorch-deeplab-xception/blob/master/utils/metrics.py """
""" https://chowdera.com/2021/12/202112250822183610.html """
""" confusionMetric # Be careful : The horizontal line here represents the predicted value ,
The vertical represents the real value , Contrary to the previous Introduction P\L P N P TP FP N FN TN """
class SegmentationMetric(torch.nn.Module):
def __init__(self, numClass):
@deebuls
deebuls / [Ubuntu Blueman ERROR Fix] Failed to change profile to headset_head_unit.md
Last active March 19, 2021 12:52
[Ubuntu Blueman ERROR Fix] Failed to change profile to headset_head_unit

My earbuds SoundBuds Flow was connecting and audio working but microphone was not working.

It gets connected as A2DP audi sink, when you try to convert to Headset Head unit it gives the error "Failed to change profile to headset_head_unit".

The fix as per [1]

Install ofono:

sudo apt install ofono

@deebuls
deebuls / train_cifar.py
Created September 2, 2020 12:16 — forked from y0ast/train_cifar.py
Getting high accuracy on CIFAR-10 is not straightforward. This self-contained script gets to 94% accuracy with a minimal setup. You can download a model trained with this script from: https://files.joo.st/cifar_model.pt
import argparse
from tqdm import tqdm
import torch
import torch.nn.functional as F
from torchvision import models, datasets, transforms
def get_CIFAR10(root="./"):
@deebuls
deebuls / regex.md
Last active February 1, 2018 12:42
Regex learnings

Regex used by me

  1. For searching lines with only a single word .
  • ^\h*\w+\h*$
  • ^ - Start of line
  • \h* - optional leading horizontal whitespac
  • \w+ - 1 or more word symbols You can use \S instead of \w to match any non-whitespace symbols.

To insert a linebreak, just replace with \r\n$0. You do not need any capturing groups since you can always reference the whole match with $0 (or $&).

@deebuls
deebuls / MachineLearningCourseMaterials.md
Last active February 1, 2018 13:02
Materials for teaching Machine learning course
@deebuls
deebuls / DeepLearningWorkshopMaterials.md
Last active January 15, 2018 13:34
Deep learning Workshops Materials
@deebuls
deebuls / md
Created September 13, 2017 16:50
Pandas helpful
# Useful Scripts for Pandas
## Splitting a df whenever the value of a column changes
| 0 | 1 | 2|
|