Is there any bug in file fidt_generate_jhu.py? I'm trying to train this model on JHU dataset. I noticed that the size of img is different from fidt_map. I simply add a print in file image.py like:
import scipy.spatial
from PIL import Image
import scipy.io as io
import scipy
import numpy as np
import h5py
import cv2
def load_data_fidt(img_path, args, train=True):
gt_path = img_path.replace('.jpg', '.h5').replace('images', 'gt_fidt_map_2048')
img = Image.open(img_path).convert('RGB')
while True:
try:
gt_file = h5py.File(gt_path)
k = np.asarray(gt_file['kpoint'])
fidt_map = np.asarray(gt_file['fidt_map'])
break
except OSError:
print("path is wrong, can not load ", img_path)
cv2.waitKey(1000) # Wait a bit
img = img.copy()
fidt_map = fidt_map.copy()
k = k.copy()
print(img.size, fidt_map.shape) # here
return img, fidt_map, k
Is there any bug in file
fidt_generate_jhu.py
? I'm trying to train this model on JHU dataset. I noticed that the size ofimg
is different fromfidt_map
. I simply add aprint
in fileimage.py
like:The output shows some difference like:
I try to train the model on ShanghaiA dataset and It works fine.