Skip to main content

Library for working with timestamp-based sensor fusion scenes

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scale_sensor_fusion_io-0.5.4.tar.gz (41.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scale_sensor_fusion_io-0.5.4-py3-none-any.whl (66.6 kB view details)

Uploaded Python 3

File details

Details for the file scale_sensor_fusion_io-0.5.4.tar.gz.

File metadata

  • Download URL: scale_sensor_fusion_io-0.5.4.tar.gz
  • Upload date:
  • Size: 41.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for scale_sensor_fusion_io-0.5.4.tar.gz
Algorithm Hash digest
SHA256 680f218c2d0ebb60bdf38a081eb42d940e10285cd92c8cbd78159ea94b794006
MD5 709762c42a2d650a4a3b98bfa94bb433
BLAKE2b-256 2293df735a63ee494321fde4d064ba25a3a68ebc7d2c95a3a1fec94b7d462fb5

See more details on using hashes here.

File details

Details for the file scale_sensor_fusion_io-0.5.4-py3-none-any.whl.

File metadata

File hashes

Hashes for scale_sensor_fusion_io-0.5.4-py3-none-any.whl
Algorithm Hash digest
SHA256 249af315fee08bd64d1dff3b2ca8408b7d39afe5e6c94fc310e210fe75e29e14
MD5 8f49c8bdb4937349e574cc9bf5af10be
BLAKE2b-256 bc6d9b7ba4e3e930e7e027f37fca575e5bf67a1a834449844b2dd17462e21d2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page