original_docstring: 
      The function is used to split the data into 'Gesture' and 'No gesture' two classes. First, select all of the data in
       the 'No gesture' class and then randomly pick the same number of data from the other classes.
      :param path_csv: path to the csv containing the videos
      :param save_dir_label: The save directory of the label dict file.
      :param save_dir_annotation: The save directory of the generated annotation file.
      :return:
      
docstring: The function is used to split the data into 'Gesture' and 'No gesture' two classes. First, select all of the data in
  the 'No gesture' class and then randomly pick the same number of data from the other classes.
docstring_tokens: The function is used to split the data into ' Gesture ' and ' No gesture ' two classes . First select all of the data in the ' No gesture ' class and then randomly pick the same number of data from the other classes .
code: def split_data_gesture_exist(path_csv, save_dir_label, save_dir_annotation):
      """
      The function is used to split the data into 'Gesture' and 'No gesture' two classes. First, select all of the data in
       the 'No gesture' class and then randomly pick the same number of data from the other classes.
      :param path_csv: path to the csv containing the videos
      :param save_dir_label: The save directory of the label dict file.
      :param save_dir_annotation: The save directory of the generated annotation file.
      :return:
      """
      df = pd.read_csv(path_csv, sep=';', names=['video_id', 'label'])
      count_no_gesture = sum(df['label'].values[df.index] == "No gesture")
      print("The total data number of 'No gesture' class: %d " % count_no_gesture)
      list_video_id = []
      list_label_id = []
      for i in df.index:
          if df['label'].values[i] == 'No gesture':
              list_video_id.append(df['video_id'].values[i])
              list_label_id.append(0)
              # list_label_id.append(label_dict[df['label'].values[i]])
      for i in df.index:
          if count_no_gesture == 0:
              break
          if df['label'].values[i] != 'No gesture':
              list_video_id.append(df['video_id'].values[i])
              list_label_id.append(1)
              # list_label_id.append(label_dict[df['label'].values[i]])
              count_no_gesture -= 1
      annotation = dict(zip(list_video_id, list_label_id))
  
      label_dic_gesture = {'No gesture': 0, 'Gesture': 1}
      with open(save_dir_label, 'w') as file_obj:
          json.dump(label_dic_gesture, file_obj)
  
      with open(save_dir_annotation, 'w') as f:
          [f.write('{0},{1}\n'.format(key, value)) for key, value in annotation.items()]
code_tokens: def split_data_gesture_exist ( path_csv , save_dir_label , save_dir_annotation ) : df = pd . read_csv ( path_csv , sep = ';' , names = [ 'video_id' , 'label' ] ) count_no_gesture = sum ( df [ 'label' ] . values [ df . index ] == "No gesture" ) print ( "The total data number of 'No gesture' class: %d " % count_no_gesture ) list_video_id = [ ] list_label_id = [ ] for i in df . index : if df [ 'label' ] . values [ i ] == 'No gesture' : list_video_id . append ( df [ 'video_id' ] . values [ i ] ) list_label_id . append ( 0 ) for i in df . index : if count_no_gesture == 0 : break if df [ 'label' ] . values [ i ] != 'No gesture' : list_video_id . append ( df [ 'video_id' ] . values [ i ] ) list_label_id . append ( 1 ) count_no_gesture -= 1 annotation = dict ( zip ( list_video_id , list_label_id ) ) label_dic_gesture = { 'No gesture' : 0 , 'Gesture' : 1 } with open ( save_dir_label , 'w' ) as file_obj : json . dump ( label_dic_gesture , file_obj ) with open ( save_dir_annotation , 'w' ) as f : [ f . write ( '{0},{1}\n' . format ( key , value ) ) for key , value in annotation . items ( ) ]
short_docstring: The function is used to split the data into 'Gesture' and 'No gesture' two classes.
short_docstring_tokens: The function is used to split the data into ' Gesture ' and ' No gesture ' two classes .
comment: """
      The function is used to split the data into 'Gesture' and 'No gesture' two classes. First, select all of the data in
       the 'No gesture' class and then randomly pick the same number of data from the other classes.
      :param path_csv: path to the csv containing the videos
      :param save_dir_label: The save directory of the label dict file.
      :param save_dir_annotation: The save directory of the generated annotation file.
      :return:
      """$SEP$# list_label_id.append(label_dict[df['label'].values[i]])$SEP$# list_label_id.append(label_dict[df['label'].values[i]])