Skip to content

Instantly share code, notes, and snippets.

View HassankSalim's full-sized avatar
💭
Always looking for interesting work and tech

Hassan K Salim HassankSalim

💭
Always looking for interesting work and tech
View GitHub Profile
function im_density = get_density_map_gaussian(im,points)
pkg load image;
im_density = zeros(size(im));
[h,w] = size(im_density);
if(length(points)==0)
return;
end
pkg load image;
function im_density = get_density_map_gaussian(im,points)
im_density = zeros(size(im));
[h,w] = size(im_density);
if(length(points)==0)
return;
import os
import torch
import numpy as np
from src.crowd_count import CrowdCounter
from src import network
from src.data_loader import ImageDataLoader
from src import utils
torch.backends.cudnn.enabled = True
import torch
import torch.nn as nn
import torch.nn.functional as F
import src.network as network
from src.models import CMTL
class CrowdCounter(nn.Module):
def __init__(self, ce_weights=None):
super(CrowdCounter, self).__init__()
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.network import Conv2d, FC
import numpy as np
import cv2
import os
import random
import pandas as pd
import sys
class ImageDataLoader():
def __init__(self, data_path, gt_path, shuffle=False, gt_downsample=False, pre_load=False, num_classes=10):
#pre_load: if true, all training and validation images are loaded into CPU RAM for faster processing.
import re
# Custom grep
grep = lambda lib, regex : filter(lambda x : re.search(regex, x), dir(lib))
# Usage
# input: list(grep(bson, 'deco'))
# result: ['_utf_8_decode', 'decode_all', 'decode_file_iter', 'decode_iter']
# input: list(grep(numpy, '^a.*y$'))
# result: ['any', 'array', 'asanyarray', 'asarray', 'ascontiguousarray', 'asfarray', 'asfortranarray']
select * from pg_stat_activity where (state = 'idle in transaction') and xact_start is not null;
rosbag info --yaml --key=types[0].type 2020-07-15-11-29-48.bag