diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1b05740 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +__pycache__/ diff --git a/README.md b/README.md index 0952c5d..f353cf0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,25 @@ # DeepHoughTransform Add training codes into Hanqer/deep-hough-transform. + +### Brief +- Since there are no training codes in the original repo, I decided to add some training codes. +- I considered to use the architecture of deep-hough-transform to train on my own task. The task is not actually similar to the task of `Semantic Line Detection`. +- This repo is just an attempt of writing the training codes. No plan to open my dataset or evaluate the model. +- _(In Chinese):_ 这条用中文再啰嗦叙述一下,因为我个人目前的工作想要考虑看一下这个deep hough transform的方法能不能用在我的数据集上,但是他这个没有训练代码啊,自己试着写一下,不保证准确率那些。 +- 多说一句,看代码的时候我发现trainset的设置(数据读取、transform)作者闭源了,另外label和loss计算也都闭源了,所以我考虑这两个点是有比较重点的tricks。 + +### Requirements +- Developed under `Pytorch1.3 Python3.6` + + +### Remarks +- (这段用中文记录一下复写的记录,后面可能会整理出一篇博客把作者的工作分析一下,另外补充一下代码实现细节) +- 截止目前为止(9/11/2020),训练代码没有开源,除了网络结构之外,能够分析一下前后处理的就是forward.py脚本 +``` +key_points = model(images) +``` +说明模型前向输出的是这个keypoints + +### TODOs +- Not finished yet + diff --git a/READMEori.md b/READMEori.md new file mode 100755 index 0000000..262b001 --- /dev/null +++ b/READMEori.md @@ -0,0 +1,39 @@ +### Difference (Written by Una 07/31/2020) +- Add train codes (uses CrossEntropy according to the paper) +- "AverageMeter" refer to [InnovArul/pytorch_utils](https://github.com/InnovArul/pytorch_utils/blob/c58115a88f4ad90bdb2f69f85998cdc0fa43831b/generic/avgmeter.py) + +--- +Code for paper "Deep Hough Transform for Semantic Line Detection" (ECCV2020). +### Deep Hough Transform +![pipeline](./pipeline.png) +### Requirements +``` +numpy +scipy +opencv-python +scikit-image +pytorch>=1.0 +torchvision +tqdm +yml +deep-hough +``` + +To install deep-hough, run the following commands. +```sh +cd deep-hough-transform +cd model/_cdht +python setup.py build +python setup.py install --user +``` +Pretrain model (based on ResNet50-FPN): https://drive.google.com/file/d/1a6Rbu1Bslyo9sjNlUUdi7NnSTdRIWwS5/view?usp=sharing +### Forward +Generate visualization results and save coordinates to _.npy file. +```sh +CUDA_VISIBLE_DEVICES=0 python forward.py --model (your_best_model.pth) --tmp (your_result_save_dir) +``` +### Test +Test the EA-score on SEL dataset. After forwarding the model and get the coordinates files. Run the following command to produce EA-score. +```sh +python test.py --pred result/debug/visualize_test/(change to your onw path which includes _.npy files) --gt gt_path/include_txt +``` diff --git a/basic_ops.py b/basic_ops.py new file mode 100755 index 0000000..5a83c3b --- /dev/null +++ b/basic_ops.py @@ -0,0 +1,85 @@ +import cv2 +import numpy as np + +class Line(object): + def __init__(self, coordinates=[0, 0, 1, 1]): + """ + coordinates: [y0, x0, y1, x1] + """ + assert isinstance(coordinates, list) + assert len(coordinates) == 4 + assert coordinates[0]!=coordinates[2] or coordinates[1]!=coordinates[3] + self.__coordinates = coordinates + + @property + def coord(self): + return self.__coordinates + + @property + def length(self): + start = np.array(self.coord[:2]) + end = np.array(self.coord[2::]) + return np.sqrt(((start - end) ** 2).sum()) + + def angle(self): + y0, x0, y1, x1 = self.coord + if x0 == x1: + return -np.pi / 2 + return np.arctan((y0-y1) / (x0-x1)) + + def rescale(self, rh, rw): + coor = np.array(self.__coordinates) + r = np.array([rh, rw, rh, rw]) + self.__coordinates = np.round(coor * r).astype(np.int).tolist() + + def __repr__(self): + return str(self.coord) + + +def get_boundary_point(y, x, angle, H, W): + ''' + Given point y,x with angle, return a two point in image boundary with shape [H, W] + return point:[x, y] + ''' + point1 = None + point2 = None + + if angle == -np.pi / 2: + point1 = (x, 0) + point2 = (x, H-1) + elif angle == 0.0: + point1 = (0, y) + point2 = (W-1, y) + else: + k = np.tan(angle) + if y-k*x >=0 and y-k*x < H: #left + if point1 == None: + point1 = (0, int(y-k*x)) + elif point2 == None: + point2 = (0, int(y-k*x)) + if point2 == point1: point2 = None + # print(point1, point2) + if k*(W-1)+y-k*x >= 0 and k*(W-1)+y-k*x < H: #right + if point1 == None: + point1 = (W-1, int(k*(W-1)+y-k*x)) + elif point2 == None: + point2 = (W-1, int(k*(W-1)+y-k*x)) + if point2 == point1: point2 = None + # print(point1, point2) + if x-y/k >= 0 and x-y/k < W: #top + if point1 == None: + point1 = (int(x-y/k), 0) + elif point2 == None: + point2 = (int(x-y/k), 0) + if point2 == point1: point2 = None + # print(point1, point2) + if x-y/k+(H-1)/k >= 0 and x-y/k+(H-1)/k < W: #bottom + if point1 == None: + point1 = (int(x-y/k+(H-1)/k), H-1) + elif point2 == None: + point2 = (int(x-y/k+(H-1)/k), H-1) + if point2 == point1: point2 = None + # print(int(x-y/k+(H-1)/k), H-1) + if point2 == None : point2 = point1 + return point1, point2 + diff --git a/data/SEL_dataset/test_gt/0015.txt b/data/SEL_dataset/test_gt/0015.txt new file mode 100755 index 0000000..8c1736f --- /dev/null +++ b/data/SEL_dataset/test_gt/0015.txt @@ -0,0 +1,2 @@ +1.0, 203.4, 400.0, 285.0, 400.0, 400.0 +1.0, 179.0, 400.0, 190.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0015new.txt b/data/SEL_dataset/test_gt/0015new.txt new file mode 100644 index 0000000..8c1736f --- /dev/null +++ b/data/SEL_dataset/test_gt/0015new.txt @@ -0,0 +1,2 @@ +1.0, 203.4, 400.0, 285.0, 400.0, 400.0 +1.0, 179.0, 400.0, 190.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0033.txt b/data/SEL_dataset/test_gt/0033.txt new file mode 100755 index 0000000..d2b617c --- /dev/null +++ b/data/SEL_dataset/test_gt/0033.txt @@ -0,0 +1 @@ +1.0, 270.9, 400.0, 148.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0033new.txt b/data/SEL_dataset/test_gt/0033new.txt new file mode 100644 index 0000000..d2b617c --- /dev/null +++ b/data/SEL_dataset/test_gt/0033new.txt @@ -0,0 +1 @@ +1.0, 270.9, 400.0, 148.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0046.txt b/data/SEL_dataset/test_gt/0046.txt new file mode 100755 index 0000000..56de6e3 --- /dev/null +++ b/data/SEL_dataset/test_gt/0046.txt @@ -0,0 +1,3 @@ +1.0, 166.9, 400.0, 184.7, 400.0, 400.0 +1.0, 197.0, 400.0, 197.0, 400.0, 400.0 +1.0, 227.2, 400.0, 237.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0046new.txt b/data/SEL_dataset/test_gt/0046new.txt new file mode 100644 index 0000000..56de6e3 --- /dev/null +++ b/data/SEL_dataset/test_gt/0046new.txt @@ -0,0 +1,3 @@ +1.0, 166.9, 400.0, 184.7, 400.0, 400.0 +1.0, 197.0, 400.0, 197.0, 400.0, 400.0 +1.0, 227.2, 400.0, 237.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0058.txt b/data/SEL_dataset/test_gt/0058.txt new file mode 100755 index 0000000..d8274d0 --- /dev/null +++ b/data/SEL_dataset/test_gt/0058.txt @@ -0,0 +1,4 @@ +1.0, 145.9, 400.0, 92.6, 400.0, 400.0 +1.0, 161.8, 400.0, 188.2, 400.0, 400.0 +1.0, 94.5, 400.0, 66.9, 400.0, 400.0 +1.0, 239.0, 400.0, 197.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0058new.txt b/data/SEL_dataset/test_gt/0058new.txt new file mode 100644 index 0000000..d8274d0 --- /dev/null +++ b/data/SEL_dataset/test_gt/0058new.txt @@ -0,0 +1,4 @@ +1.0, 145.9, 400.0, 92.6, 400.0, 400.0 +1.0, 161.8, 400.0, 188.2, 400.0, 400.0 +1.0, 94.5, 400.0, 66.9, 400.0, 400.0 +1.0, 239.0, 400.0, 197.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0092.txt b/data/SEL_dataset/test_gt/0092.txt new file mode 100755 index 0000000..3cd28a1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0092.txt @@ -0,0 +1 @@ +1.0, 307.7, 400.0, 27.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0092new.txt b/data/SEL_dataset/test_gt/0092new.txt new file mode 100644 index 0000000..3cd28a1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0092new.txt @@ -0,0 +1 @@ +1.0, 307.7, 400.0, 27.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0095.txt b/data/SEL_dataset/test_gt/0095.txt new file mode 100755 index 0000000..5d2a8cc --- /dev/null +++ b/data/SEL_dataset/test_gt/0095.txt @@ -0,0 +1 @@ +1.0, 93.7, 400.0, 270.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0095new.txt b/data/SEL_dataset/test_gt/0095new.txt new file mode 100644 index 0000000..5d2a8cc --- /dev/null +++ b/data/SEL_dataset/test_gt/0095new.txt @@ -0,0 +1 @@ +1.0, 93.7, 400.0, 270.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0107.txt b/data/SEL_dataset/test_gt/0107.txt new file mode 100755 index 0000000..70b2231 --- /dev/null +++ b/data/SEL_dataset/test_gt/0107.txt @@ -0,0 +1 @@ +1.0, 145.0, 400.0, 145.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0107new.txt b/data/SEL_dataset/test_gt/0107new.txt new file mode 100644 index 0000000..70b2231 --- /dev/null +++ b/data/SEL_dataset/test_gt/0107new.txt @@ -0,0 +1 @@ +1.0, 145.0, 400.0, 145.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0111.txt b/data/SEL_dataset/test_gt/0111.txt new file mode 100755 index 0000000..c71fb56 --- /dev/null +++ b/data/SEL_dataset/test_gt/0111.txt @@ -0,0 +1 @@ +1.0, 183.5, 400.0, 114.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0111new.txt b/data/SEL_dataset/test_gt/0111new.txt new file mode 100644 index 0000000..c71fb56 --- /dev/null +++ b/data/SEL_dataset/test_gt/0111new.txt @@ -0,0 +1 @@ +1.0, 183.5, 400.0, 114.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0114.txt b/data/SEL_dataset/test_gt/0114.txt new file mode 100755 index 0000000..adca280 --- /dev/null +++ b/data/SEL_dataset/test_gt/0114.txt @@ -0,0 +1,3 @@ +1.0, 193.7, 400.0, 198.1, 400.0, 400.0 +1.0, 244.4, 400.0, 257.2, 400.0, 400.0 +1.0, 330.4, 400.0, 366.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0114new.txt b/data/SEL_dataset/test_gt/0114new.txt new file mode 100644 index 0000000..adca280 --- /dev/null +++ b/data/SEL_dataset/test_gt/0114new.txt @@ -0,0 +1,3 @@ +1.0, 193.7, 400.0, 198.1, 400.0, 400.0 +1.0, 244.4, 400.0, 257.2, 400.0, 400.0 +1.0, 330.4, 400.0, 366.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0150.txt b/data/SEL_dataset/test_gt/0150.txt new file mode 100755 index 0000000..1960296 --- /dev/null +++ b/data/SEL_dataset/test_gt/0150.txt @@ -0,0 +1,2 @@ +1.0, 165.7, 400.0, 297.6, 400.0, 400.0 +1.0, 379.0, 400.0, 374.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0153.txt b/data/SEL_dataset/test_gt/0153.txt new file mode 100755 index 0000000..b1be591 --- /dev/null +++ b/data/SEL_dataset/test_gt/0153.txt @@ -0,0 +1,2 @@ +1.0, 253.9, 400.0, 258.0, 400.0, 400.0 +1.0, 295.8, 400.0, 323.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0198.txt b/data/SEL_dataset/test_gt/0198.txt new file mode 100755 index 0000000..4488bf6 --- /dev/null +++ b/data/SEL_dataset/test_gt/0198.txt @@ -0,0 +1 @@ +1.0, 339.0, 400.0, 71.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0199.txt b/data/SEL_dataset/test_gt/0199.txt new file mode 100755 index 0000000..2ec4429 --- /dev/null +++ b/data/SEL_dataset/test_gt/0199.txt @@ -0,0 +1,2 @@ +1.0, 208.1, 400.0, 203.0, 400.0, 400.0 +1.0, 146.1, 400.0, 38.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0215.txt b/data/SEL_dataset/test_gt/0215.txt new file mode 100755 index 0000000..ffe2a88 --- /dev/null +++ b/data/SEL_dataset/test_gt/0215.txt @@ -0,0 +1,2 @@ +1.0, 266.4, 400.0, 244.0, 400.0, 400.0 +1.0, 340.4, 400.0, 316.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0220.txt b/data/SEL_dataset/test_gt/0220.txt new file mode 100755 index 0000000..1c7dfcf --- /dev/null +++ b/data/SEL_dataset/test_gt/0220.txt @@ -0,0 +1 @@ +1.0, 124.5, 400.0, 116.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0239.txt b/data/SEL_dataset/test_gt/0239.txt new file mode 100755 index 0000000..55eb8d6 --- /dev/null +++ b/data/SEL_dataset/test_gt/0239.txt @@ -0,0 +1,2 @@ +1.0, 294.0, 393.7, 1.0, 400.0, 400.0 +1.0, 310.2, 400.0, 68.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0251.txt b/data/SEL_dataset/test_gt/0251.txt new file mode 100755 index 0000000..7e1bd54 --- /dev/null +++ b/data/SEL_dataset/test_gt/0251.txt @@ -0,0 +1 @@ +1.0, 116.0, 400.0, 116.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0283.txt b/data/SEL_dataset/test_gt/0283.txt new file mode 100755 index 0000000..3cb7fb8 --- /dev/null +++ b/data/SEL_dataset/test_gt/0283.txt @@ -0,0 +1 @@ +1.0, 206.4, 400.0, 218.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0286.txt b/data/SEL_dataset/test_gt/0286.txt new file mode 100755 index 0000000..2057cf4 --- /dev/null +++ b/data/SEL_dataset/test_gt/0286.txt @@ -0,0 +1,2 @@ +1.0, 295.8, 400.0, 20.6, 400.0, 400.0 +1.0, 208.2, 400.0, 84.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0311.txt b/data/SEL_dataset/test_gt/0311.txt new file mode 100755 index 0000000..55b33c8 --- /dev/null +++ b/data/SEL_dataset/test_gt/0311.txt @@ -0,0 +1 @@ +1.0, 173.0, 400.0, 173.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0315.txt b/data/SEL_dataset/test_gt/0315.txt new file mode 100755 index 0000000..051b8f4 --- /dev/null +++ b/data/SEL_dataset/test_gt/0315.txt @@ -0,0 +1 @@ +1.0, 305.0, 400.0, 200.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0319.txt b/data/SEL_dataset/test_gt/0319.txt new file mode 100755 index 0000000..7157011 --- /dev/null +++ b/data/SEL_dataset/test_gt/0319.txt @@ -0,0 +1,3 @@ +1.0, 257.5, 400.0, 228.9, 400.0, 400.0 +1.0, 28.5, 400.0, 126.8, 400.0, 400.0 +1.0, 268.5, 400.0, 289.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0333.txt b/data/SEL_dataset/test_gt/0333.txt new file mode 100755 index 0000000..2946c64 --- /dev/null +++ b/data/SEL_dataset/test_gt/0333.txt @@ -0,0 +1 @@ +1.0, 256.9, 400.0, 260.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0342.txt b/data/SEL_dataset/test_gt/0342.txt new file mode 100755 index 0000000..3cb10d8 --- /dev/null +++ b/data/SEL_dataset/test_gt/0342.txt @@ -0,0 +1,2 @@ +1.0, 134.9, 400.0, 141.0, 400.0, 400.0 +1.0, 128.5, 400.0, 98.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0348.txt b/data/SEL_dataset/test_gt/0348.txt new file mode 100755 index 0000000..52d2152 --- /dev/null +++ b/data/SEL_dataset/test_gt/0348.txt @@ -0,0 +1 @@ +1.0, 180.8, 400.0, 211.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0351.txt b/data/SEL_dataset/test_gt/0351.txt new file mode 100755 index 0000000..fcc3fa5 --- /dev/null +++ b/data/SEL_dataset/test_gt/0351.txt @@ -0,0 +1,2 @@ +1.0, 111.9, 400.0, 137.5, 400.0, 400.0 +1.0, 309.9, 400.0, 287.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0353.txt b/data/SEL_dataset/test_gt/0353.txt new file mode 100755 index 0000000..9a52869 --- /dev/null +++ b/data/SEL_dataset/test_gt/0353.txt @@ -0,0 +1,2 @@ +1.0, 274.9, 400.0, 248.0, 400.0, 400.0 +1.0, 305.0, 400.0, 305.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0357.txt b/data/SEL_dataset/test_gt/0357.txt new file mode 100755 index 0000000..7160db1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0357.txt @@ -0,0 +1,2 @@ +1.0, 232.7, 400.0, 183.3, 400.0, 400.0 +1.0, 263.9, 400.0, 235.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0378.txt b/data/SEL_dataset/test_gt/0378.txt new file mode 100755 index 0000000..c66830d --- /dev/null +++ b/data/SEL_dataset/test_gt/0378.txt @@ -0,0 +1 @@ +1.0, 309.2, 295.2, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0393.txt b/data/SEL_dataset/test_gt/0393.txt new file mode 100755 index 0000000..6107851 --- /dev/null +++ b/data/SEL_dataset/test_gt/0393.txt @@ -0,0 +1 @@ +1.0, 287.4, 400.0, 282.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0399.txt b/data/SEL_dataset/test_gt/0399.txt new file mode 100755 index 0000000..754006c --- /dev/null +++ b/data/SEL_dataset/test_gt/0399.txt @@ -0,0 +1,3 @@ +1.0, 156.1, 400.0, 112.8, 400.0, 400.0 +1.0, 207.3, 400.0, 233.3, 400.0, 400.0 +1.0, 286.4, 400.0, 322.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0400.txt b/data/SEL_dataset/test_gt/0400.txt new file mode 100755 index 0000000..f4ecc8a --- /dev/null +++ b/data/SEL_dataset/test_gt/0400.txt @@ -0,0 +1,2 @@ +1.0, 285.4, 400.0, 261.3, 400.0, 400.0 +1.0, 381.7, 400.0, 359.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0416.txt b/data/SEL_dataset/test_gt/0416.txt new file mode 100755 index 0000000..b72e713 --- /dev/null +++ b/data/SEL_dataset/test_gt/0416.txt @@ -0,0 +1 @@ +1.0, 239.5, 400.0, 193.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0432.txt b/data/SEL_dataset/test_gt/0432.txt new file mode 100755 index 0000000..3bbfbb6 --- /dev/null +++ b/data/SEL_dataset/test_gt/0432.txt @@ -0,0 +1 @@ +1.0, 231.5, 400.0, 217.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0435.txt b/data/SEL_dataset/test_gt/0435.txt new file mode 100755 index 0000000..bcc94b1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0435.txt @@ -0,0 +1,3 @@ +1.0, 303.3, 400.0, 239.7, 400.0, 400.0 +1.0, 133.0, 400.0, 133.0, 400.0, 400.0 +1.0, 98.4, 400.0, 117.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0445.txt b/data/SEL_dataset/test_gt/0445.txt new file mode 100755 index 0000000..c44e464 --- /dev/null +++ b/data/SEL_dataset/test_gt/0445.txt @@ -0,0 +1,2 @@ +1.0, 225.5, 400.0, 178.6, 400.0, 400.0 +1.0, 239.0, 400.0, 239.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0460.txt b/data/SEL_dataset/test_gt/0460.txt new file mode 100755 index 0000000..a6c8ebf --- /dev/null +++ b/data/SEL_dataset/test_gt/0460.txt @@ -0,0 +1,4 @@ +1.0, 247.6, 400.0, 285.0, 400.0, 400.0 +1.0, 205.0, 400.0, 205.0, 400.0, 400.0 +1.0, 17.3, 400.0, 303.4, 400.0, 400.0 +1.0, 159.6, 400.0, 125.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0461.txt b/data/SEL_dataset/test_gt/0461.txt new file mode 100755 index 0000000..dcb49f8 --- /dev/null +++ b/data/SEL_dataset/test_gt/0461.txt @@ -0,0 +1,3 @@ +1.0, 213.1, 400.0, 207.7, 400.0, 400.0 +1.0, 85.2, 400.0, 156.8, 400.0, 400.0 +1.0, 337.9, 400.0, 248.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0492.txt b/data/SEL_dataset/test_gt/0492.txt new file mode 100755 index 0000000..7848d18 --- /dev/null +++ b/data/SEL_dataset/test_gt/0492.txt @@ -0,0 +1,3 @@ +1.0, 119.6, 400.0, 85.7, 400.0, 400.0 +1.0, 214.2, 400.0, 235.3, 400.0, 400.0 +1.0, 302.5, 400.0, 390.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0498.txt b/data/SEL_dataset/test_gt/0498.txt new file mode 100755 index 0000000..26048f1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0498.txt @@ -0,0 +1,5 @@ +1.0, 345.5, 400.0, 309.0, 400.0, 400.0 +1.0, 273.4, 400.0, 266.9, 400.0, 400.0 +1.0, 236.0, 400.0, 236.0, 400.0, 400.0 +1.0, 192.0, 400.0, 192.0, 400.0, 400.0 +1.0, 119.5, 400.0, 152.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0499.txt b/data/SEL_dataset/test_gt/0499.txt new file mode 100755 index 0000000..9d72ed4 --- /dev/null +++ b/data/SEL_dataset/test_gt/0499.txt @@ -0,0 +1,2 @@ +1.0, 267.0, 400.0, 267.0, 400.0, 400.0 +1.0, 286.0, 400.0, 290.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0500.txt b/data/SEL_dataset/test_gt/0500.txt new file mode 100755 index 0000000..1936368 --- /dev/null +++ b/data/SEL_dataset/test_gt/0500.txt @@ -0,0 +1 @@ +1.0, 299.0, 400.0, 299.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0505.txt b/data/SEL_dataset/test_gt/0505.txt new file mode 100755 index 0000000..a2d1780 --- /dev/null +++ b/data/SEL_dataset/test_gt/0505.txt @@ -0,0 +1 @@ +1.0, 215.0, 400.0, 215.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0511.txt b/data/SEL_dataset/test_gt/0511.txt new file mode 100755 index 0000000..bf6bbc7 --- /dev/null +++ b/data/SEL_dataset/test_gt/0511.txt @@ -0,0 +1 @@ +1.0, 300.6, 400.0, 310.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0519.txt b/data/SEL_dataset/test_gt/0519.txt new file mode 100755 index 0000000..f7b4f93 --- /dev/null +++ b/data/SEL_dataset/test_gt/0519.txt @@ -0,0 +1,2 @@ +1.0, 254.0, 400.0, 216.7, 400.0, 400.0 +1.0, 308.9, 400.0, 276.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0538.txt b/data/SEL_dataset/test_gt/0538.txt new file mode 100755 index 0000000..8e8bc3c --- /dev/null +++ b/data/SEL_dataset/test_gt/0538.txt @@ -0,0 +1,2 @@ +1.0, 305.9, 400.0, 134.9, 400.0, 400.0 +1.0, 353.9, 400.0, 181.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0541.txt b/data/SEL_dataset/test_gt/0541.txt new file mode 100755 index 0000000..ada5a8f --- /dev/null +++ b/data/SEL_dataset/test_gt/0541.txt @@ -0,0 +1 @@ +1.0, 276.1, 299.7, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0548.txt b/data/SEL_dataset/test_gt/0548.txt new file mode 100755 index 0000000..c9209c3 --- /dev/null +++ b/data/SEL_dataset/test_gt/0548.txt @@ -0,0 +1 @@ +1.0, 178.5, 400.0, 219.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0588.txt b/data/SEL_dataset/test_gt/0588.txt new file mode 100755 index 0000000..39c629d --- /dev/null +++ b/data/SEL_dataset/test_gt/0588.txt @@ -0,0 +1 @@ +1.0, 309.3, 400.0, 289.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0603.txt b/data/SEL_dataset/test_gt/0603.txt new file mode 100755 index 0000000..53c6894 --- /dev/null +++ b/data/SEL_dataset/test_gt/0603.txt @@ -0,0 +1 @@ +1.0, 154.6, 400.0, 260.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0609.txt b/data/SEL_dataset/test_gt/0609.txt new file mode 100755 index 0000000..869ae44 --- /dev/null +++ b/data/SEL_dataset/test_gt/0609.txt @@ -0,0 +1 @@ +1.0, 319.3, 400.0, 85.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0625.txt b/data/SEL_dataset/test_gt/0625.txt new file mode 100755 index 0000000..3739cb4 --- /dev/null +++ b/data/SEL_dataset/test_gt/0625.txt @@ -0,0 +1,2 @@ +1.0, 194.1, 400.0, 187.9, 400.0, 400.0 +1.0, 107.3, 400.0, 149.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0628.txt b/data/SEL_dataset/test_gt/0628.txt new file mode 100755 index 0000000..0c81324 --- /dev/null +++ b/data/SEL_dataset/test_gt/0628.txt @@ -0,0 +1 @@ +1.0, 136.3, 400.0, 95.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0638.txt b/data/SEL_dataset/test_gt/0638.txt new file mode 100755 index 0000000..8dbbce0 --- /dev/null +++ b/data/SEL_dataset/test_gt/0638.txt @@ -0,0 +1 @@ +1.0, 353.9, 400.0, 360.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0639.txt b/data/SEL_dataset/test_gt/0639.txt new file mode 100755 index 0000000..e6af0f1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0639.txt @@ -0,0 +1,2 @@ +1.0, 302.9, 400.0, 308.2, 400.0, 400.0 +1.0, 333.0, 400.0, 339.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0640.txt b/data/SEL_dataset/test_gt/0640.txt new file mode 100755 index 0000000..98f94f1 --- /dev/null +++ b/data/SEL_dataset/test_gt/0640.txt @@ -0,0 +1,2 @@ +1.0, 155.5, 400.0, 136.5, 400.0, 400.0 +1.0, 89.0, 400.0, 121.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0646.txt b/data/SEL_dataset/test_gt/0646.txt new file mode 100755 index 0000000..701ca21 --- /dev/null +++ b/data/SEL_dataset/test_gt/0646.txt @@ -0,0 +1,3 @@ +1.0, 215.1, 400.0, 202.7, 400.0, 400.0 +1.0, 253.0, 400.0, 365.3, 400.0, 400.0 +1.0, 111.3, 400.0, 265.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0647.txt b/data/SEL_dataset/test_gt/0647.txt new file mode 100755 index 0000000..709aa8b --- /dev/null +++ b/data/SEL_dataset/test_gt/0647.txt @@ -0,0 +1 @@ +1.0, 159.1, 400.0, 155.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0648.txt b/data/SEL_dataset/test_gt/0648.txt new file mode 100755 index 0000000..001b461 --- /dev/null +++ b/data/SEL_dataset/test_gt/0648.txt @@ -0,0 +1 @@ +1.0, 297.7, 400.0, 277.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0653.txt b/data/SEL_dataset/test_gt/0653.txt new file mode 100755 index 0000000..cb9c647 --- /dev/null +++ b/data/SEL_dataset/test_gt/0653.txt @@ -0,0 +1,3 @@ +1.0, 215.1, 400.0, 210.5, 400.0, 400.0 +1.0, 341.6, 400.0, 281.3, 400.0, 400.0 +1.0, 76.7, 400.0, 164.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0659.txt b/data/SEL_dataset/test_gt/0659.txt new file mode 100755 index 0000000..e515702 --- /dev/null +++ b/data/SEL_dataset/test_gt/0659.txt @@ -0,0 +1 @@ +1.0, 207.0, 400.0, 207.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0684.txt b/data/SEL_dataset/test_gt/0684.txt new file mode 100755 index 0000000..55dc909 --- /dev/null +++ b/data/SEL_dataset/test_gt/0684.txt @@ -0,0 +1 @@ +1.0, 263.5, 400.0, 281.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0685.txt b/data/SEL_dataset/test_gt/0685.txt new file mode 100755 index 0000000..8a804ee --- /dev/null +++ b/data/SEL_dataset/test_gt/0685.txt @@ -0,0 +1 @@ +1.0, 291.0, 400.0, 291.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0691.txt b/data/SEL_dataset/test_gt/0691.txt new file mode 100755 index 0000000..96e361c --- /dev/null +++ b/data/SEL_dataset/test_gt/0691.txt @@ -0,0 +1 @@ +1.0, 188.0, 400.0, 188.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0692.txt b/data/SEL_dataset/test_gt/0692.txt new file mode 100755 index 0000000..610206d --- /dev/null +++ b/data/SEL_dataset/test_gt/0692.txt @@ -0,0 +1 @@ +1.0, 176.6, 400.0, 199.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0702.txt b/data/SEL_dataset/test_gt/0702.txt new file mode 100755 index 0000000..ede6989 --- /dev/null +++ b/data/SEL_dataset/test_gt/0702.txt @@ -0,0 +1,2 @@ +1.0, 105.9, 400.0, 316.4, 400.0, 400.0 +1.0, 198.3, 400.0, 186.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0710.txt b/data/SEL_dataset/test_gt/0710.txt new file mode 100755 index 0000000..2298fcf --- /dev/null +++ b/data/SEL_dataset/test_gt/0710.txt @@ -0,0 +1 @@ +400.0, 389.1, 36.1, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0730.txt b/data/SEL_dataset/test_gt/0730.txt new file mode 100755 index 0000000..99c6fec --- /dev/null +++ b/data/SEL_dataset/test_gt/0730.txt @@ -0,0 +1,2 @@ +1.0, 269.0, 400.0, 269.0, 400.0, 400.0 +1.0, 246.1, 400.0, 242.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0743.txt b/data/SEL_dataset/test_gt/0743.txt new file mode 100755 index 0000000..9a2e77b --- /dev/null +++ b/data/SEL_dataset/test_gt/0743.txt @@ -0,0 +1,2 @@ +1.0, 340.8, 400.0, 102.6, 400.0, 400.0 +1.0, 326.3, 400.0, 239.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0745.txt b/data/SEL_dataset/test_gt/0745.txt new file mode 100755 index 0000000..deb5c64 --- /dev/null +++ b/data/SEL_dataset/test_gt/0745.txt @@ -0,0 +1 @@ +1.0, 351.9, 400.0, 361.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0756.txt b/data/SEL_dataset/test_gt/0756.txt new file mode 100755 index 0000000..5de770c --- /dev/null +++ b/data/SEL_dataset/test_gt/0756.txt @@ -0,0 +1 @@ +1.0, 359.9, 400.0, 364.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0764.txt b/data/SEL_dataset/test_gt/0764.txt new file mode 100755 index 0000000..a4717c9 --- /dev/null +++ b/data/SEL_dataset/test_gt/0764.txt @@ -0,0 +1 @@ +1.0, 97.1, 400.0, 89.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0769.txt b/data/SEL_dataset/test_gt/0769.txt new file mode 100755 index 0000000..3666edb --- /dev/null +++ b/data/SEL_dataset/test_gt/0769.txt @@ -0,0 +1,3 @@ +1.0, 279.3, 400.0, 262.4, 400.0, 400.0 +1.0, 215.0, 400.0, 215.0, 400.0, 400.0 +1.0, 85.4, 400.0, 62.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0774.txt b/data/SEL_dataset/test_gt/0774.txt new file mode 100755 index 0000000..fa95687 --- /dev/null +++ b/data/SEL_dataset/test_gt/0774.txt @@ -0,0 +1,2 @@ +1.0, 186.0, 400.0, 186.0, 400.0, 400.0 +1.0, 100.6, 400.0, 147.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0787.txt b/data/SEL_dataset/test_gt/0787.txt new file mode 100755 index 0000000..e19cc10 --- /dev/null +++ b/data/SEL_dataset/test_gt/0787.txt @@ -0,0 +1,3 @@ +1.0, 227.0, 400.0, 328.7, 400.0, 400.0 +1.0, 277.5, 169.0, 1.0, 400.0, 400.0 +1.0, 102.1, 400.0, 390.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0788.txt b/data/SEL_dataset/test_gt/0788.txt new file mode 100755 index 0000000..41a4c13 --- /dev/null +++ b/data/SEL_dataset/test_gt/0788.txt @@ -0,0 +1,2 @@ +1.0, 224.6, 400.0, 236.4, 400.0, 400.0 +1.0, 147.0, 400.0, 147.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0789.txt b/data/SEL_dataset/test_gt/0789.txt new file mode 100755 index 0000000..88debc9 --- /dev/null +++ b/data/SEL_dataset/test_gt/0789.txt @@ -0,0 +1,2 @@ +1.0, 297.4, 400.0, 48.9, 400.0, 400.0 +1.0, 348.4, 346.1, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0793.txt b/data/SEL_dataset/test_gt/0793.txt new file mode 100755 index 0000000..63c1765 --- /dev/null +++ b/data/SEL_dataset/test_gt/0793.txt @@ -0,0 +1,2 @@ +1.0, 69.3, 347.6, 400.0, 400.0, 400.0 +1.0, 95.4, 400.0, 127.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0795.txt b/data/SEL_dataset/test_gt/0795.txt new file mode 100755 index 0000000..78e81c8 --- /dev/null +++ b/data/SEL_dataset/test_gt/0795.txt @@ -0,0 +1 @@ +1.0, 268.9, 400.0, 275.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0812.txt b/data/SEL_dataset/test_gt/0812.txt new file mode 100755 index 0000000..a146490 --- /dev/null +++ b/data/SEL_dataset/test_gt/0812.txt @@ -0,0 +1,3 @@ +1.0, 129.8, 400.0, 197.9, 400.0, 400.0 +1.0, 185.3, 400.0, 237.7, 400.0, 400.0 +1.0, 371.6, 400.0, 382.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0817.txt b/data/SEL_dataset/test_gt/0817.txt new file mode 100755 index 0000000..1e1f681 --- /dev/null +++ b/data/SEL_dataset/test_gt/0817.txt @@ -0,0 +1,2 @@ +1.0, 308.0, 400.0, 308.0, 400.0, 400.0 +1.0, 339.6, 400.0, 352.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0818.txt b/data/SEL_dataset/test_gt/0818.txt new file mode 100755 index 0000000..1e3667e --- /dev/null +++ b/data/SEL_dataset/test_gt/0818.txt @@ -0,0 +1 @@ +1.0, 344.9, 400.0, 350.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0822.txt b/data/SEL_dataset/test_gt/0822.txt new file mode 100755 index 0000000..4722902 --- /dev/null +++ b/data/SEL_dataset/test_gt/0822.txt @@ -0,0 +1 @@ +1.0, 347.7, 400.0, 360.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0854.txt b/data/SEL_dataset/test_gt/0854.txt new file mode 100755 index 0000000..a48ac33 --- /dev/null +++ b/data/SEL_dataset/test_gt/0854.txt @@ -0,0 +1,2 @@ +1.0, 364.0, 400.0, 304.7, 400.0, 400.0 +1.0, 397.5, 400.0, 98.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0864.txt b/data/SEL_dataset/test_gt/0864.txt new file mode 100755 index 0000000..5f91c8b --- /dev/null +++ b/data/SEL_dataset/test_gt/0864.txt @@ -0,0 +1,2 @@ +1.0, 314.7, 341.0, 400.0, 400.0, 400.0 +1.0, 205.0, 400.0, 205.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0872.txt b/data/SEL_dataset/test_gt/0872.txt new file mode 100755 index 0000000..478ae78 --- /dev/null +++ b/data/SEL_dataset/test_gt/0872.txt @@ -0,0 +1,3 @@ +1.0, 284.4, 400.0, 114.0, 400.0, 400.0 +1.0, 142.8, 400.0, 290.3, 400.0, 400.0 +1.0, 211.1, 400.0, 200.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0873.txt b/data/SEL_dataset/test_gt/0873.txt new file mode 100755 index 0000000..5d8c9c8 --- /dev/null +++ b/data/SEL_dataset/test_gt/0873.txt @@ -0,0 +1,2 @@ +1.0, 113.1, 400.0, 205.5, 400.0, 400.0 +1.0, 94.1, 400.0, 80.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0879.txt b/data/SEL_dataset/test_gt/0879.txt new file mode 100755 index 0000000..fb9530c --- /dev/null +++ b/data/SEL_dataset/test_gt/0879.txt @@ -0,0 +1 @@ +1.0, 185.1, 400.0, 180.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0885.txt b/data/SEL_dataset/test_gt/0885.txt new file mode 100755 index 0000000..189e67c --- /dev/null +++ b/data/SEL_dataset/test_gt/0885.txt @@ -0,0 +1 @@ +1.0, 315.9, 400.0, 321.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0886.txt b/data/SEL_dataset/test_gt/0886.txt new file mode 100755 index 0000000..f20282f --- /dev/null +++ b/data/SEL_dataset/test_gt/0886.txt @@ -0,0 +1 @@ +1.0, 357.8, 400.0, 369.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0901.txt b/data/SEL_dataset/test_gt/0901.txt new file mode 100755 index 0000000..edf667d --- /dev/null +++ b/data/SEL_dataset/test_gt/0901.txt @@ -0,0 +1,2 @@ +1.0, 147.2, 400.0, 137.8, 400.0, 400.0 +1.0, 112.0, 400.0, 115.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0903.txt b/data/SEL_dataset/test_gt/0903.txt new file mode 100755 index 0000000..f4bc245 --- /dev/null +++ b/data/SEL_dataset/test_gt/0903.txt @@ -0,0 +1,2 @@ +1.0, 258.0, 400.0, 258.0, 400.0, 400.0 +400.0, 253.7, 52.5, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0924.txt b/data/SEL_dataset/test_gt/0924.txt new file mode 100755 index 0000000..4769793 --- /dev/null +++ b/data/SEL_dataset/test_gt/0924.txt @@ -0,0 +1 @@ +1.0, 81.9, 400.0, 88.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0941.txt b/data/SEL_dataset/test_gt/0941.txt new file mode 100755 index 0000000..5d31655 --- /dev/null +++ b/data/SEL_dataset/test_gt/0941.txt @@ -0,0 +1 @@ +1.0, 172.0, 400.0, 172.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0960.txt b/data/SEL_dataset/test_gt/0960.txt new file mode 100755 index 0000000..635ce4e --- /dev/null +++ b/data/SEL_dataset/test_gt/0960.txt @@ -0,0 +1 @@ +1.0, 74.0, 400.0, 129.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/0994.txt b/data/SEL_dataset/test_gt/0994.txt new file mode 100755 index 0000000..19fc1e9 --- /dev/null +++ b/data/SEL_dataset/test_gt/0994.txt @@ -0,0 +1 @@ +1.0, 238.5, 400.0, 177.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1010.txt b/data/SEL_dataset/test_gt/1010.txt new file mode 100755 index 0000000..1ea6255 --- /dev/null +++ b/data/SEL_dataset/test_gt/1010.txt @@ -0,0 +1 @@ +1.0, 268.6, 400.0, 96.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1022.txt b/data/SEL_dataset/test_gt/1022.txt new file mode 100755 index 0000000..1b1e89e --- /dev/null +++ b/data/SEL_dataset/test_gt/1022.txt @@ -0,0 +1,2 @@ +1.0, 77.1, 400.0, 170.1, 400.0, 400.0 +400.0, 237.2, 16.6, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1023.txt b/data/SEL_dataset/test_gt/1023.txt new file mode 100755 index 0000000..c200584 --- /dev/null +++ b/data/SEL_dataset/test_gt/1023.txt @@ -0,0 +1 @@ +1.0, 284.0, 400.0, 165.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1026.txt b/data/SEL_dataset/test_gt/1026.txt new file mode 100755 index 0000000..ebd49b0 --- /dev/null +++ b/data/SEL_dataset/test_gt/1026.txt @@ -0,0 +1,2 @@ +1.0, 215.9, 400.0, 224.2, 400.0, 400.0 +1.0, 149.4, 400.0, 208.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1044.txt b/data/SEL_dataset/test_gt/1044.txt new file mode 100755 index 0000000..ded248e --- /dev/null +++ b/data/SEL_dataset/test_gt/1044.txt @@ -0,0 +1 @@ +1.0, 216.3, 400.0, 203.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1046.txt b/data/SEL_dataset/test_gt/1046.txt new file mode 100755 index 0000000..4cea2b7 --- /dev/null +++ b/data/SEL_dataset/test_gt/1046.txt @@ -0,0 +1 @@ +1.0, 310.0, 400.0, 310.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1048.txt b/data/SEL_dataset/test_gt/1048.txt new file mode 100755 index 0000000..9eacc7a --- /dev/null +++ b/data/SEL_dataset/test_gt/1048.txt @@ -0,0 +1,2 @@ +1.0, 254.9, 400.0, 260.1, 400.0, 400.0 +1.0, 186.7, 400.0, 110.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1051.txt b/data/SEL_dataset/test_gt/1051.txt new file mode 100755 index 0000000..25dce13 --- /dev/null +++ b/data/SEL_dataset/test_gt/1051.txt @@ -0,0 +1,2 @@ +67.5, 400.0, 90.3, 1.0, 400.0, 400.0 +1.0, 280.5, 400.0, 316.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1052.txt b/data/SEL_dataset/test_gt/1052.txt new file mode 100755 index 0000000..84a2a5f --- /dev/null +++ b/data/SEL_dataset/test_gt/1052.txt @@ -0,0 +1 @@ +1.0, 188.7, 400.0, 360.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1060.txt b/data/SEL_dataset/test_gt/1060.txt new file mode 100755 index 0000000..31c8921 --- /dev/null +++ b/data/SEL_dataset/test_gt/1060.txt @@ -0,0 +1,2 @@ +1.0, 265.9, 400.0, 273.1, 400.0, 400.0 +1.0, 345.3, 400.0, 329.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1064.txt b/data/SEL_dataset/test_gt/1064.txt new file mode 100755 index 0000000..a80ff70 --- /dev/null +++ b/data/SEL_dataset/test_gt/1064.txt @@ -0,0 +1 @@ +1.0, 293.2, 400.0, 198.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1066.txt b/data/SEL_dataset/test_gt/1066.txt new file mode 100755 index 0000000..a435ded --- /dev/null +++ b/data/SEL_dataset/test_gt/1066.txt @@ -0,0 +1,2 @@ +1.0, 136.0, 400.0, 34.3, 400.0, 400.0 +1.0, 114.1, 400.0, 109.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1071.txt b/data/SEL_dataset/test_gt/1071.txt new file mode 100755 index 0000000..ce6d58d --- /dev/null +++ b/data/SEL_dataset/test_gt/1071.txt @@ -0,0 +1,3 @@ +1.0, 294.1, 400.0, 289.9, 400.0, 400.0 +1.0, 200.6, 400.0, 243.9, 400.0, 400.0 +1.0, 113.1, 400.0, 171.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1077.txt b/data/SEL_dataset/test_gt/1077.txt new file mode 100755 index 0000000..b536309 --- /dev/null +++ b/data/SEL_dataset/test_gt/1077.txt @@ -0,0 +1,2 @@ +1.0, 326.4, 400.0, 287.7, 400.0, 400.0 +1.0, 211.2, 400.0, 143.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1083.txt b/data/SEL_dataset/test_gt/1083.txt new file mode 100755 index 0000000..b1c3651 --- /dev/null +++ b/data/SEL_dataset/test_gt/1083.txt @@ -0,0 +1,2 @@ +1.0, 370.3, 400.0, 296.7, 400.0, 400.0 +1.0, 354.6, 400.0, 397.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1099.txt b/data/SEL_dataset/test_gt/1099.txt new file mode 100755 index 0000000..b51352b --- /dev/null +++ b/data/SEL_dataset/test_gt/1099.txt @@ -0,0 +1 @@ +1.0, 195.1, 400.0, 192.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1104.txt b/data/SEL_dataset/test_gt/1104.txt new file mode 100755 index 0000000..87759e0 --- /dev/null +++ b/data/SEL_dataset/test_gt/1104.txt @@ -0,0 +1,2 @@ +33.1, 400.0, 218.0, 1.0, 400.0, 400.0 +1.0, 385.3, 400.0, 357.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1113.txt b/data/SEL_dataset/test_gt/1113.txt new file mode 100755 index 0000000..35b0e6f --- /dev/null +++ b/data/SEL_dataset/test_gt/1113.txt @@ -0,0 +1 @@ +1.0, 187.7, 400.0, 207.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1118.txt b/data/SEL_dataset/test_gt/1118.txt new file mode 100755 index 0000000..23b0edf --- /dev/null +++ b/data/SEL_dataset/test_gt/1118.txt @@ -0,0 +1,2 @@ +1.0, 153.2, 400.0, 246.0, 400.0, 400.0 +1.0, 98.6, 400.0, 115.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1124.txt b/data/SEL_dataset/test_gt/1124.txt new file mode 100755 index 0000000..81bb26e --- /dev/null +++ b/data/SEL_dataset/test_gt/1124.txt @@ -0,0 +1,2 @@ +1.0, 360.2, 302.1, 1.0, 400.0, 400.0 +400.0, 252.9, 9.4, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1128.txt b/data/SEL_dataset/test_gt/1128.txt new file mode 100755 index 0000000..8a2b137 --- /dev/null +++ b/data/SEL_dataset/test_gt/1128.txt @@ -0,0 +1 @@ +400.0, 36.4, 72.6, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1130.txt b/data/SEL_dataset/test_gt/1130.txt new file mode 100755 index 0000000..9abb80d --- /dev/null +++ b/data/SEL_dataset/test_gt/1130.txt @@ -0,0 +1,2 @@ +1.0, 317.9, 400.0, 330.5, 400.0, 400.0 +1.0, 250.3, 400.0, 290.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1132.txt b/data/SEL_dataset/test_gt/1132.txt new file mode 100755 index 0000000..6b6904a --- /dev/null +++ b/data/SEL_dataset/test_gt/1132.txt @@ -0,0 +1 @@ +1.0, 299.1, 400.0, 295.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1143.txt b/data/SEL_dataset/test_gt/1143.txt new file mode 100755 index 0000000..b7cefc9 --- /dev/null +++ b/data/SEL_dataset/test_gt/1143.txt @@ -0,0 +1 @@ +1.0, 338.6, 400.0, 303.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1160.txt b/data/SEL_dataset/test_gt/1160.txt new file mode 100755 index 0000000..b16a3dc --- /dev/null +++ b/data/SEL_dataset/test_gt/1160.txt @@ -0,0 +1 @@ +1.0, 126.0, 400.0, 126.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1165.txt b/data/SEL_dataset/test_gt/1165.txt new file mode 100755 index 0000000..2de08f6 --- /dev/null +++ b/data/SEL_dataset/test_gt/1165.txt @@ -0,0 +1 @@ +1.0, 320.0, 400.0, 320.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1173.txt b/data/SEL_dataset/test_gt/1173.txt new file mode 100755 index 0000000..b4ee681 --- /dev/null +++ b/data/SEL_dataset/test_gt/1173.txt @@ -0,0 +1 @@ +1.0, 268.8, 400.0, 279.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1194.txt b/data/SEL_dataset/test_gt/1194.txt new file mode 100755 index 0000000..340ec2f --- /dev/null +++ b/data/SEL_dataset/test_gt/1194.txt @@ -0,0 +1 @@ +1.0, 289.2, 400.0, 336.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1214.txt b/data/SEL_dataset/test_gt/1214.txt new file mode 100755 index 0000000..833ea14 --- /dev/null +++ b/data/SEL_dataset/test_gt/1214.txt @@ -0,0 +1 @@ +1.0, 223.2, 400.0, 211.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1233.txt b/data/SEL_dataset/test_gt/1233.txt new file mode 100755 index 0000000..b8827d3 --- /dev/null +++ b/data/SEL_dataset/test_gt/1233.txt @@ -0,0 +1,2 @@ +1.0, 250.7, 400.0, 281.2, 400.0, 400.0 +1.0, 218.9, 400.0, 98.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1248.txt b/data/SEL_dataset/test_gt/1248.txt new file mode 100755 index 0000000..9512e77 --- /dev/null +++ b/data/SEL_dataset/test_gt/1248.txt @@ -0,0 +1 @@ +1.0, 305.3, 400.0, 289.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1268.txt b/data/SEL_dataset/test_gt/1268.txt new file mode 100755 index 0000000..d165843 --- /dev/null +++ b/data/SEL_dataset/test_gt/1268.txt @@ -0,0 +1 @@ +1.0, 114.6, 400.0, 250.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1270.txt b/data/SEL_dataset/test_gt/1270.txt new file mode 100755 index 0000000..a585109 --- /dev/null +++ b/data/SEL_dataset/test_gt/1270.txt @@ -0,0 +1,3 @@ +1.0, 193.2, 400.0, 223.5, 400.0, 400.0 +1.0, 248.0, 400.0, 248.0, 400.0, 400.0 +1.0, 297.3, 400.0, 264.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1272.txt b/data/SEL_dataset/test_gt/1272.txt new file mode 100755 index 0000000..edb73c3 --- /dev/null +++ b/data/SEL_dataset/test_gt/1272.txt @@ -0,0 +1 @@ +1.0, 287.5, 400.0, 307.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1291.txt b/data/SEL_dataset/test_gt/1291.txt new file mode 100755 index 0000000..454079f --- /dev/null +++ b/data/SEL_dataset/test_gt/1291.txt @@ -0,0 +1 @@ +1.0, 355.0, 400.0, 360.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1309.txt b/data/SEL_dataset/test_gt/1309.txt new file mode 100755 index 0000000..7d822cd --- /dev/null +++ b/data/SEL_dataset/test_gt/1309.txt @@ -0,0 +1,2 @@ +1.0, 198.0, 400.0, 198.0, 400.0, 400.0 +1.0, 163.2, 400.0, 155.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1314.txt b/data/SEL_dataset/test_gt/1314.txt new file mode 100755 index 0000000..6d39d42 --- /dev/null +++ b/data/SEL_dataset/test_gt/1314.txt @@ -0,0 +1,3 @@ +1.0, 73.2, 400.0, 306.2, 400.0, 400.0 +1.0, 192.0, 400.0, 148.1, 400.0, 400.0 +1.0, 320.7, 400.0, 333.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1320.txt b/data/SEL_dataset/test_gt/1320.txt new file mode 100755 index 0000000..452e5df --- /dev/null +++ b/data/SEL_dataset/test_gt/1320.txt @@ -0,0 +1 @@ +1.0, 324.3, 400.0, 284.7, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1330.txt b/data/SEL_dataset/test_gt/1330.txt new file mode 100755 index 0000000..2fbff07 --- /dev/null +++ b/data/SEL_dataset/test_gt/1330.txt @@ -0,0 +1,2 @@ +117.5, 400.0, 368.0, 1.0, 400.0, 400.0 +56.0, 400.0, 279.1, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1338.txt b/data/SEL_dataset/test_gt/1338.txt new file mode 100755 index 0000000..87773cd --- /dev/null +++ b/data/SEL_dataset/test_gt/1338.txt @@ -0,0 +1 @@ +1.0, 296.0, 400.0, 299.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1344.txt b/data/SEL_dataset/test_gt/1344.txt new file mode 100755 index 0000000..f49463f --- /dev/null +++ b/data/SEL_dataset/test_gt/1344.txt @@ -0,0 +1 @@ +400.0, 92.4, 230.4, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1363.txt b/data/SEL_dataset/test_gt/1363.txt new file mode 100755 index 0000000..c5c65ba --- /dev/null +++ b/data/SEL_dataset/test_gt/1363.txt @@ -0,0 +1 @@ +1.0, 346.8, 400.0, 368.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1376.txt b/data/SEL_dataset/test_gt/1376.txt new file mode 100755 index 0000000..1dea884 --- /dev/null +++ b/data/SEL_dataset/test_gt/1376.txt @@ -0,0 +1 @@ +1.0, 164.1, 400.0, 160.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1377.txt b/data/SEL_dataset/test_gt/1377.txt new file mode 100755 index 0000000..b4cc67a --- /dev/null +++ b/data/SEL_dataset/test_gt/1377.txt @@ -0,0 +1 @@ +1.0, 293.8, 400.0, 212.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1378.txt b/data/SEL_dataset/test_gt/1378.txt new file mode 100755 index 0000000..abd75a0 --- /dev/null +++ b/data/SEL_dataset/test_gt/1378.txt @@ -0,0 +1 @@ +1.0, 284.6, 400.0, 256.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1386.txt b/data/SEL_dataset/test_gt/1386.txt new file mode 100755 index 0000000..1e1eeac --- /dev/null +++ b/data/SEL_dataset/test_gt/1386.txt @@ -0,0 +1 @@ +1.0, 265.7, 400.0, 279.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1392.txt b/data/SEL_dataset/test_gt/1392.txt new file mode 100755 index 0000000..c456d84 --- /dev/null +++ b/data/SEL_dataset/test_gt/1392.txt @@ -0,0 +1 @@ +1.0, 292.4, 400.0, 149.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1394.txt b/data/SEL_dataset/test_gt/1394.txt new file mode 100755 index 0000000..37a7b7c --- /dev/null +++ b/data/SEL_dataset/test_gt/1394.txt @@ -0,0 +1 @@ +1.0, 308.9, 400.0, 314.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1397.txt b/data/SEL_dataset/test_gt/1397.txt new file mode 100755 index 0000000..360bb03 --- /dev/null +++ b/data/SEL_dataset/test_gt/1397.txt @@ -0,0 +1,2 @@ +1.0, 210.1, 400.0, 165.3, 400.0, 400.0 +1.0, 293.4, 400.0, 269.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1414.txt b/data/SEL_dataset/test_gt/1414.txt new file mode 100755 index 0000000..e2f24fd --- /dev/null +++ b/data/SEL_dataset/test_gt/1414.txt @@ -0,0 +1,2 @@ +1.0, 287.7, 400.0, 221.7, 400.0, 400.0 +1.0, 355.3, 400.0, 223.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1415.txt b/data/SEL_dataset/test_gt/1415.txt new file mode 100755 index 0000000..35df9f7 --- /dev/null +++ b/data/SEL_dataset/test_gt/1415.txt @@ -0,0 +1 @@ +51.1, 400.0, 141.5, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1419.txt b/data/SEL_dataset/test_gt/1419.txt new file mode 100755 index 0000000..989f027 --- /dev/null +++ b/data/SEL_dataset/test_gt/1419.txt @@ -0,0 +1 @@ +1.0, 108.8, 400.0, 118.2, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1427.txt b/data/SEL_dataset/test_gt/1427.txt new file mode 100755 index 0000000..423cf20 --- /dev/null +++ b/data/SEL_dataset/test_gt/1427.txt @@ -0,0 +1 @@ +1.0, 345.2, 400.0, 329.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1443.txt b/data/SEL_dataset/test_gt/1443.txt new file mode 100755 index 0000000..721a1ae --- /dev/null +++ b/data/SEL_dataset/test_gt/1443.txt @@ -0,0 +1 @@ +1.0, 228.0, 400.0, 111.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1456.txt b/data/SEL_dataset/test_gt/1456.txt new file mode 100755 index 0000000..79275b0 --- /dev/null +++ b/data/SEL_dataset/test_gt/1456.txt @@ -0,0 +1,2 @@ +1.0, 108.1, 400.0, 101.9, 400.0, 400.0 +1.0, 182.6, 400.0, 122.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1461.txt b/data/SEL_dataset/test_gt/1461.txt new file mode 100755 index 0000000..f5ce48f --- /dev/null +++ b/data/SEL_dataset/test_gt/1461.txt @@ -0,0 +1 @@ +1.0, 266.0, 400.0, 64.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1509.txt b/data/SEL_dataset/test_gt/1509.txt new file mode 100755 index 0000000..3fa9db6 --- /dev/null +++ b/data/SEL_dataset/test_gt/1509.txt @@ -0,0 +1,3 @@ +1.0, 340.0, 400.0, 343.0, 400.0, 400.0 +1.0, 314.7, 400.0, 341.9, 400.0, 400.0 +1.0, 225.5, 400.0, 194.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1514.txt b/data/SEL_dataset/test_gt/1514.txt new file mode 100755 index 0000000..32f86a9 --- /dev/null +++ b/data/SEL_dataset/test_gt/1514.txt @@ -0,0 +1 @@ +1.0, 238.1, 400.0, 287.6, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1517.txt b/data/SEL_dataset/test_gt/1517.txt new file mode 100755 index 0000000..9d7bfef --- /dev/null +++ b/data/SEL_dataset/test_gt/1517.txt @@ -0,0 +1 @@ +1.0, 140.3, 400.0, 360.1, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1521.txt b/data/SEL_dataset/test_gt/1521.txt new file mode 100755 index 0000000..5c303e3 --- /dev/null +++ b/data/SEL_dataset/test_gt/1521.txt @@ -0,0 +1,2 @@ +1.0, 351.0, 400.0, 351.0, 400.0, 400.0 +400.0, 384.2, 46.2, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1570.txt b/data/SEL_dataset/test_gt/1570.txt new file mode 100755 index 0000000..2f7024c --- /dev/null +++ b/data/SEL_dataset/test_gt/1570.txt @@ -0,0 +1,3 @@ +1.0, 224.8, 400.0, 143.8, 400.0, 400.0 +1.0, 286.9, 400.0, 293.4, 400.0, 400.0 +1.0, 336.3, 383.0, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1582.txt b/data/SEL_dataset/test_gt/1582.txt new file mode 100755 index 0000000..cb3d894 --- /dev/null +++ b/data/SEL_dataset/test_gt/1582.txt @@ -0,0 +1,2 @@ +1.0, 307.4, 400.0, 338.8, 400.0, 400.0 +117.4, 400.0, 376.4, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1588.txt b/data/SEL_dataset/test_gt/1588.txt new file mode 100755 index 0000000..f186993 --- /dev/null +++ b/data/SEL_dataset/test_gt/1588.txt @@ -0,0 +1,2 @@ +1.0, 73.2, 400.0, 383.3, 400.0, 400.0 +1.0, 14.6, 400.0, 302.8, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1648.txt b/data/SEL_dataset/test_gt/1648.txt new file mode 100755 index 0000000..bddaf21 --- /dev/null +++ b/data/SEL_dataset/test_gt/1648.txt @@ -0,0 +1,3 @@ +1.0, 124.3, 400.0, 80.8, 400.0, 400.0 +1.0, 228.7, 400.0, 201.2, 400.0, 400.0 +1.0, 228.9, 387.5, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1649.txt b/data/SEL_dataset/test_gt/1649.txt new file mode 100755 index 0000000..6d31d89 --- /dev/null +++ b/data/SEL_dataset/test_gt/1649.txt @@ -0,0 +1,3 @@ +1.0, 217.9, 400.0, 133.0, 400.0, 400.0 +1.0, 123.0, 400.0, 283.6, 400.0, 400.0 +295.0, 400.0, 158.9, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1650.txt b/data/SEL_dataset/test_gt/1650.txt new file mode 100755 index 0000000..c58a90c --- /dev/null +++ b/data/SEL_dataset/test_gt/1650.txt @@ -0,0 +1,5 @@ +1.0, 73.2, 392.6, 400.0, 400.0, 400.0 +1.0, 257.1, 400.0, 254.0, 400.0, 400.0 +400.0, 115.3, 27.1, 400.0, 400.0, 400.0 +1.0, 377.5, 400.0, 224.2, 400.0, 400.0 +375.2, 400.0, 254.3, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1651.txt b/data/SEL_dataset/test_gt/1651.txt new file mode 100755 index 0000000..3033da4 --- /dev/null +++ b/data/SEL_dataset/test_gt/1651.txt @@ -0,0 +1,3 @@ +1.0, 374.5, 400.0, 129.4, 400.0, 400.0 +296.1, 400.0, 292.9, 1.0, 400.0, 400.0 +1.0, 158.8, 400.0, 173.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1652.txt b/data/SEL_dataset/test_gt/1652.txt new file mode 100755 index 0000000..a8aa66d --- /dev/null +++ b/data/SEL_dataset/test_gt/1652.txt @@ -0,0 +1,3 @@ +1.0, 254.1, 400.0, 251.0, 400.0, 400.0 +1.0, 366.3, 400.0, 190.8, 400.0, 400.0 +1.0, 169.8, 400.0, 387.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1707.txt b/data/SEL_dataset/test_gt/1707.txt new file mode 100755 index 0000000..13d8af2 --- /dev/null +++ b/data/SEL_dataset/test_gt/1707.txt @@ -0,0 +1,2 @@ +1.0, 177.2, 400.0, 169.0, 400.0, 400.0 +400.0, 32.8, 223.1, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1708.txt b/data/SEL_dataset/test_gt/1708.txt new file mode 100755 index 0000000..8c2afbf --- /dev/null +++ b/data/SEL_dataset/test_gt/1708.txt @@ -0,0 +1,2 @@ +1.0, 151.2, 400.0, 128.2, 400.0, 400.0 +1.0, 58.5, 400.0, 385.4, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1709.txt b/data/SEL_dataset/test_gt/1709.txt new file mode 100755 index 0000000..8b258a0 --- /dev/null +++ b/data/SEL_dataset/test_gt/1709.txt @@ -0,0 +1,3 @@ +1.0, 203.1, 400.0, 198.4, 400.0, 400.0 +1.0, 336.1, 400.0, 332.9, 400.0, 400.0 +1.0, 75.3, 350.9, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1710.txt b/data/SEL_dataset/test_gt/1710.txt new file mode 100755 index 0000000..1f69624 --- /dev/null +++ b/data/SEL_dataset/test_gt/1710.txt @@ -0,0 +1,2 @@ +1.0, 137.3, 400.0, 118.9, 400.0, 400.0 +1.0, 23.0, 400.0, 80.9, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1711.txt b/data/SEL_dataset/test_gt/1711.txt new file mode 100755 index 0000000..576f7e5 --- /dev/null +++ b/data/SEL_dataset/test_gt/1711.txt @@ -0,0 +1,3 @@ +1.0, 143.7, 400.0, 221.7, 400.0, 400.0 +1.1, 400.0, 396.5, 1.0, 400.0, 400.0 +1.0, 17.1, 391.5, 400.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1712.txt b/data/SEL_dataset/test_gt/1712.txt new file mode 100755 index 0000000..52e0d26 --- /dev/null +++ b/data/SEL_dataset/test_gt/1712.txt @@ -0,0 +1,2 @@ +133.9, 400.0, 367.5, 1.0, 400.0, 400.0 +1.0, 238.2, 400.0, 229.5, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1713.txt b/data/SEL_dataset/test_gt/1713.txt new file mode 100755 index 0000000..bd48cf1 --- /dev/null +++ b/data/SEL_dataset/test_gt/1713.txt @@ -0,0 +1,3 @@ +1.0, 285.0, 400.0, 285.0, 400.0, 400.0 +1.0, 202.9, 400.0, 209.2, 400.0, 400.0 +1.0, 161.0, 400.0, 80.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1714.txt b/data/SEL_dataset/test_gt/1714.txt new file mode 100755 index 0000000..de7d03c --- /dev/null +++ b/data/SEL_dataset/test_gt/1714.txt @@ -0,0 +1,2 @@ +1.0, 187.8, 400.0, 70.2, 400.0, 400.0 +223.2, 400.0, 253.4, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1715.txt b/data/SEL_dataset/test_gt/1715.txt new file mode 100755 index 0000000..8b5ab85 --- /dev/null +++ b/data/SEL_dataset/test_gt/1715.txt @@ -0,0 +1,2 @@ +1.0, 223.2, 400.0, 215.9, 400.0, 400.0 +1.0, 21.7, 400.0, 150.3, 400.0, 400.0 diff --git a/data/SEL_dataset/test_gt/1716.txt b/data/SEL_dataset/test_gt/1716.txt new file mode 100755 index 0000000..a4312a7 --- /dev/null +++ b/data/SEL_dataset/test_gt/1716.txt @@ -0,0 +1,2 @@ +1.0, 201.0, 400.0, 198.1, 400.0, 400.0 +161.7, 400.0, 392.2, 1.0, 400.0, 400.0 diff --git a/data/SEL_dataset/test_image/0015.jpg b/data/SEL_dataset/test_image/0015.jpg new file mode 100755 index 0000000..d433e7d Binary files /dev/null and b/data/SEL_dataset/test_image/0015.jpg differ diff --git a/data/SEL_dataset/test_image/0033.jpg b/data/SEL_dataset/test_image/0033.jpg new file mode 100755 index 0000000..0cd6978 Binary files /dev/null and b/data/SEL_dataset/test_image/0033.jpg differ diff --git a/data/SEL_dataset/test_image/0046.jpg b/data/SEL_dataset/test_image/0046.jpg new file mode 100755 index 0000000..8e76010 Binary files /dev/null and b/data/SEL_dataset/test_image/0046.jpg differ diff --git a/data/SEL_dataset/test_image/0058.jpg b/data/SEL_dataset/test_image/0058.jpg new file mode 100755 index 0000000..f6c7058 Binary files /dev/null and b/data/SEL_dataset/test_image/0058.jpg differ diff --git a/data/SEL_dataset/test_image/0092.jpg b/data/SEL_dataset/test_image/0092.jpg new file mode 100755 index 0000000..a8ddbfa Binary files /dev/null and b/data/SEL_dataset/test_image/0092.jpg differ diff --git a/data/SEL_dataset/test_image/0095.jpg b/data/SEL_dataset/test_image/0095.jpg new file mode 100755 index 0000000..ad8c6ea Binary files /dev/null and b/data/SEL_dataset/test_image/0095.jpg differ diff --git a/data/SEL_dataset/test_image/0107.jpg b/data/SEL_dataset/test_image/0107.jpg new file mode 100755 index 0000000..0af80ce Binary files /dev/null and b/data/SEL_dataset/test_image/0107.jpg differ diff --git a/data/SEL_dataset/test_image/0111.jpg b/data/SEL_dataset/test_image/0111.jpg new file mode 100755 index 0000000..755795f Binary files /dev/null and b/data/SEL_dataset/test_image/0111.jpg differ diff --git a/data/SEL_dataset/test_image/0114.jpg b/data/SEL_dataset/test_image/0114.jpg new file mode 100755 index 0000000..7d9bd94 Binary files /dev/null and b/data/SEL_dataset/test_image/0114.jpg differ diff --git a/data/SEL_dataset/test_image/0150.jpg b/data/SEL_dataset/test_image/0150.jpg new file mode 100755 index 0000000..4efa81f Binary files /dev/null and b/data/SEL_dataset/test_image/0150.jpg differ diff --git a/data/SEL_dataset/test_image/0153.jpg b/data/SEL_dataset/test_image/0153.jpg new file mode 100755 index 0000000..fcd9198 Binary files /dev/null and b/data/SEL_dataset/test_image/0153.jpg differ diff --git a/data/SEL_dataset/test_image/0198.jpg b/data/SEL_dataset/test_image/0198.jpg new file mode 100755 index 0000000..e8eb494 Binary files /dev/null and b/data/SEL_dataset/test_image/0198.jpg differ diff --git a/data/SEL_dataset/test_image/0199.jpg b/data/SEL_dataset/test_image/0199.jpg new file mode 100755 index 0000000..3606424 Binary files /dev/null and b/data/SEL_dataset/test_image/0199.jpg differ diff --git a/data/SEL_dataset/test_image/0215.jpg b/data/SEL_dataset/test_image/0215.jpg new file mode 100755 index 0000000..bfc6e8a Binary files /dev/null and b/data/SEL_dataset/test_image/0215.jpg differ diff --git a/data/SEL_dataset/test_image/0220.jpg b/data/SEL_dataset/test_image/0220.jpg new file mode 100755 index 0000000..ca46a53 Binary files /dev/null and b/data/SEL_dataset/test_image/0220.jpg differ diff --git a/data/SEL_dataset/test_image/0239.jpg b/data/SEL_dataset/test_image/0239.jpg new file mode 100755 index 0000000..a565415 Binary files /dev/null and b/data/SEL_dataset/test_image/0239.jpg differ diff --git a/data/SEL_dataset/test_image/0251.jpg b/data/SEL_dataset/test_image/0251.jpg new file mode 100755 index 0000000..6779b62 Binary files /dev/null and b/data/SEL_dataset/test_image/0251.jpg differ diff --git a/data/SEL_dataset/test_image/0283.jpg b/data/SEL_dataset/test_image/0283.jpg new file mode 100755 index 0000000..4ca74e4 Binary files /dev/null and b/data/SEL_dataset/test_image/0283.jpg differ diff --git a/data/SEL_dataset/test_image/0286.jpg b/data/SEL_dataset/test_image/0286.jpg new file mode 100755 index 0000000..8c1c2bd Binary files /dev/null and b/data/SEL_dataset/test_image/0286.jpg differ diff --git a/data/SEL_dataset/test_image/0311.jpg b/data/SEL_dataset/test_image/0311.jpg new file mode 100755 index 0000000..46aecdc Binary files /dev/null and b/data/SEL_dataset/test_image/0311.jpg differ diff --git a/data/SEL_dataset/test_image/0315.jpg b/data/SEL_dataset/test_image/0315.jpg new file mode 100755 index 0000000..527626d Binary files /dev/null and b/data/SEL_dataset/test_image/0315.jpg differ diff --git a/data/SEL_dataset/test_image/0319.jpg b/data/SEL_dataset/test_image/0319.jpg new file mode 100755 index 0000000..561235d Binary files /dev/null and b/data/SEL_dataset/test_image/0319.jpg differ diff --git a/data/SEL_dataset/test_image/0333.jpg b/data/SEL_dataset/test_image/0333.jpg new file mode 100755 index 0000000..da98f47 Binary files /dev/null and b/data/SEL_dataset/test_image/0333.jpg differ diff --git a/data/SEL_dataset/test_image/0342.jpg b/data/SEL_dataset/test_image/0342.jpg new file mode 100755 index 0000000..c3aa902 Binary files /dev/null and b/data/SEL_dataset/test_image/0342.jpg differ diff --git a/data/SEL_dataset/test_image/0348.jpg b/data/SEL_dataset/test_image/0348.jpg new file mode 100755 index 0000000..f2c5bc7 Binary files /dev/null and b/data/SEL_dataset/test_image/0348.jpg differ diff --git a/data/SEL_dataset/test_image/0351.jpg b/data/SEL_dataset/test_image/0351.jpg new file mode 100755 index 0000000..97105fa Binary files /dev/null and b/data/SEL_dataset/test_image/0351.jpg differ diff --git a/data/SEL_dataset/test_image/0353.jpg b/data/SEL_dataset/test_image/0353.jpg new file mode 100755 index 0000000..9bdcae9 Binary files /dev/null and b/data/SEL_dataset/test_image/0353.jpg differ diff --git a/data/SEL_dataset/test_image/0357.jpg b/data/SEL_dataset/test_image/0357.jpg new file mode 100755 index 0000000..1507455 Binary files /dev/null and b/data/SEL_dataset/test_image/0357.jpg differ diff --git a/data/SEL_dataset/test_image/0378.jpg b/data/SEL_dataset/test_image/0378.jpg new file mode 100755 index 0000000..e341b06 Binary files /dev/null and b/data/SEL_dataset/test_image/0378.jpg differ diff --git a/data/SEL_dataset/test_image/0393.jpg b/data/SEL_dataset/test_image/0393.jpg new file mode 100755 index 0000000..5882585 Binary files /dev/null and b/data/SEL_dataset/test_image/0393.jpg differ diff --git a/data/SEL_dataset/test_image/0399.jpg b/data/SEL_dataset/test_image/0399.jpg new file mode 100755 index 0000000..5d3c19e Binary files /dev/null and b/data/SEL_dataset/test_image/0399.jpg differ diff --git a/data/SEL_dataset/test_image/0400.jpg b/data/SEL_dataset/test_image/0400.jpg new file mode 100755 index 0000000..1e4b3cf Binary files /dev/null and b/data/SEL_dataset/test_image/0400.jpg differ diff --git a/data/SEL_dataset/test_image/0416.jpg b/data/SEL_dataset/test_image/0416.jpg new file mode 100755 index 0000000..2c59edf Binary files /dev/null and b/data/SEL_dataset/test_image/0416.jpg differ diff --git a/data/SEL_dataset/test_image/0432.jpg b/data/SEL_dataset/test_image/0432.jpg new file mode 100755 index 0000000..f3ff5ea Binary files /dev/null and b/data/SEL_dataset/test_image/0432.jpg differ diff --git a/data/SEL_dataset/test_image/0435.jpg b/data/SEL_dataset/test_image/0435.jpg new file mode 100755 index 0000000..0d6dd55 Binary files /dev/null and b/data/SEL_dataset/test_image/0435.jpg differ diff --git a/data/SEL_dataset/test_image/0445.jpg b/data/SEL_dataset/test_image/0445.jpg new file mode 100755 index 0000000..374dfa0 Binary files /dev/null and b/data/SEL_dataset/test_image/0445.jpg differ diff --git a/data/SEL_dataset/test_image/0460.jpg b/data/SEL_dataset/test_image/0460.jpg new file mode 100755 index 0000000..6cc7a4b Binary files /dev/null and b/data/SEL_dataset/test_image/0460.jpg differ diff --git a/data/SEL_dataset/test_image/0461.jpg b/data/SEL_dataset/test_image/0461.jpg new file mode 100755 index 0000000..8775ce6 Binary files /dev/null and b/data/SEL_dataset/test_image/0461.jpg differ diff --git a/data/SEL_dataset/test_image/0492.jpg b/data/SEL_dataset/test_image/0492.jpg new file mode 100755 index 0000000..8730994 Binary files /dev/null and b/data/SEL_dataset/test_image/0492.jpg differ diff --git a/data/SEL_dataset/test_image/0498.jpg b/data/SEL_dataset/test_image/0498.jpg new file mode 100755 index 0000000..3c94d4d Binary files /dev/null and b/data/SEL_dataset/test_image/0498.jpg differ diff --git a/data/SEL_dataset/test_image/0499.jpg b/data/SEL_dataset/test_image/0499.jpg new file mode 100755 index 0000000..2143d83 Binary files /dev/null and b/data/SEL_dataset/test_image/0499.jpg differ diff --git a/data/SEL_dataset/test_image/0500.jpg b/data/SEL_dataset/test_image/0500.jpg new file mode 100755 index 0000000..862d40f Binary files /dev/null and b/data/SEL_dataset/test_image/0500.jpg differ diff --git a/data/SEL_dataset/test_image/0505.jpg b/data/SEL_dataset/test_image/0505.jpg new file mode 100755 index 0000000..47ba92c Binary files /dev/null and b/data/SEL_dataset/test_image/0505.jpg differ diff --git a/data/SEL_dataset/test_image/0511.jpg b/data/SEL_dataset/test_image/0511.jpg new file mode 100755 index 0000000..c418c92 Binary files /dev/null and b/data/SEL_dataset/test_image/0511.jpg differ diff --git a/data/SEL_dataset/test_image/0519.jpg b/data/SEL_dataset/test_image/0519.jpg new file mode 100755 index 0000000..261e863 Binary files /dev/null and b/data/SEL_dataset/test_image/0519.jpg differ diff --git a/data/SEL_dataset/test_image/0538.jpg b/data/SEL_dataset/test_image/0538.jpg new file mode 100755 index 0000000..a6be920 Binary files /dev/null and b/data/SEL_dataset/test_image/0538.jpg differ diff --git a/data/SEL_dataset/test_image/0541.jpg b/data/SEL_dataset/test_image/0541.jpg new file mode 100755 index 0000000..cea4525 Binary files /dev/null and b/data/SEL_dataset/test_image/0541.jpg differ diff --git a/data/SEL_dataset/test_image/0548.jpg b/data/SEL_dataset/test_image/0548.jpg new file mode 100755 index 0000000..a2208da Binary files /dev/null and b/data/SEL_dataset/test_image/0548.jpg differ diff --git a/data/SEL_dataset/test_image/0588.jpg b/data/SEL_dataset/test_image/0588.jpg new file mode 100755 index 0000000..106f755 Binary files /dev/null and b/data/SEL_dataset/test_image/0588.jpg differ diff --git a/data/SEL_dataset/test_image/0603.jpg b/data/SEL_dataset/test_image/0603.jpg new file mode 100755 index 0000000..38b1f33 Binary files /dev/null and b/data/SEL_dataset/test_image/0603.jpg differ diff --git a/data/SEL_dataset/test_image/0609.jpg b/data/SEL_dataset/test_image/0609.jpg new file mode 100755 index 0000000..817d6c8 Binary files /dev/null and b/data/SEL_dataset/test_image/0609.jpg differ diff --git a/data/SEL_dataset/test_image/0625.jpg b/data/SEL_dataset/test_image/0625.jpg new file mode 100755 index 0000000..92a1600 Binary files /dev/null and b/data/SEL_dataset/test_image/0625.jpg differ diff --git a/data/SEL_dataset/test_image/0628.jpg b/data/SEL_dataset/test_image/0628.jpg new file mode 100755 index 0000000..6449d3c Binary files /dev/null and b/data/SEL_dataset/test_image/0628.jpg differ diff --git a/data/SEL_dataset/test_image/0638.jpg b/data/SEL_dataset/test_image/0638.jpg new file mode 100755 index 0000000..72eb356 Binary files /dev/null and b/data/SEL_dataset/test_image/0638.jpg differ diff --git a/data/SEL_dataset/test_image/0639.jpg b/data/SEL_dataset/test_image/0639.jpg new file mode 100755 index 0000000..aafe894 Binary files /dev/null and b/data/SEL_dataset/test_image/0639.jpg differ diff --git a/data/SEL_dataset/test_image/0640.jpg b/data/SEL_dataset/test_image/0640.jpg new file mode 100755 index 0000000..145cb01 Binary files /dev/null and b/data/SEL_dataset/test_image/0640.jpg differ diff --git a/data/SEL_dataset/test_image/0646.jpg b/data/SEL_dataset/test_image/0646.jpg new file mode 100755 index 0000000..870fa76 Binary files /dev/null and b/data/SEL_dataset/test_image/0646.jpg differ diff --git a/data/SEL_dataset/test_image/0647.jpg b/data/SEL_dataset/test_image/0647.jpg new file mode 100755 index 0000000..03829e4 Binary files /dev/null and b/data/SEL_dataset/test_image/0647.jpg differ diff --git a/data/SEL_dataset/test_image/0648.jpg b/data/SEL_dataset/test_image/0648.jpg new file mode 100755 index 0000000..674fdda Binary files /dev/null and b/data/SEL_dataset/test_image/0648.jpg differ diff --git a/data/SEL_dataset/test_image/0653.jpg b/data/SEL_dataset/test_image/0653.jpg new file mode 100755 index 0000000..64479b5 Binary files /dev/null and b/data/SEL_dataset/test_image/0653.jpg differ diff --git a/data/SEL_dataset/test_image/0659.jpg b/data/SEL_dataset/test_image/0659.jpg new file mode 100755 index 0000000..8156934 Binary files /dev/null and b/data/SEL_dataset/test_image/0659.jpg differ diff --git a/data/SEL_dataset/test_image/0684.jpg b/data/SEL_dataset/test_image/0684.jpg new file mode 100755 index 0000000..cfd2557 Binary files /dev/null and b/data/SEL_dataset/test_image/0684.jpg differ diff --git a/data/SEL_dataset/test_image/0685.jpg b/data/SEL_dataset/test_image/0685.jpg new file mode 100755 index 0000000..e902aa3 Binary files /dev/null and b/data/SEL_dataset/test_image/0685.jpg differ diff --git a/data/SEL_dataset/test_image/0691.jpg b/data/SEL_dataset/test_image/0691.jpg new file mode 100755 index 0000000..ba0f67a Binary files /dev/null and b/data/SEL_dataset/test_image/0691.jpg differ diff --git a/data/SEL_dataset/test_image/0692.jpg b/data/SEL_dataset/test_image/0692.jpg new file mode 100755 index 0000000..4bcf8c4 Binary files /dev/null and b/data/SEL_dataset/test_image/0692.jpg differ diff --git a/data/SEL_dataset/test_image/0702.jpg b/data/SEL_dataset/test_image/0702.jpg new file mode 100755 index 0000000..f98640a Binary files /dev/null and b/data/SEL_dataset/test_image/0702.jpg differ diff --git a/data/SEL_dataset/test_image/0710.jpg b/data/SEL_dataset/test_image/0710.jpg new file mode 100755 index 0000000..6b80603 Binary files /dev/null and b/data/SEL_dataset/test_image/0710.jpg differ diff --git a/data/SEL_dataset/test_image/0730.jpg b/data/SEL_dataset/test_image/0730.jpg new file mode 100755 index 0000000..b2bc2d1 Binary files /dev/null and b/data/SEL_dataset/test_image/0730.jpg differ diff --git a/data/SEL_dataset/test_image/0743.jpg b/data/SEL_dataset/test_image/0743.jpg new file mode 100755 index 0000000..d95bd7a Binary files /dev/null and b/data/SEL_dataset/test_image/0743.jpg differ diff --git a/data/SEL_dataset/test_image/0745.jpg b/data/SEL_dataset/test_image/0745.jpg new file mode 100755 index 0000000..1a4356b Binary files /dev/null and b/data/SEL_dataset/test_image/0745.jpg differ diff --git a/data/SEL_dataset/test_image/0756.jpg b/data/SEL_dataset/test_image/0756.jpg new file mode 100755 index 0000000..9a63078 Binary files /dev/null and b/data/SEL_dataset/test_image/0756.jpg differ diff --git a/data/SEL_dataset/test_image/0764.jpg b/data/SEL_dataset/test_image/0764.jpg new file mode 100755 index 0000000..a153cc0 Binary files /dev/null and b/data/SEL_dataset/test_image/0764.jpg differ diff --git a/data/SEL_dataset/test_image/0769.jpg b/data/SEL_dataset/test_image/0769.jpg new file mode 100755 index 0000000..086ad02 Binary files /dev/null and b/data/SEL_dataset/test_image/0769.jpg differ diff --git a/data/SEL_dataset/test_image/0774.jpg b/data/SEL_dataset/test_image/0774.jpg new file mode 100755 index 0000000..1f1ec6a Binary files /dev/null and b/data/SEL_dataset/test_image/0774.jpg differ diff --git a/data/SEL_dataset/test_image/0787.jpg b/data/SEL_dataset/test_image/0787.jpg new file mode 100755 index 0000000..5dbdebd Binary files /dev/null and b/data/SEL_dataset/test_image/0787.jpg differ diff --git a/data/SEL_dataset/test_image/0788.jpg b/data/SEL_dataset/test_image/0788.jpg new file mode 100755 index 0000000..54978e0 Binary files /dev/null and b/data/SEL_dataset/test_image/0788.jpg differ diff --git a/data/SEL_dataset/test_image/0789.jpg b/data/SEL_dataset/test_image/0789.jpg new file mode 100755 index 0000000..6ac2c60 Binary files /dev/null and b/data/SEL_dataset/test_image/0789.jpg differ diff --git a/data/SEL_dataset/test_image/0793.jpg b/data/SEL_dataset/test_image/0793.jpg new file mode 100755 index 0000000..39f06eb Binary files /dev/null and b/data/SEL_dataset/test_image/0793.jpg differ diff --git a/data/SEL_dataset/test_image/0795.jpg b/data/SEL_dataset/test_image/0795.jpg new file mode 100755 index 0000000..10b37cc Binary files /dev/null and b/data/SEL_dataset/test_image/0795.jpg differ diff --git a/data/SEL_dataset/test_image/0812.jpg b/data/SEL_dataset/test_image/0812.jpg new file mode 100755 index 0000000..285c368 Binary files /dev/null and b/data/SEL_dataset/test_image/0812.jpg differ diff --git a/data/SEL_dataset/test_image/0817.jpg b/data/SEL_dataset/test_image/0817.jpg new file mode 100755 index 0000000..b2af8ce Binary files /dev/null and b/data/SEL_dataset/test_image/0817.jpg differ diff --git a/data/SEL_dataset/test_image/0818.jpg b/data/SEL_dataset/test_image/0818.jpg new file mode 100755 index 0000000..2656745 Binary files /dev/null and b/data/SEL_dataset/test_image/0818.jpg differ diff --git a/data/SEL_dataset/test_image/0822.jpg b/data/SEL_dataset/test_image/0822.jpg new file mode 100755 index 0000000..943a729 Binary files /dev/null and b/data/SEL_dataset/test_image/0822.jpg differ diff --git a/data/SEL_dataset/test_image/0854.jpg b/data/SEL_dataset/test_image/0854.jpg new file mode 100755 index 0000000..0de0eb4 Binary files /dev/null and b/data/SEL_dataset/test_image/0854.jpg differ diff --git a/data/SEL_dataset/test_image/0864.jpg b/data/SEL_dataset/test_image/0864.jpg new file mode 100755 index 0000000..e8fac0d Binary files /dev/null and b/data/SEL_dataset/test_image/0864.jpg differ diff --git a/data/SEL_dataset/test_image/0872.jpg b/data/SEL_dataset/test_image/0872.jpg new file mode 100755 index 0000000..548241d Binary files /dev/null and b/data/SEL_dataset/test_image/0872.jpg differ diff --git a/data/SEL_dataset/test_image/0873.jpg b/data/SEL_dataset/test_image/0873.jpg new file mode 100755 index 0000000..8402a96 Binary files /dev/null and b/data/SEL_dataset/test_image/0873.jpg differ diff --git a/data/SEL_dataset/test_image/0879.jpg b/data/SEL_dataset/test_image/0879.jpg new file mode 100755 index 0000000..5792886 Binary files /dev/null and b/data/SEL_dataset/test_image/0879.jpg differ diff --git a/data/SEL_dataset/test_image/0885.jpg b/data/SEL_dataset/test_image/0885.jpg new file mode 100755 index 0000000..283df9b Binary files /dev/null and b/data/SEL_dataset/test_image/0885.jpg differ diff --git a/data/SEL_dataset/test_image/0886.jpg b/data/SEL_dataset/test_image/0886.jpg new file mode 100755 index 0000000..55efabd Binary files /dev/null and b/data/SEL_dataset/test_image/0886.jpg differ diff --git a/data/SEL_dataset/test_image/0901.jpg b/data/SEL_dataset/test_image/0901.jpg new file mode 100755 index 0000000..e9734d2 Binary files /dev/null and b/data/SEL_dataset/test_image/0901.jpg differ diff --git a/data/SEL_dataset/test_image/0903.jpg b/data/SEL_dataset/test_image/0903.jpg new file mode 100755 index 0000000..65c34de Binary files /dev/null and b/data/SEL_dataset/test_image/0903.jpg differ diff --git a/data/SEL_dataset/test_image/0924.jpg b/data/SEL_dataset/test_image/0924.jpg new file mode 100755 index 0000000..6ddf734 Binary files /dev/null and b/data/SEL_dataset/test_image/0924.jpg differ diff --git a/data/SEL_dataset/test_image/0941.jpg b/data/SEL_dataset/test_image/0941.jpg new file mode 100755 index 0000000..97d6c0c Binary files /dev/null and b/data/SEL_dataset/test_image/0941.jpg differ diff --git a/data/SEL_dataset/test_image/0960.jpg b/data/SEL_dataset/test_image/0960.jpg new file mode 100755 index 0000000..d1b9dc5 Binary files /dev/null and b/data/SEL_dataset/test_image/0960.jpg differ diff --git a/data/SEL_dataset/test_image/0994.jpg b/data/SEL_dataset/test_image/0994.jpg new file mode 100755 index 0000000..f4c3e47 Binary files /dev/null and b/data/SEL_dataset/test_image/0994.jpg differ diff --git a/data/SEL_dataset/test_image/1010.jpg b/data/SEL_dataset/test_image/1010.jpg new file mode 100755 index 0000000..eb80aac Binary files /dev/null and b/data/SEL_dataset/test_image/1010.jpg differ diff --git a/data/SEL_dataset/test_image/1022.jpg b/data/SEL_dataset/test_image/1022.jpg new file mode 100755 index 0000000..99b5b86 Binary files /dev/null and b/data/SEL_dataset/test_image/1022.jpg differ diff --git a/data/SEL_dataset/test_image/1023.jpg b/data/SEL_dataset/test_image/1023.jpg new file mode 100755 index 0000000..3a9e1ee Binary files /dev/null and b/data/SEL_dataset/test_image/1023.jpg differ diff --git a/data/SEL_dataset/test_image/1026.jpg b/data/SEL_dataset/test_image/1026.jpg new file mode 100755 index 0000000..2ac4359 Binary files /dev/null and b/data/SEL_dataset/test_image/1026.jpg differ diff --git a/data/SEL_dataset/test_image/1044.jpg b/data/SEL_dataset/test_image/1044.jpg new file mode 100755 index 0000000..aa5dc25 Binary files /dev/null and b/data/SEL_dataset/test_image/1044.jpg differ diff --git a/data/SEL_dataset/test_image/1046.jpg b/data/SEL_dataset/test_image/1046.jpg new file mode 100755 index 0000000..13a0f76 Binary files /dev/null and b/data/SEL_dataset/test_image/1046.jpg differ diff --git a/data/SEL_dataset/test_image/1048.jpg b/data/SEL_dataset/test_image/1048.jpg new file mode 100755 index 0000000..ca49249 Binary files /dev/null and b/data/SEL_dataset/test_image/1048.jpg differ diff --git a/data/SEL_dataset/test_image/1051.jpg b/data/SEL_dataset/test_image/1051.jpg new file mode 100755 index 0000000..0bd988b Binary files /dev/null and b/data/SEL_dataset/test_image/1051.jpg differ diff --git a/data/SEL_dataset/test_image/1052.jpg b/data/SEL_dataset/test_image/1052.jpg new file mode 100755 index 0000000..e87b783 Binary files /dev/null and b/data/SEL_dataset/test_image/1052.jpg differ diff --git a/data/SEL_dataset/test_image/1060.jpg b/data/SEL_dataset/test_image/1060.jpg new file mode 100755 index 0000000..4ed89fe Binary files /dev/null and b/data/SEL_dataset/test_image/1060.jpg differ diff --git a/data/SEL_dataset/test_image/1064.jpg b/data/SEL_dataset/test_image/1064.jpg new file mode 100755 index 0000000..4a522e4 Binary files /dev/null and b/data/SEL_dataset/test_image/1064.jpg differ diff --git a/data/SEL_dataset/test_image/1066.jpg b/data/SEL_dataset/test_image/1066.jpg new file mode 100755 index 0000000..804e42c Binary files /dev/null and b/data/SEL_dataset/test_image/1066.jpg differ diff --git a/data/SEL_dataset/test_image/1071.jpg b/data/SEL_dataset/test_image/1071.jpg new file mode 100755 index 0000000..f7dc869 Binary files /dev/null and b/data/SEL_dataset/test_image/1071.jpg differ diff --git a/data/SEL_dataset/test_image/1077.jpg b/data/SEL_dataset/test_image/1077.jpg new file mode 100755 index 0000000..194ad7c Binary files /dev/null and b/data/SEL_dataset/test_image/1077.jpg differ diff --git a/data/SEL_dataset/test_image/1083.jpg b/data/SEL_dataset/test_image/1083.jpg new file mode 100755 index 0000000..0b8a012 Binary files /dev/null and b/data/SEL_dataset/test_image/1083.jpg differ diff --git a/data/SEL_dataset/test_image/1099.jpg b/data/SEL_dataset/test_image/1099.jpg new file mode 100755 index 0000000..6d52065 Binary files /dev/null and b/data/SEL_dataset/test_image/1099.jpg differ diff --git a/data/SEL_dataset/test_image/1104.jpg b/data/SEL_dataset/test_image/1104.jpg new file mode 100755 index 0000000..1c110ee Binary files /dev/null and b/data/SEL_dataset/test_image/1104.jpg differ diff --git a/data/SEL_dataset/test_image/1113.jpg b/data/SEL_dataset/test_image/1113.jpg new file mode 100755 index 0000000..cd6f4e0 Binary files /dev/null and b/data/SEL_dataset/test_image/1113.jpg differ diff --git a/data/SEL_dataset/test_image/1118.jpg b/data/SEL_dataset/test_image/1118.jpg new file mode 100755 index 0000000..d0c71c1 Binary files /dev/null and b/data/SEL_dataset/test_image/1118.jpg differ diff --git a/data/SEL_dataset/test_image/1124.jpg b/data/SEL_dataset/test_image/1124.jpg new file mode 100755 index 0000000..4520ca9 Binary files /dev/null and b/data/SEL_dataset/test_image/1124.jpg differ diff --git a/data/SEL_dataset/test_image/1128.jpg b/data/SEL_dataset/test_image/1128.jpg new file mode 100755 index 0000000..05f1cb0 Binary files /dev/null and b/data/SEL_dataset/test_image/1128.jpg differ diff --git a/data/SEL_dataset/test_image/1130.jpg b/data/SEL_dataset/test_image/1130.jpg new file mode 100755 index 0000000..9b4ea92 Binary files /dev/null and b/data/SEL_dataset/test_image/1130.jpg differ diff --git a/data/SEL_dataset/test_image/1132.jpg b/data/SEL_dataset/test_image/1132.jpg new file mode 100755 index 0000000..befa2a7 Binary files /dev/null and b/data/SEL_dataset/test_image/1132.jpg differ diff --git a/data/SEL_dataset/test_image/1143.jpg b/data/SEL_dataset/test_image/1143.jpg new file mode 100755 index 0000000..bd883da Binary files /dev/null and b/data/SEL_dataset/test_image/1143.jpg differ diff --git a/data/SEL_dataset/test_image/1160.jpg b/data/SEL_dataset/test_image/1160.jpg new file mode 100755 index 0000000..abac93c Binary files /dev/null and b/data/SEL_dataset/test_image/1160.jpg differ diff --git a/data/SEL_dataset/test_image/1165.jpg b/data/SEL_dataset/test_image/1165.jpg new file mode 100755 index 0000000..2b12c94 Binary files /dev/null and b/data/SEL_dataset/test_image/1165.jpg differ diff --git a/data/SEL_dataset/test_image/1173.jpg b/data/SEL_dataset/test_image/1173.jpg new file mode 100755 index 0000000..40545ca Binary files /dev/null and b/data/SEL_dataset/test_image/1173.jpg differ diff --git a/data/SEL_dataset/test_image/1194.jpg b/data/SEL_dataset/test_image/1194.jpg new file mode 100755 index 0000000..1af0262 Binary files /dev/null and b/data/SEL_dataset/test_image/1194.jpg differ diff --git a/data/SEL_dataset/test_image/1214.jpg b/data/SEL_dataset/test_image/1214.jpg new file mode 100755 index 0000000..9c678d2 Binary files /dev/null and b/data/SEL_dataset/test_image/1214.jpg differ diff --git a/data/SEL_dataset/test_image/1233.jpg b/data/SEL_dataset/test_image/1233.jpg new file mode 100755 index 0000000..36003d2 Binary files /dev/null and b/data/SEL_dataset/test_image/1233.jpg differ diff --git a/data/SEL_dataset/test_image/1248.jpg b/data/SEL_dataset/test_image/1248.jpg new file mode 100755 index 0000000..c5c9c23 Binary files /dev/null and b/data/SEL_dataset/test_image/1248.jpg differ diff --git a/data/SEL_dataset/test_image/1268.jpg b/data/SEL_dataset/test_image/1268.jpg new file mode 100755 index 0000000..d134fb2 Binary files /dev/null and b/data/SEL_dataset/test_image/1268.jpg differ diff --git a/data/SEL_dataset/test_image/1270.jpg b/data/SEL_dataset/test_image/1270.jpg new file mode 100755 index 0000000..76ef39b Binary files /dev/null and b/data/SEL_dataset/test_image/1270.jpg differ diff --git a/data/SEL_dataset/test_image/1272.jpg b/data/SEL_dataset/test_image/1272.jpg new file mode 100755 index 0000000..2b34a6a Binary files /dev/null and b/data/SEL_dataset/test_image/1272.jpg differ diff --git a/data/SEL_dataset/test_image/1291.jpg b/data/SEL_dataset/test_image/1291.jpg new file mode 100755 index 0000000..963fb4a Binary files /dev/null and b/data/SEL_dataset/test_image/1291.jpg differ diff --git a/data/SEL_dataset/test_image/1309.jpg b/data/SEL_dataset/test_image/1309.jpg new file mode 100755 index 0000000..bcb189d Binary files /dev/null and b/data/SEL_dataset/test_image/1309.jpg differ diff --git a/data/SEL_dataset/test_image/1314.jpg b/data/SEL_dataset/test_image/1314.jpg new file mode 100755 index 0000000..18d4813 Binary files /dev/null and b/data/SEL_dataset/test_image/1314.jpg differ diff --git a/data/SEL_dataset/test_image/1320.jpg b/data/SEL_dataset/test_image/1320.jpg new file mode 100755 index 0000000..624dc21 Binary files /dev/null and b/data/SEL_dataset/test_image/1320.jpg differ diff --git a/data/SEL_dataset/test_image/1330.jpg b/data/SEL_dataset/test_image/1330.jpg new file mode 100755 index 0000000..e6792e9 Binary files /dev/null and b/data/SEL_dataset/test_image/1330.jpg differ diff --git a/data/SEL_dataset/test_image/1338.jpg b/data/SEL_dataset/test_image/1338.jpg new file mode 100755 index 0000000..8b49e24 Binary files /dev/null and b/data/SEL_dataset/test_image/1338.jpg differ diff --git a/data/SEL_dataset/test_image/1344.jpg b/data/SEL_dataset/test_image/1344.jpg new file mode 100755 index 0000000..0315b22 Binary files /dev/null and b/data/SEL_dataset/test_image/1344.jpg differ diff --git a/data/SEL_dataset/test_image/1363.jpg b/data/SEL_dataset/test_image/1363.jpg new file mode 100755 index 0000000..6b152f6 Binary files /dev/null and b/data/SEL_dataset/test_image/1363.jpg differ diff --git a/data/SEL_dataset/test_image/1376.jpg b/data/SEL_dataset/test_image/1376.jpg new file mode 100755 index 0000000..1950839 Binary files /dev/null and b/data/SEL_dataset/test_image/1376.jpg differ diff --git a/data/SEL_dataset/test_image/1377.jpg b/data/SEL_dataset/test_image/1377.jpg new file mode 100755 index 0000000..fff587d Binary files /dev/null and b/data/SEL_dataset/test_image/1377.jpg differ diff --git a/data/SEL_dataset/test_image/1378.jpg b/data/SEL_dataset/test_image/1378.jpg new file mode 100755 index 0000000..29a90bb Binary files /dev/null and b/data/SEL_dataset/test_image/1378.jpg differ diff --git a/data/SEL_dataset/test_image/1386.jpg b/data/SEL_dataset/test_image/1386.jpg new file mode 100755 index 0000000..abb773b Binary files /dev/null and b/data/SEL_dataset/test_image/1386.jpg differ diff --git a/data/SEL_dataset/test_image/1392.jpg b/data/SEL_dataset/test_image/1392.jpg new file mode 100755 index 0000000..a5a139c Binary files /dev/null and b/data/SEL_dataset/test_image/1392.jpg differ diff --git a/data/SEL_dataset/test_image/1394.jpg b/data/SEL_dataset/test_image/1394.jpg new file mode 100755 index 0000000..6ae49c2 Binary files /dev/null and b/data/SEL_dataset/test_image/1394.jpg differ diff --git a/data/SEL_dataset/test_image/1397.jpg b/data/SEL_dataset/test_image/1397.jpg new file mode 100755 index 0000000..2aa5e55 Binary files /dev/null and b/data/SEL_dataset/test_image/1397.jpg differ diff --git a/data/SEL_dataset/test_image/1414.jpg b/data/SEL_dataset/test_image/1414.jpg new file mode 100755 index 0000000..753d786 Binary files /dev/null and b/data/SEL_dataset/test_image/1414.jpg differ diff --git a/data/SEL_dataset/test_image/1415.jpg b/data/SEL_dataset/test_image/1415.jpg new file mode 100755 index 0000000..4cc5f81 Binary files /dev/null and b/data/SEL_dataset/test_image/1415.jpg differ diff --git a/data/SEL_dataset/test_image/1419.jpg b/data/SEL_dataset/test_image/1419.jpg new file mode 100755 index 0000000..a690831 Binary files /dev/null and b/data/SEL_dataset/test_image/1419.jpg differ diff --git a/data/SEL_dataset/test_image/1427.jpg b/data/SEL_dataset/test_image/1427.jpg new file mode 100755 index 0000000..018c699 Binary files /dev/null and b/data/SEL_dataset/test_image/1427.jpg differ diff --git a/data/SEL_dataset/test_image/1443.jpg b/data/SEL_dataset/test_image/1443.jpg new file mode 100755 index 0000000..8bf3e46 Binary files /dev/null and b/data/SEL_dataset/test_image/1443.jpg differ diff --git a/data/SEL_dataset/test_image/1456.jpg b/data/SEL_dataset/test_image/1456.jpg new file mode 100755 index 0000000..6b4d83f Binary files /dev/null and b/data/SEL_dataset/test_image/1456.jpg differ diff --git a/data/SEL_dataset/test_image/1461.jpg b/data/SEL_dataset/test_image/1461.jpg new file mode 100755 index 0000000..a0be1f9 Binary files /dev/null and b/data/SEL_dataset/test_image/1461.jpg differ diff --git a/data/SEL_dataset/test_image/1509.jpg b/data/SEL_dataset/test_image/1509.jpg new file mode 100755 index 0000000..bb79999 Binary files /dev/null and b/data/SEL_dataset/test_image/1509.jpg differ diff --git a/data/SEL_dataset/test_image/1514.jpg b/data/SEL_dataset/test_image/1514.jpg new file mode 100755 index 0000000..d7dd3e3 Binary files /dev/null and b/data/SEL_dataset/test_image/1514.jpg differ diff --git a/data/SEL_dataset/test_image/1517.jpg b/data/SEL_dataset/test_image/1517.jpg new file mode 100755 index 0000000..73ea126 Binary files /dev/null and b/data/SEL_dataset/test_image/1517.jpg differ diff --git a/data/SEL_dataset/test_image/1521.jpg b/data/SEL_dataset/test_image/1521.jpg new file mode 100755 index 0000000..35ada08 Binary files /dev/null and b/data/SEL_dataset/test_image/1521.jpg differ diff --git a/data/SEL_dataset/test_image/1570.jpg b/data/SEL_dataset/test_image/1570.jpg new file mode 100755 index 0000000..19c9e93 Binary files /dev/null and b/data/SEL_dataset/test_image/1570.jpg differ diff --git a/data/SEL_dataset/test_image/1582.jpg b/data/SEL_dataset/test_image/1582.jpg new file mode 100755 index 0000000..423a96f Binary files /dev/null and b/data/SEL_dataset/test_image/1582.jpg differ diff --git a/data/SEL_dataset/test_image/1588.jpg b/data/SEL_dataset/test_image/1588.jpg new file mode 100755 index 0000000..b5143b9 Binary files /dev/null and b/data/SEL_dataset/test_image/1588.jpg differ diff --git a/data/SEL_dataset/test_image/1648.jpg b/data/SEL_dataset/test_image/1648.jpg new file mode 100755 index 0000000..20fa849 Binary files /dev/null and b/data/SEL_dataset/test_image/1648.jpg differ diff --git a/data/SEL_dataset/test_image/1649.jpg b/data/SEL_dataset/test_image/1649.jpg new file mode 100755 index 0000000..7902856 Binary files /dev/null and b/data/SEL_dataset/test_image/1649.jpg differ diff --git a/data/SEL_dataset/test_image/1650.jpg b/data/SEL_dataset/test_image/1650.jpg new file mode 100755 index 0000000..ed4c068 Binary files /dev/null and b/data/SEL_dataset/test_image/1650.jpg differ diff --git a/data/SEL_dataset/test_image/1651.jpg b/data/SEL_dataset/test_image/1651.jpg new file mode 100755 index 0000000..b080978 Binary files /dev/null and b/data/SEL_dataset/test_image/1651.jpg differ diff --git a/data/SEL_dataset/test_image/1652.jpg b/data/SEL_dataset/test_image/1652.jpg new file mode 100755 index 0000000..26dbbd6 Binary files /dev/null and b/data/SEL_dataset/test_image/1652.jpg differ diff --git a/data/SEL_dataset/test_image/1707.jpg b/data/SEL_dataset/test_image/1707.jpg new file mode 100755 index 0000000..e9c6362 Binary files /dev/null and b/data/SEL_dataset/test_image/1707.jpg differ diff --git a/data/SEL_dataset/test_image/1708.jpg b/data/SEL_dataset/test_image/1708.jpg new file mode 100755 index 0000000..bdbf2dd Binary files /dev/null and b/data/SEL_dataset/test_image/1708.jpg differ diff --git a/data/SEL_dataset/test_image/1709.jpg b/data/SEL_dataset/test_image/1709.jpg new file mode 100755 index 0000000..510bb1d Binary files /dev/null and b/data/SEL_dataset/test_image/1709.jpg differ diff --git a/data/SEL_dataset/test_image/1710.jpg b/data/SEL_dataset/test_image/1710.jpg new file mode 100755 index 0000000..f4818d8 Binary files /dev/null and b/data/SEL_dataset/test_image/1710.jpg differ diff --git a/data/SEL_dataset/test_image/1711.jpg b/data/SEL_dataset/test_image/1711.jpg new file mode 100755 index 0000000..058c107 Binary files /dev/null and b/data/SEL_dataset/test_image/1711.jpg differ diff --git a/data/SEL_dataset/test_image/1712.jpg b/data/SEL_dataset/test_image/1712.jpg new file mode 100755 index 0000000..f41ab1f Binary files /dev/null and b/data/SEL_dataset/test_image/1712.jpg differ diff --git a/data/SEL_dataset/test_image/1713.jpg b/data/SEL_dataset/test_image/1713.jpg new file mode 100755 index 0000000..2d413a4 Binary files /dev/null and b/data/SEL_dataset/test_image/1713.jpg differ diff --git a/data/SEL_dataset/test_image/1714.jpg b/data/SEL_dataset/test_image/1714.jpg new file mode 100755 index 0000000..6a55a24 Binary files /dev/null and b/data/SEL_dataset/test_image/1714.jpg differ diff --git a/data/SEL_dataset/test_image/1715.jpg b/data/SEL_dataset/test_image/1715.jpg new file mode 100755 index 0000000..3ffc6a7 Binary files /dev/null and b/data/SEL_dataset/test_image/1715.jpg differ diff --git a/data/SEL_dataset/test_image/1716.jpg b/data/SEL_dataset/test_image/1716.jpg new file mode 100755 index 0000000..5a36bdc Binary files /dev/null and b/data/SEL_dataset/test_image/1716.jpg differ diff --git a/data/TestPaper_dataset/testpaperdataset.py b/data/TestPaper_dataset/testpaperdataset.py new file mode 100755 index 0000000..0ac9db9 --- /dev/null +++ b/data/TestPaper_dataset/testpaperdataset.py @@ -0,0 +1,11 @@ +import cv2 +from PIL import Image + + +class TestPaper(): + def __init__(self): + pass + + def __getitem__(self, item): + pass + diff --git a/data/create_dataset_gt.py b/data/create_dataset_gt.py new file mode 100644 index 0000000..d5552b9 --- /dev/null +++ b/data/create_dataset_gt.py @@ -0,0 +1,28 @@ +# This file is used to create gt.txt for dataset to load +import os +import glob +import fire + +def create_gt(image_folder,gt_folder,outfile='./gt.txt'): + ''' + Create the groundtruth txt file + :param image_folder: + :param gt_folder: + :param outfile: + :return: + ''' + with open(outfile, 'w') as f: + for imagepath in glob.glob(os.path.join(image_folder, "*.*")): + imagepathroot, (imagename, imageext) = os.path.split(imagepath)[0], os.path.splitext(os.path.split(imagepath)[1]) + gtpath = glob.glob(os.path.join(gt_folder, f"{imagename}.*")) + if len(gtpath)>0: + gtpath = gtpath[0] + else: + continue + + f.write(f"{imagepath};{gtpath}\n") + + +if __name__ == "__main__": + fire.Fire(create_gt) + diff --git a/data/sel_test.txt b/data/sel_test.txt new file mode 100755 index 0000000..5e09f71 --- /dev/null +++ b/data/sel_test.txt @@ -0,0 +1,174 @@ +SEL_dataset/test_image/0015.jpg +SEL_dataset/test_image/0033.jpg +SEL_dataset/test_image/0046.jpg +SEL_dataset/test_image/0058.jpg +SEL_dataset/test_image/0092.jpg +SEL_dataset/test_image/0095.jpg +SEL_dataset/test_image/0107.jpg +SEL_dataset/test_image/0111.jpg +SEL_dataset/test_image/0114.jpg +SEL_dataset/test_image/0150.jpg +SEL_dataset/test_image/0153.jpg +SEL_dataset/test_image/0198.jpg +SEL_dataset/test_image/0199.jpg +SEL_dataset/test_image/0215.jpg +SEL_dataset/test_image/0220.jpg +SEL_dataset/test_image/0239.jpg +SEL_dataset/test_image/0251.jpg +SEL_dataset/test_image/0283.jpg +SEL_dataset/test_image/0286.jpg +SEL_dataset/test_image/0311.jpg +SEL_dataset/test_image/0315.jpg +SEL_dataset/test_image/0319.jpg +SEL_dataset/test_image/0333.jpg +SEL_dataset/test_image/0342.jpg +SEL_dataset/test_image/0348.jpg +SEL_dataset/test_image/0351.jpg +SEL_dataset/test_image/0353.jpg +SEL_dataset/test_image/0357.jpg +SEL_dataset/test_image/0378.jpg +SEL_dataset/test_image/0393.jpg +SEL_dataset/test_image/0399.jpg +SEL_dataset/test_image/0400.jpg +SEL_dataset/test_image/0416.jpg +SEL_dataset/test_image/0432.jpg +SEL_dataset/test_image/0435.jpg +SEL_dataset/test_image/0445.jpg +SEL_dataset/test_image/0460.jpg +SEL_dataset/test_image/0461.jpg +SEL_dataset/test_image/0492.jpg +SEL_dataset/test_image/0498.jpg +SEL_dataset/test_image/0499.jpg +SEL_dataset/test_image/0500.jpg +SEL_dataset/test_image/0505.jpg +SEL_dataset/test_image/0511.jpg +SEL_dataset/test_image/0519.jpg +SEL_dataset/test_image/0538.jpg +SEL_dataset/test_image/0541.jpg +SEL_dataset/test_image/0548.jpg +SEL_dataset/test_image/0588.jpg +SEL_dataset/test_image/0603.jpg +SEL_dataset/test_image/0609.jpg +SEL_dataset/test_image/0625.jpg +SEL_dataset/test_image/0628.jpg +SEL_dataset/test_image/0638.jpg +SEL_dataset/test_image/0639.jpg +SEL_dataset/test_image/0640.jpg +SEL_dataset/test_image/0646.jpg +SEL_dataset/test_image/0647.jpg +SEL_dataset/test_image/0648.jpg +SEL_dataset/test_image/0653.jpg +SEL_dataset/test_image/0659.jpg +SEL_dataset/test_image/0684.jpg +SEL_dataset/test_image/0685.jpg +SEL_dataset/test_image/0691.jpg +SEL_dataset/test_image/0692.jpg +SEL_dataset/test_image/0702.jpg +SEL_dataset/test_image/0710.jpg +SEL_dataset/test_image/0730.jpg +SEL_dataset/test_image/0743.jpg +SEL_dataset/test_image/0745.jpg +SEL_dataset/test_image/0756.jpg +SEL_dataset/test_image/0764.jpg +SEL_dataset/test_image/0769.jpg +SEL_dataset/test_image/0774.jpg +SEL_dataset/test_image/0787.jpg +SEL_dataset/test_image/0788.jpg +SEL_dataset/test_image/0789.jpg +SEL_dataset/test_image/0793.jpg +SEL_dataset/test_image/0795.jpg +SEL_dataset/test_image/0812.jpg +SEL_dataset/test_image/0817.jpg +SEL_dataset/test_image/0818.jpg +SEL_dataset/test_image/0822.jpg +SEL_dataset/test_image/0854.jpg +SEL_dataset/test_image/0864.jpg +SEL_dataset/test_image/0872.jpg +SEL_dataset/test_image/0873.jpg +SEL_dataset/test_image/0879.jpg +SEL_dataset/test_image/0885.jpg +SEL_dataset/test_image/0886.jpg +SEL_dataset/test_image/0901.jpg +SEL_dataset/test_image/0903.jpg +SEL_dataset/test_image/0924.jpg +SEL_dataset/test_image/0941.jpg +SEL_dataset/test_image/0960.jpg +SEL_dataset/test_image/0994.jpg +SEL_dataset/test_image/1010.jpg +SEL_dataset/test_image/1022.jpg +SEL_dataset/test_image/1023.jpg +SEL_dataset/test_image/1026.jpg +SEL_dataset/test_image/1044.jpg +SEL_dataset/test_image/1046.jpg +SEL_dataset/test_image/1048.jpg +SEL_dataset/test_image/1051.jpg +SEL_dataset/test_image/1052.jpg +SEL_dataset/test_image/1060.jpg +SEL_dataset/test_image/1064.jpg +SEL_dataset/test_image/1066.jpg +SEL_dataset/test_image/1071.jpg +SEL_dataset/test_image/1077.jpg +SEL_dataset/test_image/1083.jpg +SEL_dataset/test_image/1099.jpg +SEL_dataset/test_image/1104.jpg +SEL_dataset/test_image/1113.jpg +SEL_dataset/test_image/1118.jpg +SEL_dataset/test_image/1124.jpg +SEL_dataset/test_image/1128.jpg +SEL_dataset/test_image/1130.jpg +SEL_dataset/test_image/1132.jpg +SEL_dataset/test_image/1143.jpg +SEL_dataset/test_image/1160.jpg +SEL_dataset/test_image/1165.jpg +SEL_dataset/test_image/1173.jpg +SEL_dataset/test_image/1194.jpg +SEL_dataset/test_image/1214.jpg +SEL_dataset/test_image/1233.jpg +SEL_dataset/test_image/1248.jpg +SEL_dataset/test_image/1268.jpg +SEL_dataset/test_image/1270.jpg +SEL_dataset/test_image/1272.jpg +SEL_dataset/test_image/1291.jpg +SEL_dataset/test_image/1309.jpg +SEL_dataset/test_image/1314.jpg +SEL_dataset/test_image/1320.jpg +SEL_dataset/test_image/1330.jpg +SEL_dataset/test_image/1338.jpg +SEL_dataset/test_image/1344.jpg +SEL_dataset/test_image/1363.jpg +SEL_dataset/test_image/1376.jpg +SEL_dataset/test_image/1377.jpg +SEL_dataset/test_image/1378.jpg +SEL_dataset/test_image/1386.jpg +SEL_dataset/test_image/1392.jpg +SEL_dataset/test_image/1394.jpg +SEL_dataset/test_image/1397.jpg +SEL_dataset/test_image/1414.jpg +SEL_dataset/test_image/1415.jpg +SEL_dataset/test_image/1419.jpg +SEL_dataset/test_image/1427.jpg +SEL_dataset/test_image/1443.jpg +SEL_dataset/test_image/1456.jpg +SEL_dataset/test_image/1461.jpg +SEL_dataset/test_image/1509.jpg +SEL_dataset/test_image/1514.jpg +SEL_dataset/test_image/1517.jpg +SEL_dataset/test_image/1521.jpg +SEL_dataset/test_image/1570.jpg +SEL_dataset/test_image/1582.jpg +SEL_dataset/test_image/1588.jpg +SEL_dataset/test_image/1648.jpg +SEL_dataset/test_image/1649.jpg +SEL_dataset/test_image/1650.jpg +SEL_dataset/test_image/1651.jpg +SEL_dataset/test_image/1652.jpg +SEL_dataset/test_image/1707.jpg +SEL_dataset/test_image/1708.jpg +SEL_dataset/test_image/1709.jpg +SEL_dataset/test_image/1710.jpg +SEL_dataset/test_image/1711.jpg +SEL_dataset/test_image/1712.jpg +SEL_dataset/test_image/1713.jpg +SEL_dataset/test_image/1714.jpg +SEL_dataset/test_image/1715.jpg +SEL_dataset/test_image/1716.jpg diff --git a/data/sel_testnew.txt b/data/sel_testnew.txt new file mode 100644 index 0000000..5e09f71 --- /dev/null +++ b/data/sel_testnew.txt @@ -0,0 +1,174 @@ +SEL_dataset/test_image/0015.jpg +SEL_dataset/test_image/0033.jpg +SEL_dataset/test_image/0046.jpg +SEL_dataset/test_image/0058.jpg +SEL_dataset/test_image/0092.jpg +SEL_dataset/test_image/0095.jpg +SEL_dataset/test_image/0107.jpg +SEL_dataset/test_image/0111.jpg +SEL_dataset/test_image/0114.jpg +SEL_dataset/test_image/0150.jpg +SEL_dataset/test_image/0153.jpg +SEL_dataset/test_image/0198.jpg +SEL_dataset/test_image/0199.jpg +SEL_dataset/test_image/0215.jpg +SEL_dataset/test_image/0220.jpg +SEL_dataset/test_image/0239.jpg +SEL_dataset/test_image/0251.jpg +SEL_dataset/test_image/0283.jpg +SEL_dataset/test_image/0286.jpg +SEL_dataset/test_image/0311.jpg +SEL_dataset/test_image/0315.jpg +SEL_dataset/test_image/0319.jpg +SEL_dataset/test_image/0333.jpg +SEL_dataset/test_image/0342.jpg +SEL_dataset/test_image/0348.jpg +SEL_dataset/test_image/0351.jpg +SEL_dataset/test_image/0353.jpg +SEL_dataset/test_image/0357.jpg +SEL_dataset/test_image/0378.jpg +SEL_dataset/test_image/0393.jpg +SEL_dataset/test_image/0399.jpg +SEL_dataset/test_image/0400.jpg +SEL_dataset/test_image/0416.jpg +SEL_dataset/test_image/0432.jpg +SEL_dataset/test_image/0435.jpg +SEL_dataset/test_image/0445.jpg +SEL_dataset/test_image/0460.jpg +SEL_dataset/test_image/0461.jpg +SEL_dataset/test_image/0492.jpg +SEL_dataset/test_image/0498.jpg +SEL_dataset/test_image/0499.jpg +SEL_dataset/test_image/0500.jpg +SEL_dataset/test_image/0505.jpg +SEL_dataset/test_image/0511.jpg +SEL_dataset/test_image/0519.jpg +SEL_dataset/test_image/0538.jpg +SEL_dataset/test_image/0541.jpg +SEL_dataset/test_image/0548.jpg +SEL_dataset/test_image/0588.jpg +SEL_dataset/test_image/0603.jpg +SEL_dataset/test_image/0609.jpg +SEL_dataset/test_image/0625.jpg +SEL_dataset/test_image/0628.jpg +SEL_dataset/test_image/0638.jpg +SEL_dataset/test_image/0639.jpg +SEL_dataset/test_image/0640.jpg +SEL_dataset/test_image/0646.jpg +SEL_dataset/test_image/0647.jpg +SEL_dataset/test_image/0648.jpg +SEL_dataset/test_image/0653.jpg +SEL_dataset/test_image/0659.jpg +SEL_dataset/test_image/0684.jpg +SEL_dataset/test_image/0685.jpg +SEL_dataset/test_image/0691.jpg +SEL_dataset/test_image/0692.jpg +SEL_dataset/test_image/0702.jpg +SEL_dataset/test_image/0710.jpg +SEL_dataset/test_image/0730.jpg +SEL_dataset/test_image/0743.jpg +SEL_dataset/test_image/0745.jpg +SEL_dataset/test_image/0756.jpg +SEL_dataset/test_image/0764.jpg +SEL_dataset/test_image/0769.jpg +SEL_dataset/test_image/0774.jpg +SEL_dataset/test_image/0787.jpg +SEL_dataset/test_image/0788.jpg +SEL_dataset/test_image/0789.jpg +SEL_dataset/test_image/0793.jpg +SEL_dataset/test_image/0795.jpg +SEL_dataset/test_image/0812.jpg +SEL_dataset/test_image/0817.jpg +SEL_dataset/test_image/0818.jpg +SEL_dataset/test_image/0822.jpg +SEL_dataset/test_image/0854.jpg +SEL_dataset/test_image/0864.jpg +SEL_dataset/test_image/0872.jpg +SEL_dataset/test_image/0873.jpg +SEL_dataset/test_image/0879.jpg +SEL_dataset/test_image/0885.jpg +SEL_dataset/test_image/0886.jpg +SEL_dataset/test_image/0901.jpg +SEL_dataset/test_image/0903.jpg +SEL_dataset/test_image/0924.jpg +SEL_dataset/test_image/0941.jpg +SEL_dataset/test_image/0960.jpg +SEL_dataset/test_image/0994.jpg +SEL_dataset/test_image/1010.jpg +SEL_dataset/test_image/1022.jpg +SEL_dataset/test_image/1023.jpg +SEL_dataset/test_image/1026.jpg +SEL_dataset/test_image/1044.jpg +SEL_dataset/test_image/1046.jpg +SEL_dataset/test_image/1048.jpg +SEL_dataset/test_image/1051.jpg +SEL_dataset/test_image/1052.jpg +SEL_dataset/test_image/1060.jpg +SEL_dataset/test_image/1064.jpg +SEL_dataset/test_image/1066.jpg +SEL_dataset/test_image/1071.jpg +SEL_dataset/test_image/1077.jpg +SEL_dataset/test_image/1083.jpg +SEL_dataset/test_image/1099.jpg +SEL_dataset/test_image/1104.jpg +SEL_dataset/test_image/1113.jpg +SEL_dataset/test_image/1118.jpg +SEL_dataset/test_image/1124.jpg +SEL_dataset/test_image/1128.jpg +SEL_dataset/test_image/1130.jpg +SEL_dataset/test_image/1132.jpg +SEL_dataset/test_image/1143.jpg +SEL_dataset/test_image/1160.jpg +SEL_dataset/test_image/1165.jpg +SEL_dataset/test_image/1173.jpg +SEL_dataset/test_image/1194.jpg +SEL_dataset/test_image/1214.jpg +SEL_dataset/test_image/1233.jpg +SEL_dataset/test_image/1248.jpg +SEL_dataset/test_image/1268.jpg +SEL_dataset/test_image/1270.jpg +SEL_dataset/test_image/1272.jpg +SEL_dataset/test_image/1291.jpg +SEL_dataset/test_image/1309.jpg +SEL_dataset/test_image/1314.jpg +SEL_dataset/test_image/1320.jpg +SEL_dataset/test_image/1330.jpg +SEL_dataset/test_image/1338.jpg +SEL_dataset/test_image/1344.jpg +SEL_dataset/test_image/1363.jpg +SEL_dataset/test_image/1376.jpg +SEL_dataset/test_image/1377.jpg +SEL_dataset/test_image/1378.jpg +SEL_dataset/test_image/1386.jpg +SEL_dataset/test_image/1392.jpg +SEL_dataset/test_image/1394.jpg +SEL_dataset/test_image/1397.jpg +SEL_dataset/test_image/1414.jpg +SEL_dataset/test_image/1415.jpg +SEL_dataset/test_image/1419.jpg +SEL_dataset/test_image/1427.jpg +SEL_dataset/test_image/1443.jpg +SEL_dataset/test_image/1456.jpg +SEL_dataset/test_image/1461.jpg +SEL_dataset/test_image/1509.jpg +SEL_dataset/test_image/1514.jpg +SEL_dataset/test_image/1517.jpg +SEL_dataset/test_image/1521.jpg +SEL_dataset/test_image/1570.jpg +SEL_dataset/test_image/1582.jpg +SEL_dataset/test_image/1588.jpg +SEL_dataset/test_image/1648.jpg +SEL_dataset/test_image/1649.jpg +SEL_dataset/test_image/1650.jpg +SEL_dataset/test_image/1651.jpg +SEL_dataset/test_image/1652.jpg +SEL_dataset/test_image/1707.jpg +SEL_dataset/test_image/1708.jpg +SEL_dataset/test_image/1709.jpg +SEL_dataset/test_image/1710.jpg +SEL_dataset/test_image/1711.jpg +SEL_dataset/test_image/1712.jpg +SEL_dataset/test_image/1713.jpg +SEL_dataset/test_image/1714.jpg +SEL_dataset/test_image/1715.jpg +SEL_dataset/test_image/1716.jpg diff --git a/dataloader.py b/dataloader.py new file mode 100755 index 0000000..0b833bc --- /dev/null +++ b/dataloader.py @@ -0,0 +1,107 @@ +import numpy as np +import os +from os.path import join, split, isdir, isfile, abspath +import torch +from PIL import Image +import random +import collections +from torchvision import transforms +from torch.utils.data import Dataset, DataLoader + +class ImageTransform(): + def __init__(self, split): + if split != 'test': + self.transform = transforms.Compose([ + # TODO: Add Transforms + transforms.Resize((400, 400)), + transforms.ToTensor(), + transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) + ]) + else: + self.transform = transforms.Compose([ + transforms.Resize((400, 400)), + transforms.ToTensor(), + transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) + ]) + + def __call__(self, image): + if len(image.split())!=3: + image=image.convert('RGB') + + return self.transform(image) + + +class GtTransform(): + def __init__(self, split): + pass + + def smooth_label(self,gt): + pass + + def __call__(self, gt): + if len(gt.split())>1: + gt=gt.convert('L') + + + +class SemanLineDatasetTest(Dataset): + + def __init__(self, root_dir, label_file, transform=None, t_transform=None): + lines = [line.rstrip('\n') for line in open(label_file)] + self.image_path = [join(root_dir, i) for i in lines] + self.transform = transform + self.t_transform = t_transform + + def __getitem__(self, item): + assert isfile(self.image_path[item]), self.image_path[item] + image = Image.open(self.image_path[item]).convert('RGB') + w, h = image.size + if self.transform is not None: + image = self.transform(image) + + return image, self.image_path[item], [h, w] + + + def __len__(self): + return len(self.image_path) + + +class LineDataset(Dataset): + ''' + Your Dataset. + ''' + def __init__(self, label_file, transform=ImageTransform("test"), t_transform=GtTransform("test")): + self.image_gt_pairs = [line.rstrip('\n').split(";") for line in open(label_file)] + self.transform = transform + self.t_transform = t_transform + + def __getitem__(self, item): + image = Image.open(self.image_gt_pairs[item][0]).convert('RGB') + w, h = image.size + if self.transform is not None: + image_tensor = self.transform(image) + else: + image_tensor=transforms.ToTensor(image) + + gt = Image.open(self.image_gt_pairs[item][1]).convert('L') + w, h = gt.size + if self.t_transform is not None: + gt_tensor = self.t_transform(gt) + else: + gt_tensor=transforms.ToTensor(gt) + + return image_tensor, gt_tensor + + def __len__(self): + return len(self.image_gt_pairs) + + +def get_loader(label_file, batch_size, num_thread=4, pin=True, split='train'): + dataset = LineDataset(label_file, transform=ImageTransform(split), t_transform=GtTransform(split)) + data_loader = DataLoader(dataset=dataset, batch_size=batch_size, shuffle=True, + num_workers=num_thread,pin_memory=pin) + return data_loader + + +if __name__=="__main__": + LineDataset("./test/gt.txt") \ No newline at end of file diff --git a/logger.py b/logger.py new file mode 100755 index 0000000..5a9c692 --- /dev/null +++ b/logger.py @@ -0,0 +1,19 @@ +import logging + +class Logger(): + def __init__(self, path="log.txt"): + self.logger = logging.getLogger("Logger") + self.file_handler = logging.FileHandler(path, "w") + self.stdout_handler = logging.StreamHandler() + self.logger.addHandler(self.file_handler) + self.logger.addHandler(self.stdout_handler) + self.stdout_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) + self.file_handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) + self.logger.setLevel(logging.INFO) + + def info(self, txt): + self.logger.info(txt) + + def close(self): + self.file_handler.close() + self.stdout_handler.close() \ No newline at end of file diff --git a/metric.py b/metric.py new file mode 100755 index 0000000..b0c9590 --- /dev/null +++ b/metric.py @@ -0,0 +1,20 @@ +import numpy as np +import cv2 +from basic_ops import Line +def sa_metric(angle_p, angle_g): + d_angle = np.abs(angle_p - angle_g) + d_angle = min(d_angle, np.pi - d_angle) + d_angle = d_angle * 2 / np.pi + return max(0, (1 - d_angle)) ** 2 + +def se_metric(coord_p, coord_g, size=(400, 400)): + c_p = [(coord_p[0] + coord_p[2]) / 2, (coord_p[1] + coord_p[3]) / 2] + c_g = [(coord_g[0] + coord_g[2]) / 2, (coord_g[1] + coord_g[3]) / 2] + d_coord = np.abs(c_p[0] - c_g[0])**2 + np.abs(c_p[1] - c_g[1])**2 + d_coord = np.sqrt(d_coord) / max(size[0], size[1]) + return max(0, (1 - d_coord)) ** 2 + +def EA_metric(l_pred, l_gt, size=(400, 400)): + se = se_metric(l_pred.coord, l_gt.coord, size=size) + sa = sa_metric(l_pred.angle(), l_gt.angle()) + return sa * se diff --git a/model/_cdht/.gitignore b/model/_cdht/.gitignore new file mode 100755 index 0000000..edd9d60 --- /dev/null +++ b/model/_cdht/.gitignore @@ -0,0 +1,2 @@ +build/ +dist/ diff --git a/model/_cdht/deep_hough.egg-info/PKG-INFO b/model/_cdht/deep_hough.egg-info/PKG-INFO new file mode 100755 index 0000000..b68caa0 --- /dev/null +++ b/model/_cdht/deep_hough.egg-info/PKG-INFO @@ -0,0 +1,10 @@ +Metadata-Version: 1.0 +Name: deep-hough +Version: 0.0.0 +Summary: UNKNOWN +Home-page: UNKNOWN +Author: UNKNOWN +Author-email: UNKNOWN +License: UNKNOWN +Description: UNKNOWN +Platform: UNKNOWN diff --git a/model/_cdht/deep_hough.egg-info/SOURCES.txt b/model/_cdht/deep_hough.egg-info/SOURCES.txt new file mode 100755 index 0000000..7ce5e2d --- /dev/null +++ b/model/_cdht/deep_hough.egg-info/SOURCES.txt @@ -0,0 +1,7 @@ +deep_hough_cuda.cpp +deep_hough_cuda_kernel.cu +setup.py +deep_hough.egg-info/PKG-INFO +deep_hough.egg-info/SOURCES.txt +deep_hough.egg-info/dependency_links.txt +deep_hough.egg-info/top_level.txt \ No newline at end of file diff --git a/model/_cdht/deep_hough.egg-info/dependency_links.txt b/model/_cdht/deep_hough.egg-info/dependency_links.txt new file mode 100755 index 0000000..8b13789 --- /dev/null +++ b/model/_cdht/deep_hough.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/model/_cdht/deep_hough.egg-info/top_level.txt b/model/_cdht/deep_hough.egg-info/top_level.txt new file mode 100755 index 0000000..1121d98 --- /dev/null +++ b/model/_cdht/deep_hough.egg-info/top_level.txt @@ -0,0 +1 @@ +deep_hough diff --git a/model/_cdht/deep_hough_cuda.cpp b/model/_cdht/deep_hough_cuda.cpp new file mode 100755 index 0000000..d50e1e2 --- /dev/null +++ b/model/_cdht/deep_hough_cuda.cpp @@ -0,0 +1,102 @@ +#include +#include +#include +#include +#include +#include + +// CUDA forward declarations +std::vector line_accum_cuda_forward( + const torch::Tensor feat, + const float* tabCos, + const float* tabSin, + torch::Tensor output, + const int numangle, + const int numrho); + +std::vector line_accum_cuda_backward( + torch::Tensor grad_outputs, + torch::Tensor grad_in, + torch::Tensor feat, + const float* tabCos, + const float* tabSin, + const int numangle, + const int numrho); + +// C++ interface + +#define CHECK_CUDA(x) AT_ASSERT(x.type().is_cuda()) //, #x " must be a CUDA tensor") +#define CHECK_CONTIGUOUS(x) AT_ASSERT(x.is_contiguous()) //, #x " must be contiguous") +#define CHECK_INPUT(x) CHECK_CUDA(x); CHECK_CONTIGUOUS(x) +#define PI 3.14159265358979323846 + +void initTab(float* tabSin, float* tabCos, const int numangle, const int numrho, const int H, const int W) +{ + float irho = int(std::sqrt(H*H + W*W) + 1) / float((numrho - 1)); + float itheta = PI / numangle; + float angle = 0; + for(int i = 0; i < numangle; ++i) + { + tabCos[i] = std::cos(angle) / irho; + tabSin[i] = std::sin(angle) / irho; + angle += itheta; + } +} + +std::vector line_accum_forward( + const at::Tensor feat, + at::Tensor output, + const int numangle, + const int numrho) { + + CHECK_INPUT(feat); + CHECK_INPUT(output); + float tabSin[numangle], tabCos[numangle]; + const int H = feat.size(2); + const int W = feat.size(3); + initTab(tabSin, tabCos, numangle, numrho, H, W); + const int batch_size = feat.size(0); + const int channels_size = feat.size(1); + + // torch::set_requires_grad(output, true); + auto out = line_accum_cuda_forward(feat, tabCos, tabSin, output, numangle, numrho); + // std::cout << out[0].sum() << std::endl; + CHECK_CONTIGUOUS(out[0]); + return out; +} + +std::vector line_accum_backward( + torch::Tensor grad_outputs, + torch::Tensor grad_inputs, + torch::Tensor feat, + const int numangle, + const int numrho) { + + CHECK_INPUT(grad_outputs); + CHECK_INPUT(grad_inputs); + CHECK_INPUT(feat); + + float tabSin[numangle], tabCos[numangle]; + const int H = feat.size(2); + const int W = feat.size(3); + initTab(tabSin, tabCos, numangle, numrho, H, W); + + const int batch_size = feat.size(0); + const int channels_size = feat.size(1); + const int imH = feat.size(2); + const int imW = feat.size(3); + + return line_accum_cuda_backward( + grad_outputs, + grad_inputs, + feat, + tabCos, + tabSin, + numangle, + numrho); +} + +PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) { + m.def("forward", &line_accum_forward, "line features accumulating forward (CUDA)"); + m.def("backward", &line_accum_backward, "line features accumulating backward (CUDA)"); +} \ No newline at end of file diff --git a/model/_cdht/deep_hough_cuda_kernel.cu b/model/_cdht/deep_hough_cuda_kernel.cu new file mode 100755 index 0000000..2506586 --- /dev/null +++ b/model/_cdht/deep_hough_cuda_kernel.cu @@ -0,0 +1,300 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +// ------- +// KERNELS +// ------- +__global__ void helloCUDA(const float *f) +{ + for(int i = 0; i < 10; ++i) + { + printf("%d ", f[i]); + } + printf("\n"); + // printf("Hello thread %d, %d, %d, f=%f\n", threadIdx.x, threadIdx.y, threadIdx.z, f); +} + + +__global__ +void line_accum_forward_kernel( + const float* __restrict__ feat, + const float* tabCos, + const float* tabSin, + float* output, + const int imWidth, + const int imHeight, + const int threadW, + const int threadH, + const int threadK, + const int channelSize, + const int batchSize, + const int numangle, + const int numrho) +{ + int batch = blockIdx.y; + int channel = blockIdx.x; + int x = threadIdx.x*threadW; + int y = threadIdx.y*threadH; + int k = threadIdx.z*threadK; + + int imgStartIdx = batch*channelSize*imWidth*imHeight+ + channel*imWidth*imHeight+ + y*imWidth+ + x; + + int angleStartIdx = k; + + if (x < imWidth && y < imHeight && channel < channelSize && batch < batchSize && k < numangle) + { + int imgIndex = imgStartIdx; + int angleIndex; + int outIndex; + int r; + for (int idY=0; idY < threadH; idY++) + { + imgIndex = imgStartIdx + idY*imWidth; + // labelIndex = labelStartIdx + idY*imWidth; + if (y+idY < imHeight) + { + for (int idX=0; idX line_accum_cuda_forward( + const torch::Tensor feat, + const float* tabCos, + const float* tabSin, + torch::Tensor output, + const int numangle, + const int numrho){ + // -feat: [N, C, H, W] + // -tabCos: [numangle] + // -tabSin: [numangle] + const int batch_size = feat.size(0); + const int channels_size = feat.size(1); + const int imH = feat.size(2); + const int imW = feat.size(3); + + int blockSizeX = std::min(8, imW); + const int threadW = ceil(imW/(float)blockSizeX); + + int blockSizeY = std::min(8, imH); + const int threadH = ceil(imH/(float)blockSizeY); + + int blockSizeZ = std::min(8, numangle); + const int threadK = ceil(numangle/(float)blockSizeZ); + + const dim3 blocks(channels_size, batch_size); + const dim3 threads(blockSizeX, blockSizeY, blockSizeZ); + + float *d_tabCos, *d_tabSin; + + cudaMalloc((void **)&d_tabCos, sizeof(float)*numangle); + cudaMalloc((void **)&d_tabSin, sizeof(float)*numangle); + + cudaMemcpy(d_tabCos, tabCos, sizeof(float)*numangle, cudaMemcpyHostToDevice); + cudaMemcpy(d_tabSin, tabSin, sizeof(float)*numangle, cudaMemcpyHostToDevice); + + // std::cout << imW << " " << imH << " " << channels_size << " " << batch_size << " " << numangle << " " << numrho << std::endl; + line_accum_forward_kernel<<>>( + feat.data(), + d_tabCos, + d_tabSin, + output.data(), + imW, + imH, + threadW, + threadH, + threadK, + channels_size, + batch_size, + numangle, + numrho + ); + // helloCUDA<<>>(tabCos); + // cudaDeviceSynchronize(); + // std::cout << output << std::endl; + // std::cout << output.sum() << std::endl; + cudaFree(d_tabCos); + cudaFree(d_tabSin); + return {output}; +} + +std::vector line_accum_cuda_backward( + torch::Tensor grad_outputs, + torch::Tensor grad_in, + torch::Tensor feat, + const float* tabCos, + const float* tabSin, + const int numangle, + const int numrho) +{ + const int batch_size = feat.size(0); + const int channels_size = feat.size(1); + const int imH = feat.size(2); + const int imW = feat.size(3); + + int blockSizeX = std::min(8, imW); + const int threadW = ceil(imW/(float)blockSizeX); + + int blockSizeY = std::min(8, imH); + const int threadH = ceil(imH/(float)blockSizeY); + + int blockSizeZ = std::min(8, numangle); + const int threadK = ceil(numangle/(float)blockSizeZ); + + const dim3 blocks(channels_size, batch_size); + const dim3 threads(blockSizeX, blockSizeY, blockSizeZ); + + float *d_tabCos, *d_tabSin; + + cudaMalloc((void **)&d_tabCos, sizeof(float)*numangle); + cudaMalloc((void **)&d_tabSin, sizeof(float)*numangle); + + cudaMemcpy(d_tabCos, tabCos, sizeof(float)*numangle, cudaMemcpyHostToDevice); + cudaMemcpy(d_tabSin, tabSin, sizeof(float)*numangle, cudaMemcpyHostToDevice); + // std::cout << imW << " " << imH << " " << channels_size << " " << batch_size << " " << numangle << " " << numrho << std::endl; + + + // printf("p = %p\n", grad_outputs.data()); + // printf("p = %p\n", grad_in.data()); + + line_accum_backward_kernel<<>>( + grad_in.data(), + grad_outputs.data(), + d_tabCos, + d_tabSin, + imW, + imH, + threadW, + threadH, + threadK, + channels_size, + batch_size, + numangle, + numrho + ); + // printf("p = %p\n", grad_outputs.data()); + // printf("p = %p\n", grad_in.data()); + // std::cout << grad_outputs << std::endl; + // cudaDeviceSynchronize(); + cudaFree(d_tabCos); + cudaFree(d_tabSin); + return {grad_in}; +} diff --git a/model/_cdht/dht_func.py b/model/_cdht/dht_func.py new file mode 100755 index 0000000..644e32a --- /dev/null +++ b/model/_cdht/dht_func.py @@ -0,0 +1,39 @@ +import torch +import deep_hough as dh +import numpy as np +import matplotlib.pyplot as plt +import time + +class C_dht_Function(torch.autograd.Function): + @staticmethod + def forward(ctx, feat, numangle, numrho): + N, C, _, _ = feat.size() + out = torch.zeros(N, C, numangle, numrho).type_as(feat).cuda() + out = dh.forward(feat, out, numangle, numrho) + outputs = out[0] + ctx.save_for_backward(feat) + ctx.numangle = numangle + ctx.numrho = numrho + return outputs + + @staticmethod + def backward(ctx, grad_output): + feat = ctx.saved_tensors[0] + numangle = ctx.numangle + numrho = ctx.numrho + out = torch.zeros_like(feat).type_as(feat).cuda() + out = dh.backward(grad_output.contiguous(), out, feat, numangle, numrho) + grad_in = out[0] + return grad_in, None, None + + +class C_dht(torch.nn.Module): + def __init__(self, numAngle, numRho): + super(C_dht, self).__init__() + self.numAngle = numAngle + self.numRho = numRho + + def forward(self, feat): + return C_dht_Function.apply(feat, self.numAngle, self.numRho) + + diff --git a/model/_cdht/setup.py b/model/_cdht/setup.py new file mode 100755 index 0000000..7ac3fce --- /dev/null +++ b/model/_cdht/setup.py @@ -0,0 +1,15 @@ +from setuptools import setup +from torch.utils.cpp_extension import BuildExtension, CppExtension, CUDAExtension + +setup( + name='deep_hough', + ext_modules=[ + CUDAExtension('deep_hough', [ + 'deep_hough_cuda.cpp', + 'deep_hough_cuda_kernel.cu', + ], + extra_compile_args={'cxx': ['-g'], 'nvcc': ['-arch=sm_60']}) + ], + cmdclass={ + 'build_ext': BuildExtension + }) diff --git a/model/backbone/fpn.py b/model/backbone/fpn.py new file mode 100755 index 0000000..6ac7a77 --- /dev/null +++ b/model/backbone/fpn.py @@ -0,0 +1,273 @@ +import math +import torch.nn as nn +import torch.utils.model_zoo as model_zoo + +def conv3x3(in_planes, out_planes, stride=1, groups=1, dilation=1): + """3x3 convolution with padding""" + return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, + padding=dilation, groups=groups, bias=False, dilation=dilation) + + +def conv1x1(in_planes, out_planes, stride=1): + """1x1 convolution""" + return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False) + + +class BasicBlock(nn.Module): + expansion = 1 + + def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, BatchNorm=None, groups=1, + base_width=64): + super(BasicBlock, self).__init__() + if BatchNorm is None: + BatchNorm = nn.BatchNorm2d + if groups != 1 or base_width != 64: + raise ValueError('BasicBlock only supports groups=1 and base_width=64') + if dilation > 1: + raise NotImplementedError("Dilation > 1 not supported in BasicBlock") + # Both self.conv1 and self.downsample layers downsample the input when stride != 1 + self.conv1 = conv3x3(inplanes, planes, stride) + self.bn1 = BatchNorm(planes) + self.relu = nn.ReLU(inplace=True) + self.conv2 = conv3x3(planes, planes) + self.bn2 = BatchNorm(planes) + self.downsample = downsample + self.stride = stride + + def forward(self, x): + identity = x + + out = self.conv1(x) + out = self.bn1(out) + out = self.relu(out) + + out = self.conv2(out) + out = self.bn2(out) + + if self.downsample is not None: + identity = self.downsample(x) + + out += identity + out = self.relu(out) + + return out + +class Bottleneck(nn.Module): + expansion = 4 + + def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, BatchNorm=None, groups=1, + base_width=64): + super(Bottleneck, self).__init__() + width = int(planes * (base_width / 64.)) * groups + self.conv1 = nn.Conv2d(inplanes, width, kernel_size=1, bias=False) + self.bn1 = BatchNorm(width) + self.conv2 = nn.Conv2d(width, width, kernel_size=3, stride=stride, + dilation=dilation, padding=dilation, bias=False, groups=groups) + self.bn2 = BatchNorm(width) + self.conv3 = nn.Conv2d(width, planes * 4, kernel_size=1, bias=False) + self.bn3 = BatchNorm(planes * 4) + self.relu = nn.ReLU(inplace=True) + self.downsample = downsample + self.stride = stride + self.dilation = dilation + + def forward(self, x): + residual = x + + out = self.conv1(x) + out = self.bn1(out) + out = self.relu(out) + + out = self.conv2(out) + out = self.bn2(out) + out = self.relu(out) + + out = self.conv3(out) + out = self.bn3(out) + + if self.downsample is not None: + residual = self.downsample(x) + + out += residual + out = self.relu(out) + + return out + +class ResNet(nn.Module): + + def __init__(self, arch, block, layers, output_stride, BatchNorm, pretrained=True): + self.inplanes = 64 + self.layers = layers + self.arch = arch + super(ResNet, self).__init__() + blocks = [1, 2, 4] + if output_stride == 16: + strides = [1, 2, 2, 1] + dilations = [1, 1, 1, 2] + elif output_stride == 8: + strides = [1, 2, 1, 1] + dilations = [1, 1, 2, 4] + else: + strides = [1, 2, 2, 2] + dilations = [1, 1, 1, 1] + + if arch == 'resnext50': + self.base_width = 4 + self.groups = 32 + else: + self.base_width = 64 + self.groups = 1 + + # Modules + self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, + bias=False) + self.bn1 = BatchNorm(64) + self.relu = nn.ReLU(inplace=True) + self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1) + + self.layer1 = self._make_layer(block, 64, layers[0], stride=strides[0], dilation=dilations[0], BatchNorm=BatchNorm) + self.layer2 = self._make_layer(block, 128, layers[1], stride=strides[1], dilation=dilations[1], BatchNorm=BatchNorm) + self.layer3 = self._make_layer(block, 256, layers[2], stride=strides[2], dilation=dilations[2], BatchNorm=BatchNorm) + if self.arch == 'resnet18': + self.layer4 = self._make_layer(block, 512, layers[3], stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm) + else: + self.layer4 = self._make_MG_unit(block, 512, blocks=blocks, stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm) + # self.layer4 = self._make_layer(block, 512, layers[3], stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm) + + if self.arch == 'resnet18': + self.toplayer = nn.Conv2d(512, 256, kernel_size=1, stride=1, padding=0) + self.latlayer1 = nn.Conv2d(256, 256, kernel_size=1, stride=1, padding=0) + self.latlayer2 = nn.Conv2d( 128, 256, kernel_size=1, stride=1, padding=0) + self.latlayer3 = nn.Conv2d( 64, 256, kernel_size=1, stride=1, padding=0) + else: + self.toplayer = nn.Conv2d(2048, 256, kernel_size=1, stride=1, padding=0) + self.latlayer1 = nn.Conv2d(1024, 256, kernel_size=1, stride=1, padding=0) + self.latlayer2 = nn.Conv2d( 512, 256, kernel_size=1, stride=1, padding=0) + self.latlayer3 = nn.Conv2d( 256, 256, kernel_size=1, stride=1, padding=0) + + self.smooth1 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + self.smooth2 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + self.smooth3 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + + self._init_weight() + + if pretrained: + self._load_pretrained_model() + + def _make_layer(self, block, planes, blocks, stride=1, dilation=1, BatchNorm=None): + downsample = None + if stride != 1 or self.inplanes != planes * block.expansion: + downsample = nn.Sequential( + nn.Conv2d(self.inplanes, planes * block.expansion, + kernel_size=1, stride=stride, bias=False), + BatchNorm(planes * block.expansion), + ) + + layers = [] + layers.append(block(self.inplanes, planes, stride, dilation, downsample, BatchNorm, groups=self.groups, base_width=self.base_width)) + self.inplanes = planes * block.expansion + for i in range(1, blocks): + layers.append(block(self.inplanes, planes, dilation=dilation, BatchNorm=BatchNorm, groups=self.groups, base_width=self.base_width)) + + return nn.Sequential(*layers) + + def _make_MG_unit(self, block, planes, blocks, stride=1, dilation=1, BatchNorm=None): + downsample = None + if stride != 1 or self.inplanes != planes * block.expansion: + downsample = nn.Sequential( + nn.Conv2d(self.inplanes, planes * block.expansion, + kernel_size=1, stride=stride, bias=False), + BatchNorm(planes * block.expansion), + ) + + layers = [] + layers.append(block(self.inplanes, planes, stride, dilation=blocks[0]*dilation, + downsample=downsample, BatchNorm=BatchNorm, groups=self.groups, base_width=self.base_width)) + self.inplanes = planes * block.expansion + for i in range(1, len(blocks)): + layers.append(block(self.inplanes, planes, stride=1, + dilation=blocks[i]*dilation, BatchNorm=BatchNorm, groups=self.groups, base_width=self.base_width)) + + return nn.Sequential(*layers) + + def forward(self, input): + # Bottom-up + x = self.conv1(input) + x = self.bn1(x) + x = self.relu(x) + c1 = self.maxpool(x) + c2 = self.layer1(c1) # x4 + c3 = self.layer2(c2) #x8 + c4 = self.layer3(c3) #x16 + c5 = self.layer4(c4) #x16 + # Top-down + p5 = self.toplayer(c5) + p4 = nn.functional.upsample(p5, size=c4.size()[2:], mode='bilinear') + self.latlayer1(c4) + p3 = nn.functional.upsample(p4, size=c3.size()[2:], mode='bilinear') + self.latlayer2(c3) + p2 = nn.functional.upsample(p3, size=c2.size()[2:], mode='bilinear') + self.latlayer3(c2) + + p4 = self.smooth1(p4) + p3 = self.smooth2(p3) + p2 = self.smooth3(p2) + + return p2, p3, p4, p5 + + def _init_weight(self): + for m in self.modules(): + if isinstance(m, nn.Conv2d): + n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels + m.weight.data.normal_(0, math.sqrt(2. / n)) + elif isinstance(m, nn.BatchNorm2d): + m.weight.data.fill_(1) + m.bias.data.zero_() + + def _load_pretrained_model(self): + if self.arch == 'resnet101': + pretrain_dict = model_zoo.load_url('https://download.pytorch.org/models/resnet101-5d3b4d8f.pth') + elif self.arch == 'resnet50': + pretrain_dict = model_zoo.load_url('https://download.pytorch.org/models/resnet50-19c8e357.pth') + elif self.arch == 'resnet18': + pretrain_dict = model_zoo.load_url('https://download.pytorch.org/models/resnet18-5c106cde.pth') + elif self.arch == 'resnext50': + pretrain_dict = model_zoo.load_url('https://download.pytorch.org/models/resnext50_32x4d-7cdf4587.pth') + model_dict = {} + state_dict = self.state_dict() + for k, v in pretrain_dict.items(): + if k in state_dict: + model_dict[k] = v + state_dict.update(model_dict) + self.load_state_dict(state_dict) + +def FPN101(output_stride, BatchNorm=nn.BatchNorm2d, pretrained=True): + """Constructs a ResNet-101 model. + Args: + pretrained (bool): If True, returns a model pre-trained on ImageNet + """ + model = ResNet('resnet101', Bottleneck, [3, 4, 23, 3], output_stride, BatchNorm, pretrained=pretrained) + return model + +def FPN50(output_stride, BatchNorm=nn.BatchNorm2d, pretrained=True): + """Constructs a ResNet-50 model. + Args: + pretrained (bool): If True, returns a model pre-trained on ImageNet + """ + model = ResNet('resnet50', Bottleneck, [3, 4, 6, 3], output_stride, BatchNorm, pretrained=pretrained) + return model + +def FPN18(output_stride, BatchNorm=nn.BatchNorm2d, pretrained=True): + model = ResNet('resnet18', BasicBlock, [2, 2, 2, 2], output_stride, BatchNorm, pretrained=pretrained) + return model + +def ResNext50_FPN(output_stride, BatchNorm=nn.BatchNorm2d, pretrained=True): + model = ResNet('resnext50', Bottleneck, [3, 4, 6, 3], output_stride, BatchNorm, pretrained=pretrained) + return model + +if __name__ == "__main__": + import torch + model = FPN101(BatchNorm=nn.BatchNorm2d, pretrained=True, output_stride=8) + input = torch.rand(1, 3, 480, 640) + output = model(input) + for out in output: + print(out.size()) + # print(low_level_feat.size()) + diff --git a/model/backbone/mobilenet.py b/model/backbone/mobilenet.py new file mode 100755 index 0000000..b64106d --- /dev/null +++ b/model/backbone/mobilenet.py @@ -0,0 +1,194 @@ +from torch import nn +import torch.utils.model_zoo as model_zoo + +def _make_divisible(v, divisor, min_value=None): + """ + This function is taken from the original tf repo. + It ensures that all layers have a channel number that is divisible by 8 + It can be seen here: + https://github.com/tensorflow/models/blob/master/research/slim/nets/mobilenet/mobilenet.py + :param v: + :param divisor: + :param min_value: + :return: + """ + if min_value is None: + min_value = divisor + new_v = max(min_value, int(v + divisor / 2) // divisor * divisor) + # Make sure that round down does not go down by more than 10%. + if new_v < 0.9 * v: + new_v += divisor + return new_v + + +class ConvBNReLU(nn.Sequential): + def __init__(self, in_planes, out_planes, kernel_size=3, stride=1, groups=1): + padding = (kernel_size - 1) // 2 + super(ConvBNReLU, self).__init__( + nn.Conv2d(in_planes, out_planes, kernel_size, stride, padding, groups=groups, bias=False), + nn.BatchNorm2d(out_planes), + nn.ReLU6(inplace=True) + ) + + +class InvertedResidual(nn.Module): + def __init__(self, inp, oup, stride, expand_ratio): + super(InvertedResidual, self).__init__() + self.stride = stride + assert stride in [1, 2] + + hidden_dim = int(round(inp * expand_ratio)) + self.use_res_connect = self.stride == 1 and inp == oup + + layers = [] + if expand_ratio != 1: + # pw + layers.append(ConvBNReLU(inp, hidden_dim, kernel_size=1)) + layers.extend([ + # dw + ConvBNReLU(hidden_dim, hidden_dim, stride=stride, groups=hidden_dim), + # pw-linear + nn.Conv2d(hidden_dim, oup, 1, 1, 0, bias=False), + nn.BatchNorm2d(oup), + ]) + self.conv = nn.Sequential(*layers) + + def forward(self, x): + if self.use_res_connect: + return x + self.conv(x) + else: + return self.conv(x) + + +class MobileNetV2(nn.Module): + def __init__(self, pretrained=True): + """ + MobileNet V2 main class + Args: + num_classes (int): Number of classes + width_mult (float): Width multiplier - adjusts number of channels in each layer by this amount + inverted_residual_setting: Network structure + round_nearest (int): Round the number of channels in each layer to be a multiple of this number + Set to 1 to turn off rounding + block: Module specifying inverted residual building block for mobilenet + """ + super(MobileNetV2, self).__init__() + + + block = InvertedResidual + input_channel = 32 + last_channel = 1280 + width_mult = 1.0 + round_nearest=8 + + inverted_residual_setting = [ + # t, c, n, s + [1, 16, 1, 1], + [6, 24, 2, 2], + [6, 32, 3, 2], + [6, 64, 4, 2], + [6, 96, 3, 1], + [6, 160, 3, 2], + [6, 320, 1, 1], + ] + + # only check the first element, assuming user knows t,c,n,s are required + if len(inverted_residual_setting) == 0 or len(inverted_residual_setting[0]) != 4: + raise ValueError("inverted_residual_setting should be non-empty " + "or a 4-element list, got {}".format(inverted_residual_setting)) + + # building first layer + input_channel = _make_divisible(input_channel * width_mult, round_nearest) + self.last_channel = _make_divisible(last_channel * max(1.0, width_mult), round_nearest) + features = [ConvBNReLU(3, input_channel, stride=2)] + # building inverted residual blocks + for t, c, n, s in inverted_residual_setting: + output_channel = _make_divisible(c * width_mult, round_nearest) + for i in range(n): + stride = s if i == 0 else 1 + features.append(block(input_channel, output_channel, stride, expand_ratio=t)) + input_channel = output_channel + # building last several layers + features.append(ConvBNReLU(input_channel, self.last_channel, kernel_size=1)) + # make it nn.Sequential + self.features = nn.Sequential(*features) + + # building classifier + # self.classifier = nn.Sequential( + # nn.Dropout(0.2), + # nn.Linear(self.last_channel, num_classes), + # ) + + self.toplayer = nn.Conv2d(160, 32, kernel_size=1, stride=1, padding=0) + + self.latlayer1 = nn.Conv2d(64, 32, kernel_size=1, stride=1, padding=0) + self.latlayer2 = nn.Conv2d( 32, 32, kernel_size=1, stride=1, padding=0) + self.latlayer3 = nn.Conv2d( 24, 32, kernel_size=1, stride=1, padding=0) + + self.smooth1 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=1) + self.smooth2 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=1) + self.smooth3 = nn.Conv2d(32, 32, kernel_size=3, stride=1, padding=1) + + self.fpn_selected = [2, 5, 9, 15] + # weight initialization + for m in self.modules(): + if isinstance(m, nn.Conv2d): + nn.init.kaiming_normal_(m.weight, mode='fan_out') + if m.bias is not None: + nn.init.zeros_(m.bias) + elif isinstance(m, nn.BatchNorm2d): + nn.init.ones_(m.weight) + nn.init.zeros_(m.bias) + elif isinstance(m, nn.Linear): + nn.init.normal_(m.weight, 0, 0.01) + nn.init.zeros_(m.bias) + + if pretrained: + self._load_pretrained_model() + + def _forward_impl(self, x): + # This exists since TorchScript doesn't support inheritance, so the superclass method + # (this one) needs to have a name other than `forward` that can be accessed in a subclass + fpn_features = [] + for i, f in enumerate(self.features): + x = f(x) + if i in self.fpn_selected: + fpn_features.append(x) + c2, c3, c4, c5 = fpn_features + # Top-down + p5 = self.toplayer(c5) + p4 = nn.functional.upsample(p5, size=c4.size()[2:], mode='bilinear', align_corners=True) + self.latlayer1(c4) + p3 = nn.functional.upsample(p4, size=c3.size()[2:], mode='bilinear', align_corners=True) + self.latlayer2(c3) + p2 = nn.functional.upsample(p3, size=c2.size()[2:], mode='bilinear', align_corners=True) + self.latlayer3(c2) + + p4 = self.smooth1(p4) + p3 = self.smooth2(p3) + p2 = self.smooth3(p2) + + return p2, p3, p4, p5 + # x = self.features(x) + # Cannot use "squeeze" as batch-size can be 1 => must use reshape with x.shape[0] + # x = nn.functional.adaptive_avg_pool2d(x, 1).reshape(x.shape[0], -1) + # x = self.classifier(x) + # return x + + def forward(self, x): + return self._forward_impl(x) + + def _load_pretrained_model(self): + pretrain_dict = model_zoo.load_url('https://download.pytorch.org/models/mobilenet_v2-b0353104.pth') + model_dict = {} + state_dict = self.state_dict() + for k, v in pretrain_dict.items(): + if k in state_dict: + model_dict[k] = v + state_dict.update(model_dict) + self.load_state_dict(state_dict) + +def MobileNet_FPN(output_stride=None, BatchNorm=nn.BatchNorm2d, pretrained=True): + """Constructs a ResNet-101 model. + Args: + pretrained (bool): If True, returns a model pre-trained on ImageNet + """ + model = MobileNetV2(pretrained=pretrained) + return model diff --git a/model/backbone/res2net.py b/model/backbone/res2net.py new file mode 100755 index 0000000..ec25330 --- /dev/null +++ b/model/backbone/res2net.py @@ -0,0 +1,181 @@ +import torch.nn as nn +import math +import torch.utils.model_zoo as model_zoo +import torch +import torch.nn.functional as F +__all__ = ['Res2Net', 'res2net50'] + +class Bottle2neck(nn.Module): + expansion = 4 + + def __init__(self, inplanes, planes, stride=1, downsample=None, baseWidth=26, scale = 4, stype='normal'): + """ Constructor + Args: + inplanes: input channel dimensionality + planes: output channel dimensionality + stride: conv stride. Replaces pooling layer. + downsample: None when stride = 1 + baseWidth: basic width of conv3x3 + scale: number of scale. + type: 'normal': normal set. 'stage': first block of a new stage. + """ + super(Bottle2neck, self).__init__() + + width = int(math.floor(planes * (baseWidth/64.0))) + self.conv1 = nn.Conv2d(inplanes, width*scale, kernel_size=1, bias=False) + self.bn1 = nn.BatchNorm2d(width*scale) + + if scale == 1: + self.nums = 1 + else: + self.nums = scale -1 + if stype == 'stage': + self.pool = nn.AvgPool2d(kernel_size=3, stride = stride, padding=1) + convs = [] + bns = [] + for i in range(self.nums): + convs.append(nn.Conv2d(width, width, kernel_size=3, stride = stride, padding=1, bias=False)) + bns.append(nn.BatchNorm2d(width)) + self.convs = nn.ModuleList(convs) + self.bns = nn.ModuleList(bns) + + self.conv3 = nn.Conv2d(width*scale, planes * self.expansion, kernel_size=1, bias=False) + self.bn3 = nn.BatchNorm2d(planes * self.expansion) + + self.relu = nn.ReLU(inplace=True) + self.downsample = downsample + self.stype = stype + self.scale = scale + self.width = width + + def forward(self, x): + residual = x + + out = self.conv1(x) + out = self.bn1(out) + out = self.relu(out) + + spx = torch.split(out, self.width, 1) + for i in range(self.nums): + if i==0 or self.stype=='stage': + sp = spx[i] + else: + sp = sp + spx[i] + sp = self.convs[i](sp) + sp = self.relu(self.bns[i](sp)) + if i==0: + out = sp + else: + out = torch.cat((out, sp), 1) + if self.scale != 1 and self.stype=='normal': + out = torch.cat((out, spx[self.nums]),1) + elif self.scale != 1 and self.stype=='stage': + out = torch.cat((out, self.pool(spx[self.nums])),1) + + out = self.conv3(out) + out = self.bn3(out) + + if self.downsample is not None: + residual = self.downsample(x) + + out += residual + out = self.relu(out) + + return out + +class Res2Net(nn.Module): + + def __init__(self, block, layers, baseWidth = 26, scale = 4, num_classes=1000): + self.inplanes = 64 + super(Res2Net, self).__init__() + self.baseWidth = baseWidth + self.scale = scale + self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, + bias=False) + self.bn1 = nn.BatchNorm2d(64) + self.relu = nn.ReLU(inplace=True) + self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1) + self.layer1 = self._make_layer(block, 64, layers[0]) + self.layer2 = self._make_layer(block, 128, layers[1], stride=2) + self.layer3 = self._make_layer(block, 256, layers[2], stride=2) + self.layer4 = self._make_layer(block, 512, layers[3], stride=2) + + self.toplayer = nn.Conv2d(2048, 256, kernel_size=1, stride=1, padding=0) + self.latlayer1 = nn.Conv2d(1024, 256, kernel_size=1, stride=1, padding=0) + self.latlayer2 = nn.Conv2d( 512, 256, kernel_size=1, stride=1, padding=0) + self.latlayer3 = nn.Conv2d( 256, 256, kernel_size=1, stride=1, padding=0) + + self.smooth1 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + self.smooth2 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + self.smooth3 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + + for m in self.modules(): + if isinstance(m, nn.Conv2d): + nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu') + elif isinstance(m, nn.BatchNorm2d): + nn.init.constant_(m.weight, 1) + nn.init.constant_(m.bias, 0) + + self._load_pretrained_model() + + def _make_layer(self, block, planes, blocks, stride=1): + downsample = None + if stride != 1 or self.inplanes != planes * block.expansion: + downsample = nn.Sequential( + nn.Conv2d(self.inplanes, planes * block.expansion, + kernel_size=1, stride=stride, bias=False), + nn.BatchNorm2d(planes * block.expansion), + ) + + layers = [] + layers.append(block(self.inplanes, planes, stride, downsample=downsample, + stype='stage', baseWidth = self.baseWidth, scale=self.scale)) + self.inplanes = planes * block.expansion + for i in range(1, blocks): + layers.append(block(self.inplanes, planes, baseWidth = self.baseWidth, scale=self.scale)) + + return nn.Sequential(*layers) + + def forward(self, input): + # Bottom-up + x = self.conv1(input) + x = self.bn1(x) + x = self.relu(x) + c1 = self.maxpool(x) + c2 = self.layer1(c1) # x4 + c3 = self.layer2(c2) #x8 + c4 = self.layer3(c3) #x16 + c5 = self.layer4(c4) #x32 + # Top-down + p5 = self.toplayer(c5) + p4 = nn.functional.upsample(p5, size=c4.size()[2:], mode='bilinear') + self.latlayer1(c4) + p3 = nn.functional.upsample(p4, size=c3.size()[2:], mode='bilinear') + self.latlayer2(c3) + p2 = nn.functional.upsample(p3, size=c2.size()[2:], mode='bilinear') + self.latlayer3(c2) + + p4 = self.smooth1(p4) + p3 = self.smooth2(p3) + p2 = self.smooth3(p2) + + return p2, p3, p4, p5 + + def _load_pretrained_model(self): + + pretrain_dict = model_zoo.load_url('https://shanghuagao.oss-cn-beijing.aliyuncs.com/res2net/res2net50_26w_4s-06e79181.pth') + model_dict = {} + state_dict = self.state_dict() + for k, v in pretrain_dict.items(): + if k in state_dict: + model_dict[k] = v + state_dict.update(model_dict) + self.load_state_dict(state_dict) + +def res2net50_FPN(pretrained=True, **kwargs): + """Constructs a Res2Net-50 model. + Res2Net-50 refers to the Res2Net-50_26w_4s. + Args: + pretrained (bool): If True, returns a model pre-trained on ImageNet + """ + model = Res2Net(Bottle2neck, [3, 4, 6, 3], baseWidth = 26, scale = 4, **kwargs) + + return model + diff --git a/model/backbone/resnet.py b/model/backbone/resnet.py new file mode 100755 index 0000000..90512f1 --- /dev/null +++ b/model/backbone/resnet.py @@ -0,0 +1,165 @@ +import math +import torch.nn as nn +import torch.utils.model_zoo as model_zoo + +class Bottleneck(nn.Module): + expansion = 4 + + def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, BatchNorm=None): + super(Bottleneck, self).__init__() + self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False) + self.bn1 = BatchNorm(planes) + self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, + dilation=dilation, padding=dilation, bias=False) + self.bn2 = BatchNorm(planes) + self.conv3 = nn.Conv2d(planes, planes * 4, kernel_size=1, bias=False) + self.bn3 = BatchNorm(planes * 4) + self.relu = nn.ReLU(inplace=True) + self.downsample = downsample + self.stride = stride + self.dilation = dilation + + def forward(self, x): + residual = x + + out = self.conv1(x) + out = self.bn1(out) + out = self.relu(out) + + out = self.conv2(out) + out = self.bn2(out) + out = self.relu(out) + + out = self.conv3(out) + out = self.bn3(out) + + if self.downsample is not None: + residual = self.downsample(x) + + out += residual + out = self.relu(out) + + return out + +class ResNet(nn.Module): + + def __init__(self, block, layers, output_stride, BatchNorm, pretrained=True): + self.inplanes = 64 + super(ResNet, self).__init__() + blocks = [1, 2, 4] + if output_stride == 16: + strides = [1, 2, 2, 1] + dilations = [1, 1, 1, 2] + elif output_stride == 8: + strides = [1, 2, 1, 1] + dilations = [1, 1, 2, 4] + else: + raise NotImplementedError + + # Modules + self.conv1 = nn.Conv2d(3, 64, kernel_size=7, stride=2, padding=3, + bias=False) + self.bn1 = BatchNorm(64) + self.relu = nn.ReLU(inplace=True) + self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1) + + self.layer1 = self._make_layer(block, 64, layers[0], stride=strides[0], dilation=dilations[0], BatchNorm=BatchNorm) + self.layer2 = self._make_layer(block, 128, layers[1], stride=strides[1], dilation=dilations[1], BatchNorm=BatchNorm) + self.layer3 = self._make_layer(block, 256, layers[2], stride=strides[2], dilation=dilations[2], BatchNorm=BatchNorm) + self.layer4 = self._make_MG_unit(block, 512, blocks=blocks, stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm) + # self.layer4 = self._make_layer(block, 512, layers[3], stride=strides[3], dilation=dilations[3], BatchNorm=BatchNorm) + self._init_weight() + + if pretrained: + self._load_pretrained_model() + + def _make_layer(self, block, planes, blocks, stride=1, dilation=1, BatchNorm=None): + downsample = None + if stride != 1 or self.inplanes != planes * block.expansion: + downsample = nn.Sequential( + nn.Conv2d(self.inplanes, planes * block.expansion, + kernel_size=1, stride=stride, bias=False), + BatchNorm(planes * block.expansion), + ) + + layers = [] + layers.append(block(self.inplanes, planes, stride, dilation, downsample, BatchNorm)) + self.inplanes = planes * block.expansion + for i in range(1, blocks): + layers.append(block(self.inplanes, planes, dilation=dilation, BatchNorm=BatchNorm)) + + return nn.Sequential(*layers) + + def _make_MG_unit(self, block, planes, blocks, stride=1, dilation=1, BatchNorm=None): + downsample = None + if stride != 1 or self.inplanes != planes * block.expansion: + downsample = nn.Sequential( + nn.Conv2d(self.inplanes, planes * block.expansion, + kernel_size=1, stride=stride, bias=False), + BatchNorm(planes * block.expansion), + ) + + layers = [] + layers.append(block(self.inplanes, planes, stride, dilation=blocks[0]*dilation, + downsample=downsample, BatchNorm=BatchNorm)) + self.inplanes = planes * block.expansion + for i in range(1, len(blocks)): + layers.append(block(self.inplanes, planes, stride=1, + dilation=blocks[i]*dilation, BatchNorm=BatchNorm)) + + return nn.Sequential(*layers) + + def forward(self, input): + + x = self.conv1(input) + x = self.bn1(x) + x = self.relu(x) + x = self.maxpool(x) + x = self.layer1(x) # x4 + x = self.layer2(x) #x8 + x = self.layer3(x) #x16 + x = self.layer4(x) #x16 + return x + + def _init_weight(self): + for m in self.modules(): + if isinstance(m, nn.Conv2d): + n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels + m.weight.data.normal_(0, math.sqrt(2. / n)) + elif isinstance(m, nn.BatchNorm2d): + m.weight.data.fill_(1) + m.bias.data.zero_() + + def _load_pretrained_model(self): + pretrain_dict = model_zoo.load_url('https://download.pytorch.org/models/resnet101-5d3b4d8f.pth') + model_dict = {} + state_dict = self.state_dict() + for k, v in pretrain_dict.items(): + if k in state_dict: + model_dict[k] = v + state_dict.update(model_dict) + self.load_state_dict(state_dict) + +def ResNet101(output_stride, BatchNorm=nn.BatchNorm2d, pretrained=True): + """Constructs a ResNet-101 model. + Args: + pretrained (bool): If True, returns a model pre-trained on ImageNet + """ + model = ResNet(Bottleneck, [3, 4, 23, 3], output_stride, BatchNorm, pretrained=pretrained) + return model + +def ResNet50(output_stride, BatchNorm=nn.BatchNorm2d, pretrained=True): + """Constructs a ResNet-101 model. + Args: + pretrained (bool): If True, returns a model pre-trained on ImageNet + """ + model = ResNet(Bottleneck, [3, 4, 6, 3], output_stride, BatchNorm, pretrained=pretrained) + return model + +if __name__ == "__main__": + import torch + model = ResNet101(BatchNorm=nn.BatchNorm2d, pretrained=True, output_stride=8) + input = torch.rand(1, 3, 480, 640) + output = model(input) + print(output.size()) + # print(low_level_feat.size()) \ No newline at end of file diff --git a/model/backbone/vgg_fpn.py b/model/backbone/vgg_fpn.py new file mode 100755 index 0000000..b972d48 --- /dev/null +++ b/model/backbone/vgg_fpn.py @@ -0,0 +1,79 @@ +import torch +import math +from torch import nn + +# vgg16 +vgg_config = [64, 64, 'M', 128, 128, 'M', 256, 256, 256, 'M', 512, 512, 512, 'M', 512, 512, 512, 'M'] + +def vgg(cfg, i=3, batch_norm=False): + layers = [] + in_channels = i + for v in cfg: + if v == 'M': + layers += [nn.MaxPool2d(kernel_size=2, stride=2)] + else: + conv2d = nn.Conv2d(in_channels, v, kernel_size=3, padding=1) + if batch_norm: + layers += [conv2d, nn.BatchNorm2d(v), nn.ReLU(inplace=True)] + else: + layers += [conv2d, nn.ReLU(inplace=True)] + in_channels = v + return layers + +class VGG_Feature(nn.Module): + def __init__(self, extract=[8, 15, 22, 29]): + super(VGG_Feature, self).__init__() + self.vgg = nn.ModuleList(vgg(cfg=vgg_config)) + self.extract = extract + + def forward(self, x): + features = [] + for i in range(len(self.vgg)): + x = self.vgg[i](x) + if i in self.extract: + features.append(x) + return features + +class VGG_FPN(nn.Module): + def __init__(self): + super(VGG_FPN, self).__init__() + self.vgg_feat = VGG_Feature() + + self.toplayer = nn.Conv2d(512, 256, kernel_size=1, stride=1, padding=0) + + self.latlayer1 = nn.Conv2d(512, 256, kernel_size=1, stride=1, padding=0) + self.latlayer2 = nn.Conv2d( 256, 256, kernel_size=1, stride=1, padding=0) + self.latlayer3 = nn.Conv2d( 128, 256, kernel_size=1, stride=1, padding=0) + + self.smooth1 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + self.smooth2 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + self.smooth3 = nn.Conv2d(256, 256, kernel_size=3, stride=1, padding=1) + + self._init_weight() + self._load_pretrained_model() + + def forward(self, x): + [c2, c3, c4, c5] = self.vgg_feat(x) + # Top-down + p5 = self.toplayer(c5) + p4 = nn.functional.upsample(p5, size=c4.size()[2:], mode='bilinear') + self.latlayer1(c4) + p3 = nn.functional.upsample(p4, size=c3.size()[2:], mode='bilinear') + self.latlayer2(c3) + p2 = nn.functional.upsample(p3, size=c2.size()[2:], mode='bilinear') + self.latlayer3(c2) + + p4 = self.smooth1(p4) + p3 = self.smooth2(p3) + p2 = self.smooth3(p2) + + return p2, p3, p4, p5 + + def _init_weight(self): + for m in self.modules(): + if isinstance(m, nn.Conv2d): + n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels + m.weight.data.normal_(0, math.sqrt(2. / n)) + elif isinstance(m, nn.BatchNorm2d): + m.weight.data.fill_(1) + m.bias.data.zero_() + + def _load_pretrained_model(self): + self.vgg_feat.vgg.load_state_dict(torch.load('/home/hanqi/vgg16_feat.pth')) \ No newline at end of file diff --git a/model/dht.py b/model/dht.py new file mode 100755 index 0000000..6514127 --- /dev/null +++ b/model/dht.py @@ -0,0 +1,37 @@ +import torch +import torch.nn as nn +import numpy as np +from model._cdht.dht_func import C_dht + +class DHT_Layer(nn.Module): + def __init__(self, input_dim, dim, numAngle, numRho): + super(DHT_Layer, self).__init__() + self.fist_conv = nn.Sequential( + nn.Conv2d(input_dim, dim, 1), + nn.BatchNorm2d(dim), + nn.ReLU() + ) + self.dht = DHT(numAngle=numAngle, numRho=numRho) + self.convs = nn.Sequential( + nn.Conv2d(dim, dim, 3, 1, 1), + nn.BatchNorm2d(dim), + nn.ReLU(), + nn.Conv2d(dim, dim, 3, 1, 1), + nn.BatchNorm2d(dim), + nn.ReLU() + ) + def forward(self, x): + x = self.fist_conv(x) + x = self.dht(x) + x = self.convs(x) + return x + +class DHT(nn.Module): + def __init__(self, numAngle, numRho): + super(DHT, self).__init__() + self.line_agg = C_dht(numAngle, numRho) + + def forward(self, x): + accum = self.line_agg(x) + return accum + diff --git a/model/network.py b/model/network.py new file mode 100755 index 0000000..f02e8a4 --- /dev/null +++ b/model/network.py @@ -0,0 +1,79 @@ +import torch +import numpy as np +import torch.nn as nn + +from model.backbone.fpn import FPN101, FPN50, FPN18, ResNext50_FPN +from model.backbone.mobilenet import MobileNet_FPN +from model.backbone.vgg_fpn import VGG_FPN +from model.backbone.res2net import res2net50_FPN + +from model.dht import DHT_Layer + +class Net(nn.Module): + def __init__(self, numAngle, numRho, backbone): + super(Net, self).__init__() + if backbone == 'resnet18': + self.backbone = FPN18(pretrained=True, output_stride=32) + output_stride = 32 + elif backbone == 'resnet50': + self.backbone = FPN50(pretrained=True, output_stride=16) + output_stride = 16 + elif backbone == 'resnet101': + self.backbone = FPN101(output_stride=16) + output_stride = 16 + elif backbone == 'resnext50': + self.backbone = ResNext50_FPN(output_stride=16) + output_stride = 16 + elif backbone == 'vgg16': + self.backbone = VGG_FPN() + output_stride = 16 + elif backbone == 'mobilenetv2': + self.backbone = MobileNet_FPN() + output_stride = 32 + elif backbone == 'res2net50': + self.backbone = res2net50_FPN() + output_stride = 32 + else: + raise ValueError(f"Invalid value of 'backbone'.{backbone}") + + if backbone == 'mobilenetv2': + self.dht_detector1 = DHT_Layer(32, 32, numAngle=numAngle, numRho=numRho) + self.dht_detector2 = DHT_Layer(32, 32, numAngle=numAngle, numRho=numRho // 2) + self.dht_detector3 = DHT_Layer(32, 32, numAngle=numAngle, numRho=numRho // 4) + self.dht_detector4 = DHT_Layer(32, 32, numAngle=numAngle, numRho=numRho // (output_stride // 4)) + + self.last_conv = nn.Sequential( + nn.Conv2d(128, 1, 1) + ) + else: + self.dht_detector1 = DHT_Layer(256, 128, numAngle=numAngle, numRho=numRho) + self.dht_detector2 = DHT_Layer(256, 128, numAngle=numAngle, numRho=numRho // 2) + self.dht_detector3 = DHT_Layer(256, 128, numAngle=numAngle, numRho=numRho // 4) + self.dht_detector4 = DHT_Layer(256, 128, numAngle=numAngle, numRho=numRho // (output_stride // 4)) + + self.last_conv = nn.Sequential( + nn.Conv2d(512, 1, 1) + ) + + self.numAngle = numAngle + self.numRho = numRho + + def upsample_cat(self, p1, p2, p3, p4): + p1 = nn.functional.interpolate(p1, size=(self.numAngle, self.numRho), mode='bilinear') + p2 = nn.functional.interpolate(p2, size=(self.numAngle, self.numRho), mode='bilinear') + p3 = nn.functional.interpolate(p3, size=(self.numAngle, self.numRho), mode='bilinear') + p4 = nn.functional.interpolate(p4, size=(self.numAngle, self.numRho), mode='bilinear') + return torch.cat([p1, p2, p3, p4], dim=1) + + def forward(self, x): + p1, p2, p3, p4 = self.backbone(x) + + p1 = self.dht_detector1(p1) + p2 = self.dht_detector2(p2) + p3 = self.dht_detector3(p3) + p4 = self.dht_detector4(p4) + + cat = self.upsample_cat(p1, p2, p3, p4) + logist = self.last_conv(cat) + + return logist diff --git a/pipeline.png b/pipeline.png new file mode 100755 index 0000000..4db8446 Binary files /dev/null and b/pipeline.png differ diff --git a/train.py b/train.py new file mode 100755 index 0000000..3f81c66 --- /dev/null +++ b/train.py @@ -0,0 +1,177 @@ +import os +import time +import yaml +import logging +import argparse +import numpy as np +import plotext.plot as plx + +import torch +from torch.utils.data import DataLoader +from torch import optim +from skimage.measure import label, regionprops + +from data.TestPaper_dataset.testpaperdataset import TestPaper +from dataloader import get_loader +from model.network import Net +from utils.avgmeter import AverageMeter +from utils.misc import reverse_mapping, visulize_mapping, get_boundary_point + +def train(args): + # CONFIGS = yaml.load(open(args.config)) # deprecated + + # Set device + if torch.cuda.is_available(): + os.environ["CUDA_VISIBLE_DEVICES"] = args.device.strip() + device = torch.device("cuda") + else: + device = torch.device("cpu") # Not suggested + + # Set save folder & logging config + subfolder = time.strftime("%Y-%m-%d-%H-%M-%S",time.localtime(time.time())) + if not args.save_folder or (not os.path.isdir(args.save_folder)): + print("Warning: Not invalid value of 'save_folder', set as default value: './save_folder'..") + save_folder = "./save_folder" + else: + save_folder = args.save_folder + if not os.path.exists(save_folder): + os.mkdir(save_folder) + save_folder = os.path.join(save_folder,subfolder) + os.mkdir(save_folder) + #TODO:logging + + # Load Dataset + trainloader = get_loader(args.train_images, args.train_file, + batch_size=args.batch_size, + num_thread=args.num_workers) + valloader = get_loader(args.val_images, args.val_file, + batch_size=args.batch_size, + num_thread=args.num_workers) + + # Init Net + model = Net(numAngle=args.num_angle, numRho=args.num_rho, backbone=args.backbone) + if args.resume: + model.load_state_dict(torch.load(args.resume)) + model = torch.nn.DataParallel(model).to(device) + + # Optimizer + optimizer = optim.Adam(model.parameters()) + + + # Loss + criterion = torch.nn.CrossEntropyLoss() + losses = AverageMeter() + + # Start Training + model.train();iter = 0 # iter id start from 1 + for epoch in range(args.max_epoch): + + for batch in trainloader: + start = time.time() + iter += 1 + img_tensor, gt_tensor = batch + optimizer.zero_grad() + # Forwarding + preds = model(img_tensor) + + + # Calculate Loss + loss = criterion(preds, gt_tensor) + loss.backward() + optimizer.step() + losses.update(loss.item(), args.batch_size) + + if iter%args.show_interval==0: + logging.info(f"Training [{epoch}/{iter}]: Loss:{loss.item()} Time:{time.time()-start:.1f}s") + + if iter%args.val_interval==0: + pass + # vallosses = AverageMeter() + # valaccs = AverageMeter() + # valstart = time.time() + # # Start Validating + # for valbatch in enumerate(valloader): + # val_img_tensor, val_label_tensor = valbatch + # # Forwarding + # preds = model(img_tensor) + # + # # Calculate Loss + # loss = criterion(preds, label_tensor) + # vallosses.update(loss.item(), args.val_batch_size) + # + # # Calculate accuracy metrics + # acc = None #TODO + # valaccs.update(acc, args.val_batch_size) + # logging.info(f"Validating: Loss:{vallosses.avg} Acc:{valaccs.avg} Time:{time.time() - valstart:.1f}s") + # + # key_points = model(img_tensor) + # key_points = torch.sigmoid(key_points) + # binary_kmap = key_points.squeeze().cpu().numpy() > args.threshold + # kmap_label = label(binary_kmap, connectivity=1) + # props = regionprops(kmap_label) + # plist = [] + # for prop in props: + # plist.append(prop.centroid) + # + # b_points = reverse_mapping(plist, numAngle=args.num_angle, numRho=args.num_rho, size=(400, 400)) + # size = (img_tensor.shape[2].item(), img_tensor.shape[3].item()) + # scale_w = size[1] / 400 + # scale_h = size[0] / 400 + # for i in range(len(b_points)): + # y1 = int(np.round(b_points[i][0] * scale_h)) + # x1 = int(np.round(b_points[i][1] * scale_w)) + # y2 = int(np.round(b_points[i][2] * scale_h)) + # x2 = int(np.round(b_points[i][3] * scale_w)) + # if x1 == x2: + # angle = -np.pi / 2 + # else: + # angle = np.arctan((y1 - y2) / (x1 - x2)) + # (x1, y1), (x2, y2) = get_boundary_point(y1, x1, angle, size[0], size[1]) + # b_points[i] = (y1, x1, y2, x2) + # + # # # Show current accuracy + # # plx.scatter(x, y, rows= 17, cols = 70) + # # plx.show() + + + +def parse_args(): + parser = argparse.ArgumentParser(description='Training Deep Hough Network') + + # Training + parser.add_argument('--device', default="0,1", type=str, help='device id(s) for data-parallel during training.') + parser.add_argument('--batch_size', default=6, type=int, help='batch size for training.') + parser.add_argument('--num_workers', default=4, type=int, help='number of workers for training.') + parser.add_argument('--max_epoch', default=800, type=int, help='number of epoches for training.') + parser.add_argument('--base_lr', default=0.001, type=float, help='learning rate at the beginning.') + parser.add_argument('--show_interval', default=50, type=int, help='steps(iters) between two training logging output.') + + parser.add_argument('--backbone', default="res2net50", type=str, help='resnet18 | resnet50 | resnet101 | resnext50 | vgg16 | mobilenetv2 | res2net50') + parser.add_argument('--num_angle', default=100, type=int, help='') + parser.add_argument('--num_rho', default=100, type=int, help='') + parser.add_argument('--threshold', default=0.01, type=float, help='') + + + # Validating + parser.add_argument('--val_batch_size', default=6, type=int, help='batch size for validating') + parser.add_argument('--val_interval', default=200, type=int, help='steps(iters) between two validating phase.') + + + # Datasets + parser.add_argument('--train_images', default="", type=str, help='') + parser.add_argument('--val_images', default="", type=str, help='') + parser.add_argument('--train_file', default="", type=str, help='') + parser.add_argument('--val_file', default="", type=str, help='') + + + # Miscs + # parser.add_argument('--config', default="./config.yml", help="default configs") + parser.add_argument('--save_folder', default="./save_folder", type=str, help='') + + + return parser.parse_args() + + +if __name__ == '__main__': + args = parse_args() + train(args) \ No newline at end of file diff --git a/utils/avgmeter.py b/utils/avgmeter.py new file mode 100755 index 0000000..81d77c0 --- /dev/null +++ b/utils/avgmeter.py @@ -0,0 +1,29 @@ +from __future__ import division, absolute_import + +__all__ = ['AverageMeter'] + + +class AverageMeter(object): + """Computes and stores the average and current value. + + Examples:: + >>> # Initialize a meter to record loss + >>> losses = AverageMeter() + >>> # Update meter after every minibatch update + >>> losses.update(loss_value, batch_size) + """ + + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + + def update(self, val, n=1): + self.val = val + self.sum += val * n + self.count += n + self.avg = self.sum / self.count \ No newline at end of file diff --git a/utils/misc.py b/utils/misc.py new file mode 100755 index 0000000..5689c16 --- /dev/null +++ b/utils/misc.py @@ -0,0 +1,62 @@ +import numpy as np +import cv2 +import os +from metric import EA_metric +from basic_ops import Line, get_boundary_point + +def reverse_mapping(point_list, numAngle, numRho, size=(32, 32)): + H, W = size + irho = int(np.sqrt(H*H + W*W) + 1) / ((numRho - 1)) + itheta = np.pi / numAngle + b_points = [] + + for (thetai, ri) in point_list: + theta = thetai * itheta + r = ri - numRho // 2 + cosi = np.cos(theta) / irho + sini = np.sin(theta) / irho + if sini == 0: + x = np.round(r / cosi + W / 2) + b_points.append((0, int(x), H-1, int(x))) + else: + angle = np.arctan(- cosi / sini) + y = np.round(r / sini + W * cosi / sini / 2 + H / 2) + p1, p2 = get_boundary_point(int(y), 0, angle, H, W) + if p1 is not None and p2 is not None: + b_points.append((p1[1], p1[0], p2[1], p2[0])) + return b_points + +def visulize_mapping(b_points, size, filename): + img = cv2.imread(filename) + #img = cv2.resize(img, size) + for (y1, x1, y2, x2) in b_points: + img = cv2.line(img, (x1, y1), (x2, y2), (255, 255, 0), thickness=3) + return img + +def caculate_precision(b_points, gt_coords, thresh=0.90): + N = len(b_points) + if N == 0: + return 0, 0 + ea = np.zeros(N, dtype=np.float32) + for i, coord_p in enumerate(b_points): + if coord_p[0]==coord_p[2] and coord_p[1]==coord_p[3]: + continue + l_pred = Line(list(coord_p)) + for coord_g in gt_coords: + l_gt = Line(list(coord_g)) + ea[i] = max(ea[i], EA_metric(l_pred, l_gt)) + return (ea >= thresh).sum(), N + +def caculate_recall(b_points, gt_coords, thresh=0.90): + N = len(gt_coords) + if N == 0: + return 1.0, 0 + ea = np.zeros(N, dtype=np.float32) + for i, coord_g in enumerate(gt_coords): + l_gt = Line(list(coord_g)) + for coord_p in b_points: + if coord_p[0]==coord_p[2] and coord_p[1]==coord_p[3]: + continue + l_pred = Line(list(coord_p)) + ea[i] = max(ea[i], EA_metric(l_pred, l_gt)) + return (ea >= thresh).sum(), N