Skip to content

Instantly share code, notes, and snippets.

View masadcv's full-sized avatar

Muhammad Asad masadcv

View GitHub Profile
@masadcv
masadcv / example.py
Created December 13, 2023 10:03
OWL-VIT Object Detection
import requests
from PIL import Image
import torch
import matplotlib.pyplot as plt
from transformers import OwlViTProcessor, OwlViTForObjectDetection
processor = OwlViTProcessor.from_pretrained("google/owlvit-base-patch32")
model = OwlViTForObjectDetection.from_pretrained("google/owlvit-base-patch32")
@masadcv
masadcv / logid.cfg
Created November 23, 2021 23:39 — forked from CorradoLanera/logid.cfg
my configuration file for logid driver (logitech on linux)
devices: (
{
name: "Wireless Mouse MX Master";
smartshift:
{
on: true;
threshold: 20;
};
hiresscroll:
{
@masadcv
masadcv / instructions.md
Last active October 9, 2021 03:01
Creating GIF Animations

Extract and crop images from MP4

mkdir cropped
for f in *.jpg *.png; do
    echo convert "$f" -crop 1866x1050+54+29 cropped/"$f"
    convert "$f" -crop 1866x1050+54+29 +repage cropped/"$f"
    convert cropped/"$f" -resize 50% cropped/"$f"
done
# Install required packages:
# !pip -q install simplecrf nibabel wget
# !BUILD_MONAI=1 pip -q install git+https://github.com/Project-MONAI/MONAI#egg=monai
from monai.networks.blocks import CRF
import wget
import nibabel
import denseCRF3D
@masadcv
masadcv / Digispark.md
Created February 23, 2021 00:37 — forked from Ircama/Digispark.md
Configuring the Digispark ATtiny85 board for Arduino IDE and upgrading the bootloader

Configuring the Digispark ATTINY85 board for Arduino IDE and upgrading the bootloader

This note describes the configuration of an ATtiny85 based microcontroller development board named Digispark and similar to the Arduino line. It is available in many online marketplaces for roughly 1 dollar (e.g., Ebay, Amazon, AliExpress) and is shipped fully assembled, including a V-USB interface (a software-only implementation of a low-speed USB device for Atmel's AVR microcontrollers). Coding is similar to Arduino: it uses the familiar Arduino IDE and is already provided with a ready-to-use bootloader (fully integrated with Arduino), also allowing to be upgraded. Comparing it with the [ATmega328P](ht

@masadcv
masadcv / imagenet_label_info.json
Created July 15, 2019 23:07
Different ImageNet label conversions
{
"synets_to_label": {
"n01440764": 0,
"n01443537": 1,
"n01484850": 2,
"n01491361": 3,
"n01494475": 4,
"n01496331": 5,
"n01498041": 6,
"n01514668": 7,