original_docstring: 
          Searching transit signals from a given light curve.
  
          Parameters
          ----------
          model_path : str
                      The path of the model file.
          batch_size : int
                      Batch size for increasing detection speed, especially useful for GPU
                      default value is 2, if using GPU, it can be higher depending on the limitation of the GPU memory.
          confidence_threshold : float
                      Confidence threshold for transit detection. If None, the value will be obtained from config.
                      Default value is 0.6.
          nms_iou_threshold : float
                      IOU threshold for NMS algorithm. If None, the value will be obtained from config.
                      Default value is 0.1.
          device_str : str
                      Device name. If "cuda", it will use GPU. Default is "auto".
          backend : str
                      Backend of the model. You can choose between "pytorch" or "megengine".
                      Default is "pytorch".
          Returns
          -------
          final_bboxes : np.ndarray
                      An (N, 5) shape numpy.ndarray of bounding boxes.
          
docstring: Searching transit signals from a given light curve.
  Parameters
  
  model_path : str
  The path of the model file.
  batch_size : int
  Batch size for increasing detection speed, especially useful for GPU
  default value is 2, if using GPU, it can be higher depending on the limitation of the GPU memory.
  confidence_threshold : float
  Confidence threshold for transit detection. If None, the value will be obtained from config.
  
  final_bboxes : np.ndarray
  An (N, 5) shape numpy.ndarray of bounding boxes.
docstring_tokens: Searching transit signals from a given light curve . Parameters model_path : str The path of the model file . batch_size : int Batch size for increasing detection speed especially useful for GPU default value is 2 if using GPU it can be higher depending on the limitation of the GPU memory . confidence_threshold : float Confidence threshold for transit detection . If None the value will be obtained from config . final_bboxes : np . ndarray An ( N 5 ) shape numpy . ndarray of bounding boxes .
code: def transit_detection(self, local_model_path, batch_size=2, confidence_threshold=0.6, nms_iou_threshold=0.1, device_str='auto', backend='pytorch'):
          """
          Searching transit signals from a given light curve.
  
          Parameters
          ----------
          model_path : str
                      The path of the model file.
          batch_size : int
                      Batch size for increasing detection speed, especially useful for GPU
                      default value is 2, if using GPU, it can be higher depending on the limitation of the GPU memory.
          confidence_threshold : float
                      Confidence threshold for transit detection. If None, the value will be obtained from config.
                      Default value is 0.6.
          nms_iou_threshold : float
                      IOU threshold for NMS algorithm. If None, the value will be obtained from config.
                      Default value is 0.1.
          device_str : str
                      Device name. If "cuda", it will use GPU. Default is "auto".
          backend : str
                      Backend of the model. You can choose between "pytorch" or "megengine".
                      Default is "pytorch".
          Returns
          -------
          final_bboxes : np.ndarray
                      An (N, 5) shape numpy.ndarray of bounding boxes.
          """
  
          if backend == 'pytorch':
              from .backend import PytorchBackend
              backend = PytorchBackend(device_str)
          else:
              assert backend == 'megengine'
              from.mge.backend import MegengineBackend
              backend = MegengineBackend()
          backend.load_model(local_model_path)
  
          real_unit_bboxes = []
          exp_time = np.nanmedian(np.diff(self.lc.time.value))
          rough_length = math.ceil(math.ceil((len(self.lc) * exp_time - 30) / 25 + 1) * 4 / batch_size)
          warnings.warn('The total number of progress bar is the upper limit.')
          for data in tqdm(self._data_loader(batch_size=batch_size, backend=backend), total=rough_length):
              lc_data = data[:, 0]
              flux_min, flux_max = data[:, 2], data[:, 3]
              predicted_bboxes = backend.inference(
                  data[:, 1], nms_iou_threshold=nms_iou_threshold, confidence_threshold=confidence_threshold)
              for index, bboxes in enumerate(predicted_bboxes):
                  predicted_bboxes_in_real_unit = _bounding_box_to_time_flux(lc_data[index], bboxes,
                                                                             (flux_min[index], flux_max[index]))
                  real_unit_bboxes += predicted_bboxes_in_real_unit
  
          final_bboxes = np.array(backend.nms(real_unit_bboxes, nms_iou_threshold=nms_iou_threshold,  confidence_threshold=confidence_threshold))
  
          return final_bboxes
code_tokens: def transit_detection ( self , local_model_path , batch_size = 2 , confidence_threshold = 0.6 , nms_iou_threshold = 0.1 , device_str = 'auto' , backend = 'pytorch' ) : if backend == 'pytorch' : from . backend import PytorchBackend backend = PytorchBackend ( device_str ) else : assert backend == 'megengine' from . mge . backend import MegengineBackend backend = MegengineBackend ( ) backend . load_model ( local_model_path ) real_unit_bboxes = [ ] exp_time = np . nanmedian ( np . diff ( self . lc . time . value ) ) rough_length = math . ceil ( math . ceil ( ( len ( self . lc ) * exp_time - 30 ) / 25 + 1 ) * 4 / batch_size ) warnings . warn ( 'The total number of progress bar is the upper limit.' ) for data in tqdm ( self . _data_loader ( batch_size = batch_size , backend = backend ) , total = rough_length ) : lc_data = data [ : , 0 ] flux_min , flux_max = data [ : , 2 ] , data [ : , 3 ] predicted_bboxes = backend . inference ( data [ : , 1 ] , nms_iou_threshold = nms_iou_threshold , confidence_threshold = confidence_threshold ) for index , bboxes in enumerate ( predicted_bboxes ) : predicted_bboxes_in_real_unit = _bounding_box_to_time_flux ( lc_data [ index ] , bboxes , ( flux_min [ index ] , flux_max [ index ] ) ) real_unit_bboxes += predicted_bboxes_in_real_unit final_bboxes = np . array ( backend . nms ( real_unit_bboxes , nms_iou_threshold = nms_iou_threshold , confidence_threshold = confidence_threshold ) ) return final_bboxes
short_docstring: Searching transit signals from a given light curve.
short_docstring_tokens: Searching transit signals from a given light curve .
comment: """
          Searching transit signals from a given light curve.
  
          Parameters
          ----------
          model_path : str
                      The path of the model file.
          batch_size : int
                      Batch size for increasing detection speed, especially useful for GPU
                      default value is 2, if using GPU, it can be higher depending on the limitation of the GPU memory.
          confidence_threshold : float
                      Confidence threshold for transit detection. If None, the value will be obtained from config.
                      Default value is 0.6.
          nms_iou_threshold : float
                      IOU threshold for NMS algorithm. If None, the value will be obtained from config.
                      Default value is 0.1.
          device_str : str
                      Device name. If "cuda", it will use GPU. Default is "auto".
          backend : str
                      Backend of the model. You can choose between "pytorch" or "megengine".
                      Default is "pytorch".
          Returns
          -------
          final_bboxes : np.ndarray
                      An (N, 5) shape numpy.ndarray of bounding boxes.
          """