fidler-lab / polyrnn-pp-pytorch

PyTorch training/tool code for Polygon-RNN++ (CVPR 2018)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The sample method of GT vertex when training stage.

Jacoobr opened this issue · comments

Hi, @amlankar . When i work through the code of you published, I find the method of sampling the GT vertexs when training stage is : if the length of GT vertex smaller than the parameter opts['max_poly_len'] ,then taking all the GT vertex when training, otherwise, taking poly[:opts['max_poly_len']] when training. The code of sampling GT vertex in cityscapes.py script as followed:

            len_to_keep = min(len(fwd_poly), self.opts['max_poly_len'])

            arr_fwd_poly[:len_to_keep] = fwd_poly[:len_to_keep]
            arr_bwd_poly[:len_to_keep] = bwd_poly[:len_to_keep]

The understanding about sampling the GT vertex when training, dose it right? If not, can you tell me how? thank U~

Hi @Jacoobr,

You are correct, while training we randomly choose the first vertex, and then take 'max_poly_len' number of vertices starting from that in order to be the GT polygon. Setting the 'max_poly_len' helps define the number of steps to run in the rnn across batches. The number was found by looking at the cityscapes data statistics. If the length is smaller, then the array is padded with 0s and those time steps are masked out in the loss calculation.