original_docstring: 
          Shows live statistics of the recognition algorithm
      
docstring: Shows live statistics of the recognition algorithm
docstring_tokens: Shows live statistics of the recognition algorithm
code: def drawBanner(img, id_counter=None, CARD2NAME=None, AUTHORIZED_ID=None, retries=0):
      '''
          Shows live statistics of the recognition algorithm
      '''
  
      H, W, C = img.shape
      H = 50
      
          
      if AUTHORIZED_ID is None:
          img = addbanner(img, 'passive-banner.png')
      else:
          img = addbanner(img, 'active-banner.png')
      
      if retries > 1:
          text = 'Connecting to server... (%3d)'%retries
          cv2.putText(img, text, (30, 30),
                      cv2.FONT_HERSHEY_SIMPLEX,
                      fontScale=0.5, color=(0,0,0), 
                      thickness=1, lineType=cv2.LINE_AA)
          return img
  
  
      if id_counter is not None:    
          for i, (n, c) in enumerate(id_counter[:3]):
              registered = False
              if CARD2NAME.get(n) is not None:
                  registered = True
                  n = CARD2NAME.get(n)
              text = '%s (%2d)'%(n, c)
              
              # If user is registered and ID is the first then use Green text
              if i == 0:
                  if registered:
                      color = (40, 200, 40)
                  else:
                      color = (0, 0, 200)
              else:
                  color = (0, 0, 0)
              
              cv2.putText(img, text, (30 + i*150, 30),
                  cv2.FONT_HERSHEY_SIMPLEX,
                  fontScale=0.5, color=color, 
                  thickness=1, lineType=cv2.LINE_AA)
  
      else:
          text = 'No IDs to show...'
          cv2.putText(img, text, (30, 30),
                      cv2.FONT_HERSHEY_SIMPLEX,
                      fontScale=0.5, color=(0,0,0), 
                      thickness=1, lineType=cv2.LINE_AA)
                  
      return img
code_tokens: def drawBanner ( img , id_counter = None , CARD2NAME = None , AUTHORIZED_ID = None , retries = 0 ) : H , W , C = img . shape H = 50 if AUTHORIZED_ID is None : img = addbanner ( img , 'passive-banner.png' ) else : img = addbanner ( img , 'active-banner.png' ) if retries > 1 : text = 'Connecting to server... (%3d)' % retries cv2 . putText ( img , text , ( 30 , 30 ) , cv2 . FONT_HERSHEY_SIMPLEX , fontScale = 0.5 , color = ( 0 , 0 , 0 ) , thickness = 1 , lineType = cv2 . LINE_AA ) return img if id_counter is not None : for i , ( n , c ) in enumerate ( id_counter [ : 3 ] ) : registered = False if CARD2NAME . get ( n ) is not None : registered = True n = CARD2NAME . get ( n ) text = '%s (%2d)' % ( n , c ) if i == 0 : if registered : color = ( 40 , 200 , 40 ) else : color = ( 0 , 0 , 200 ) else : color = ( 0 , 0 , 0 ) cv2 . putText ( img , text , ( 30 + i * 150 , 30 ) , cv2 . FONT_HERSHEY_SIMPLEX , fontScale = 0.5 , color = color , thickness = 1 , lineType = cv2 . LINE_AA ) else : text = 'No IDs to show...' cv2 . putText ( img , text , ( 30 , 30 ) , cv2 . FONT_HERSHEY_SIMPLEX , fontScale = 0.5 , color = ( 0 , 0 , 0 ) , thickness = 1 , lineType = cv2 . LINE_AA ) return img
short_docstring: Shows live statistics of the recognition algorithm
short_docstring_tokens: Shows live statistics of the recognition algorithm
comment: '''
          Shows live statistics of the recognition algorithm
      '''$SEP$# If user is registered and ID is the first then use Green text