Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion generate_density_map/same_gaussian_kernel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import numpy as np
from scipy.io import loadmat


def generate_density_map_with_fixed_kernel(img,points,kernel_size=15,sigma=4.0):
Expand Down Expand Up @@ -54,7 +55,7 @@ def guassian_kernel(size,sigma):
img_path="D:\workspace\ShanghaiTech_dataset\part_A_final/test_data\images\IMG_8.jpg"
img=plt.imread(img_path)
plt.imshow(img)
mat = io.loadmat(img_path.replace('.jpg','.mat').replace('images','ground_truth').replace('IMG_','GT_IMG_'))
mat = loadmat(img_path.replace('.jpg','.mat').replace('images','ground_truth').replace('IMG_','GT_IMG_'))
pts = mat["image_info"][0,0][0,0][0] #1546person*2(col,row)
points=[]
for p in pts:
Expand Down