Skip to content

Instantly share code, notes, and snippets.

from tensorflow import keras
import tensorflow as tf
from tensorflow import keras
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
from pydantic import BaseModel, Field
import re
def tokenize(x):
x_tk = Tokenizer()
@vpeopleonatank
vpeopleonatank / convert_voc2dota.py
Created April 20, 2021 01:43
Convert Pascal Voc to DOTA formart
import cv2
import numpy as np
import math
import skimage.io
import xml.etree.ElementTree as ET
import glob
import os
import shutil
def read_label(xml_file: str):
#!/bin/bash
# This installs alacritty terminal on ubuntu (https://github.com/jwilm/alacritty)
# You have to have rust/cargo installed for this to work
# Install required tools
sudo apt-get install -y cmake libfreetype6-dev libfontconfig1-dev xclip
# Download, compile and install Alacritty
git clone https://github.com/jwilm/alacritty
@vpeopleonatank
vpeopleonatank / client.py
Created March 16, 2021 14:38 — forked from kylehounslow/client.py
Send and receive images using Flask, Numpy and OpenCV
from __future__ import print_function
import requests
import json
import cv2
addr = 'http://localhost:5000'
test_url = addr + '/api/test'
# prepare headers for http request
content_type = 'image/jpeg'
@vpeopleonatank
vpeopleonatank / convert_matterport_json_to_coco.py
Last active January 13, 2021 08:51
Convert_between_annotation_format
# Modified from labelme2coco repository
# Usage: python convert_matterport_json_to_coco.py path_to_json.json
import argparse
import glob
import json
import os
import numpy as np
import PIL.Image
@vpeopleonatank
vpeopleonatank / authorized_keys
Last active January 9, 2021 14:03
authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDUMi6jd45sZ1CuUyFr/DyoM0zmvvwnNWSa1P78jLLVyyNrbBwrL3MSb2TYPal1hFW0vmxS9F+HJAbeuMJ8kp5fxjq+wipf+OzDpIFvYdSkOGQb2N51MsglT6qDw+vgfFJ4JfVcso+9CgCntgn5HJdOXbd8reHyzASV0LQ9gmDBtz8A0SnrDkh3znYLcuERtuf6vRhdKHljHu5Mny6CjG4+e6+ZOM7QxxBYzEtmNk96CT4cVkKP9G+xXN5gXMZfEEHCXiimJdkhwBc7gPzfDZc67y/4QB69G+EOgOX6Hbnvp4Kx4mFxaCMo2VU391m3JE5or04xbdUtpuq8BG2G6NrB root@f24bae967576
@vpeopleonatank
vpeopleonatank / mask_rcnn_r101_rpn_handdatafull.py
Created November 13, 2020 13:40
mask-rcnn mmdetection config
# Place file config in a folder in {MMDETECTION_ROOT}/configs
_base_ = [
'../_base_/models/mask_rcnn_r50_fpn.py',
'../_base_/datasets/coco_instance.py',
'../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py'
]
# Use r101 model
model = dict(
pretrained='torchvision://resnet101',
backbone=dict(depth=101),
dataset_type = 'CocoDataset'
Classes = ('Hand')
data_root = 'data/handdata/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(
type='LoadAnnotations', with_bbox=True, with_mask=True, with_seg=False),
dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
@vpeopleonatank
vpeopleonatank / i3-gaps_installation_guide.md
Created December 12, 2018 07:19 — forked from boreycutts/i3-gaps_installation_guide.md
A simple installation guide for i3-gaps

Installing i3-gaps

Dependencies

i3-gaps has some packages that are required for it to work so install these things:

sudo apt install libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev libtool 

You also need to install libxcb-xrm-dev, but I got Unable to locate package libxcb-xrm-dev when trying to install from the apt repositories on Ubuntu 16.04. If this happens to you, just install it from source using these commands:

mkdir tmp
@vpeopleonatank
vpeopleonatank / cloudSettings
Last active November 24, 2018 13:33
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-11-24T13:33:06.172Z","extensionVersion":"v3.2.0"}