urbanlc.model.deep_learning.TMDeepLearning.infer#

TMDeepLearning.infer(img_path: str, convert_numpy: Optional[bool] = True, cache=False, return_prob=False, stride=None) Union[ndarray, Tensor]#

Perform inference using the deep learning model.

Parameters:
  • img_path (str) – Path to the input image.

  • convert_numpy (bool, optional) – Whether to convert the result to NumPy array.

  • cache (bool, optional) – Whether to use caching.

  • return_prob (bool, optional) – Whether to return probability map.

  • stride (int, optional) – Stride for inference.

Returns:

Inference result.

Return type:

Union[np.ndarray, torch.Tensor]