parameters: (self,total_boxes,w,h)
return_statement: return dy, edy, dx, edx, y, ey, x, ex, tmpw, tmph
docstring: Compute the padding coordinates (pad the bounding boxes to square)
docstring_summary: Compute the padding coordinates (pad the bounding boxes to square)
docstring_tokens: Compute the padding coordinates ( pad the bounding boxes to square )
function: def pad(self,total_boxes,w,h):
      
          '''Compute the padding coordinates (pad the bounding boxes to square)'''
          
          tmpw=total_boxes[:,2]-total_boxes[:,0]+1
          tmph=total_boxes[:,3]-total_boxes[:,1]+1
          numbox=total_boxes.shape[0]
          
          dx = np.ones((numbox,))
          dy = np.ones((numbox,))
          
          edx = tmpw    
          edy = tmph
              
          x = total_boxes[:,0]
          y = total_boxes[:,1]
          ex = total_boxes[:,2]
          ey = total_boxes[:,3]
          
          tmp = np.where(ex>w)
          edx[tmp] = -ex[tmp] + w + tmpw[tmp]
          ex[tmp] = w
          
          tmp = np.where(ey>h)
          edy[tmp]= -ey[tmp] + h + tmph[tmp]
          ey[tmp] = h
          
          tmp = np.where(x < 1)
          dx[tmp] = 2-x[tmp]
          x[tmp] = 1	
          
          tmp = np.where(y < 1)
          dy[tmp] = 2-y[tmp]
          y[tmp] = 1
          
          return dy, edy, dx, edx, y, ey, x, ex, tmpw, tmph
function_tokens: def pad ( self , total_boxes , w , h ) : tmpw = total_boxes [ : , 2 ] - total_boxes [ : , 0 ] + 1 tmph = total_boxes [ : , 3 ] - total_boxes [ : , 1 ] + 1 numbox = total_boxes . shape [ 0 ] dx = np . ones ( ( numbox , ) ) dy = np . ones ( ( numbox , ) ) edx = tmpw edy = tmph x = total_boxes [ : , 0 ] y = total_boxes [ : , 1 ] ex = total_boxes [ : , 2 ] ey = total_boxes [ : , 3 ] tmp = np . where ( ex > w ) edx [ tmp ] = - ex [ tmp ] + w + tmpw [ tmp ] ex [ tmp ] = w tmp = np . where ( ey > h ) edy [ tmp ] = - ey [ tmp ] + h + tmph [ tmp ] ey [ tmp ] = h tmp = np . where ( x < 1 ) dx [ tmp ] = 2 - x [ tmp ] x [ tmp ] = 1 tmp = np . where ( y < 1 ) dy [ tmp ] = 2 - y [ tmp ] y [ tmp ] = 1 return dy , edy , dx , edx , y , ey , x , ex , tmpw , tmph