Skip to content

Tensor Segmentation 🖼️

The task of TensorSegmentation involves the identification and categorization of individual objects or specific features at the pixel level.

📌 Inputs:

  • SampleTensor [input]:
    • A tensor ranging from 1D to 5D.
  • SampleTensor [target]: (conditional)
    • A 2D tensor with integer discrete values and the same spatial dimensions as the input tensor.
  • SampleTensor [extra]: (optional)
    • Additional tensors that may assist in exploratory data analysis or the training process.

🛠️ Use Cases:

  • Land Cover Classification: Categorizing different regions in satellite imagery into land cover classes like forest, water, urban, etc.
  • Agricultural Monitoring: Monitoring crops and identifying different types of vegetation to assist in precision agriculture.
  • Disaster Management: Assessing the impact of natural disasters by analyzing changes in land cover before and after the event.

🔍 Example:

import mlstac

name = "https://huggingface.co/datasets/mlstac/tensor_segmentation_demo.json"
dataset = mlstac.dataset(name, streaming=True, framework="torch")
print(next(iter(dataset)))

# Output example:
# {'input': tensor([[[[...]]]]), 'target': tensor([[0, 0, 2, 5, ...], [1, 1, 0, 2, ...], ...])}
Back to top