Skip to content

Instantly share code, notes, and snippets.

💭
Always looking for interesting work and tech

Hassan K Salim HassankSalim

💭
Always looking for interesting work and tech
Block or report user

Report or block HassankSalim

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View create_gt_test_set_shtech.m
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;
View get_density_map_gaussian.m
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
View models.py
#!/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
View data_loader.py
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.
View crowd_count.py
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__()
View test.py
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
View custom_util_python_function.py
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']
View getting_data_tp_link.py
You can’t perform that action at this time.