I tried to modify the code at ./dataset/ct/ct_tt.py to work with a custom dataset.
the dataset stores the ground truth polygons as a json file for each image.
sample json:
def get_ann(img, gt_path):
h, w = img.shape[0:2]
bboxes = []
words = []
with open(gt_path,'r') as f:
conts = [np.int0(c).reshape(-1,2) for c in json.load(f)]
for cont in conts:
numpoints = cont.shape[0]
c= cont.reshape(-1) / ([w * 1.0, h * 1.0] * numpoints)
bboxes.append(c)
words.append('###')
return bboxes, words
also modified the init function of the CT_TT class to get the new img_paths and gt_paths.
and didn't modify anything else.
but with training, the loss doesn't decrease below 0.9 !
I tried to modify the code at
./dataset/ct/ct_tt.py
to work with a custom dataset. the dataset stores the ground truth polygons as a json file for each image. sample json:here's the
get_ann
functionalso modified the init function of the
CT_TT
class to get the newimg_paths
andgt_paths
. and didn't modify anything else. but with training, the loss doesn't decrease below 0.9 !