Metadata-Version: 2.1
Name: semantic_sfm
Version: 0.0.2
Summary: x segmentation on photogrammetry point cloud
Home-page: https://github.com/ZhiangChen/semantic_SfM
Author: Zhiang Chen
Author-email: zhiang.chen@caltech.edu
License: UNKNOWN
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown

# semantic_SfM
Instance segmentation for SfM point cloud. 

## Installation
Option 1 (recommended): 
```
git clone https://github.com/ZhiangChen/semantic_SfM.git
cd semantic_SfM/semantic_SfM/ssfm/
pip3 install .
```

Option 2:
```
pip3 install ssfm
```

**Hardware requirements**: This project utilizes the Segment Anything Model (SAM) for panoptic segmentation. GPUs are not required for SAM but are recommended to expedite inference speed. The other parts of this project use only CPUs. As a point cloud will be stored in memory, memory usage depends on the point cloud size. 

## SSfM Architecture
[files.py](./semantic_SfM/ssfm/files.py) provides utility functions for file operation, such as point cloud and image files.

[image_segmentation.py](./semantic_SfM/ssfm/image_segmentation.py) allows to select deep learning models for instance segmentation and panoptic segmentation. 

[probabilistic_projection.py](./semantic_SfM/ssfm/probabilistic_projection.py) projects point clouds to images and creates a probablistic semantics.

[object_registration.py](./semantic_SfM/ssfm/object_registration.py) registers objects (instances and stuffs) in point clouds.



## Support Platforms and Models
This repository supports SfM products from the following platforms: 
- [WebODM](https://opendronemap.org/webodm/)
- [Agisoft](https://www.agisoft.com/)

Refer to the [docs/projection_tutorial.md](docs/projection_tutorial.md) to obtain point clouds and camera parameters from WebODM or Agisoft. The point clouds should use the format of [.las](https://laspy.readthedocs.io/en/latest/intro.html). 

For image segmentation, we have used Segment Anything Model from Meta: 
- [SAM](https://github.com/facebookresearch/segment-anything)


## Tutorials
1. Projecting Point Clouds onto Image Planes: [docs/projection_tutorial.md](docs/projection_tutorial.md)

2. Data Structure and Algorithms for Object Registration: [docs/object_registration.md](docs/object_registration.md)

3. Running a Complete Workflow Example from Scratch: [semantic_SfM/ssfm/workflow.ipynb](semantic_SfM/ssfm/workflow.ipynb)

