Skip to main content

sensor-fusion-io

SDK for working with sensor fusion scenes

Installation

pip install scale-sensor-fusion-io

Requirements

Minimum Python version supported is:

  • 3.10 for >= 0.5.0
  • 3.8 for < 0.5.0

Code samples

End-to-End Example From PandaSet

Here is a link to a Jupyter notebook example.

Constructing an SFS scene

PosePath Dataframe

Encoding a SFS scene

import scale_sensor_fusion_io as sfio
from scale_sensor_fusion_io.model_converters to_scene_spec_sfs
from scale_json_binary import write_file

scene = sfio.Scene() # your scene here
scene_sfs = to_scene_spec_sfs(scene)
import scale_sensor_fusion_io as sfio

write_file(f'~/scene.sfs', scene_sfs)


Loading sfs file

There is a SFSLoader class that provides helper functions for loading a scene from url. There are few variations of loading function, depending on your use case.

from scale_sensor_fusion_io.loaders import SFSLoader
scene_url = "~/scene.sfs"

# Not recommended, but possible
raw_scene = SFSLoader(scene_url).load_unsafe() # scene is dict
sfs_scene = SFSLoader(scene_url).load_as_sfs() # scene is SFS.Scene
scene = SceneLoader(scene_url).load() # scene is models.Scene

Validating SFS

Before you upload a scene for task creation, you'll want to validate that your sfs scene is well formed. You can do this in a variety of ways.

Validating scene object

If you're working with the model.Scene object, you can use the validate_scene method available under scale_sensor_fusion_io.models.validation

import scale_sensor_fusion_io as sfio
import pprint

scene = sfio.Scene() #

errors = validate_scene(scene)
if errors:
    pp.pprint(asdict(errors))
else:
    print("Scene validated successfully")

Validating from url

If you've already generated a .sfs file, you can also validate that it is well formed

from scale_sensor_fusion_io.validation import parse_and_validate_scene
from scale_json_binary import read_file
import pprint

pp = pprint.PrettyPrinter(depth=6)

scene_url = "your_scene.sfs"

raw_data = read_file(scene_url)
result = parse_and_validate_scene(raw_data)

if not result.success:
    pp.pprint(asdict(result))
else:
    print("Scene parsed and validated successfully")

FAQ

Resulting scene file is too large

For scenes that span a large timeframe, the size of the resulting .sfs file may increase to multi-GBs. This is not ideal for loading onto LidarLite.

Video encoding

One easy way to reduce scene size is to encode camera content as video, as the video content can be more easily compressed. The tradeoff is the potentially reduced quality of images, but for labeling 3D scenes, this is often sufficient.

See .utils/generate_video.py for helper functions

Downsample point clouds

Another option is to downsample lidar point clouds. If your scene is used primarily for cuboid annotation, we recommend voxel downsampling using voxel sizes of at most 20mm.

A good heuristic for efficient loading and labeling is to have a scene contain no more than 100,000 points.

Metadata

Release files for scale-sensor-fusion-io 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scale-sensor-fusion-io 0.6.1
File Size Uploaded Provenance Actions
scale_sensor_fusion_io-0.6.1.tar.gz 48.4 kB Without provenance Details for scale_sensor_fusion_io-0.6.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scale-sensor-fusion-io 0.6.1
File Interpreter ABI Platform Actions
scale_sensor_fusion_io-0.6.1-py3-none-any.whl Python 3 none any Details for scale_sensor_fusion_io-0.6.1-py3-none-any.whl

Total release size: 122.7 kB

Release files / scale_sensor_fusion_io-0.6.1.tar.gz

Download URL scale_sensor_fusion_io-0.6.1.tar.gz
Size 48.4 kB
Tags Source
SHA-256 checksum
How to use checksums
da70c179361864b41ec9214c84265859ac5ac545453960acc32d7ef654f5a299
BLAKE2b-256 checksum
How to use checksums
a4e536b75c0d0414fb624a0ef697b1ccd4a6d977cd840c15d2b064e8474ae482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Release files / scale_sensor_fusion_io-0.6.1-py3-none-any.whl

Download URL scale_sensor_fusion_io-0.6.1-py3-none-any.whl
Size 74.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
387119fd52e7fc591f1e7cff4ee1884e880cb1d4d0dd49f7fec52214ca5d8525
BLAKE2b-256 checksum
How to use checksums
dcea7cd0b34a66b22e3cdf3b148a2af8fe1cfc13764439d6f378a88c8670f82a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.20

Security for scale-sensor-fusion-io 0.6.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page