original_docstring: Get clip offsets in train mode.
  
          It will calculate sampled frame indices in the proposal's three
          stages: starting, course and ending stage.
  
          Args:
              proposal (object): The proposal object.
              num_frames (int): Total number of frame in the video.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          
docstring: Get clip offsets in train mode.
  It will calculate sampled frame indices in the proposal's three
  stages: starting, course and ending stage.
docstring_tokens: Get clip offsets in train mode . It will calculate sampled frame indices in the proposal ' s three stages : starting course and ending stage .
code: def _get_proposal_clips(self, proposal, num_frames):
          """Get clip offsets in train mode.
  
          It will calculate sampled frame indices in the proposal's three
          stages: starting, course and ending stage.
  
          Args:
              proposal (object): The proposal object.
              num_frames (int): Total number of frame in the video.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          """
          # proposal interval: [start_frame, end_frame)
          start_frame = proposal.start_frame
          end_frame = proposal.end_frame
          ori_clip_len = self.clip_len * self.frame_interval
  
          duration = end_frame - start_frame
          assert duration != 0
          valid_length = duration - ori_clip_len
  
          valid_starting = max(0,
                               start_frame - int(duration * self.aug_ratio[0]))
          valid_ending = min(num_frames - ori_clip_len + 1,
                             end_frame - 1 + int(duration * self.aug_ratio[1]))
  
          valid_starting_length = start_frame - valid_starting - ori_clip_len
          valid_ending_length = (valid_ending - end_frame + 1) - ori_clip_len
  
          if self.mode == 'train':
              starting_offsets = self._get_train_indices(valid_starting_length,
                                                         self.aug_segments[0])
              course_offsets = self._get_train_indices(valid_length,
                                                       self.body_segments)
              ending_offsets = self._get_train_indices(valid_ending_length,
                                                       self.aug_segments[1])
          elif self.mode == 'val':
              starting_offsets = self._get_val_indices(valid_starting_length,
                                                       self.aug_segments[0])
              course_offsets = self._get_val_indices(valid_length,
                                                     self.body_segments)
              ending_offsets = self._get_val_indices(valid_ending_length,
                                                     self.aug_segments[1])
          starting_offsets += valid_starting
          course_offsets += start_frame
          ending_offsets += end_frame
  
          offsets = np.concatenate(
              (starting_offsets, course_offsets, ending_offsets))
          return offsets
code_tokens: def _get_proposal_clips ( self , proposal , num_frames ) : start_frame = proposal . start_frame end_frame = proposal . end_frame ori_clip_len = self . clip_len * self . frame_interval duration = end_frame - start_frame assert duration != 0 valid_length = duration - ori_clip_len valid_starting = max ( 0 , start_frame - int ( duration * self . aug_ratio [ 0 ] ) ) valid_ending = min ( num_frames - ori_clip_len + 1 , end_frame - 1 + int ( duration * self . aug_ratio [ 1 ] ) ) valid_starting_length = start_frame - valid_starting - ori_clip_len valid_ending_length = ( valid_ending - end_frame + 1 ) - ori_clip_len if self . mode == 'train' : starting_offsets = self . _get_train_indices ( valid_starting_length , self . aug_segments [ 0 ] ) course_offsets = self . _get_train_indices ( valid_length , self . body_segments ) ending_offsets = self . _get_train_indices ( valid_ending_length , self . aug_segments [ 1 ] ) elif self . mode == 'val' : starting_offsets = self . _get_val_indices ( valid_starting_length , self . aug_segments [ 0 ] ) course_offsets = self . _get_val_indices ( valid_length , self . body_segments ) ending_offsets = self . _get_val_indices ( valid_ending_length , self . aug_segments [ 1 ] ) starting_offsets += valid_starting course_offsets += start_frame ending_offsets += end_frame offsets = np . concatenate ( ( starting_offsets , course_offsets , ending_offsets ) ) return offsets
short_docstring: Get clip offsets in train mode.
short_docstring_tokens: Get clip offsets in train mode .
comment: """Get clip offsets in train mode.
  
          It will calculate sampled frame indices in the proposal's three
          stages: starting, course and ending stage.
  
          Args:
              proposal (object): The proposal object.
              num_frames (int): Total number of frame in the video.
  
          Returns:
              np.ndarray: Sampled frame indices in train mode.
          """$SEP$# proposal interval: [start_frame, end_frame)