Scene examples
7 min
when uploading raw data to the kognic platform, you need to do so in the form of a scene a scene is a collection of data from different sources, such as images, point clouds, and other sensor data in kognic io 2 5 0 we released a new scene model that infers the scene type from the sensor data; if there are no pointclouds, a camera only sequence is created scenes created via this new model and its associated api will always be sequences , meaning they cannot be added to requests that require non sequence inputs over time, we expect to standardize on sequences everywhere, so this should become less of a concern over time there is no need to specify that a scene is aggregated with the new model, and we no longer support creation of so called "pre aggregated" scenes which contained a 'fat' pointcloud in the first frame, and nothing in the rest see aggregated lidars and cameras sequence docid\ wk30fzm6vjvdctdkx mgh for details you can read more detailed information about this model here docid\ ly3srvencctnimj3b9w b create scene from local files this guide will walk you through the process of uploading a scene where the sources are located on your computer prerequisites you have successfully followed the quickstart docid\ b6im5u kiwn9ukybzjx6d guide and have the kognic io library installed for users with access to multiple workspaces you need to specify a workspace to upload data too docid\ xmgm2k teox9jtn otqbm to upload scenes using cloud resources you need the following kognic io >= 2 5 1 a calibration docid 4mfc9atwcxupflne7v1iz for your scene data locally in a file format docid\ rjcfqbi 5abkcad j7mcw that kognic supports examples note that postpone external resource import has to be false when working with local files since kognic cannot maintain a reference to your local files and fetch them at a later time creating a 2d scene from local files from kognic io client import kognicioclient from kognic io model scene import scenerequest, frame, imageresource scene = scenerequest( workspace id="\<workspace id>", external id="my first scene from external resources", frames=\[ frame( frame id="1", timestamp ns=1742225789000000000, # absolute unix timestamp of frame images=\[ imageresource( external resource uri=none, sensor name="my camera", local file=localfile(filename="\<path to your file>") ) ], ) ], postpone external resource import=false ) client = kognicioclient() scene uuid = client scene create scene(scene) scene uuid print("scene uploaded, got uuid ", scene uuid) creating a 2d/3d scene from local files from kognic io client import kognicioclient from kognic io model scene import scenerequest, frame, imageresource, sensorresource, resource, egovehiclepose scene = scenerequest( workspace id="\<workspace id>", external id="my first scene from external resources", frames=\[ frame( frame id="1", timestamp ns=1742225790000000000, pointclouds=\[ sensorresource( external resource uri=none, sensor name="my lidar", local file=localfile(filename="\<path to your file>") ) ], images=\[ imageresource( external resource uri=none, sensor name="my camera", start shutter timestamp ns=1742225789000000000, end shutter timestamp ns=1742225790000000000, local file=localfile(filename="\<path to your file>"), ) ], ego vehicle pose=egovehiclepose( x=0 0, y=0 0, z=0 0, rotation x=0 0, rotation y=0 0, rotation z=0 0, rotation w=1 0 ) ) ], calibration id="\<calibration id>", imudata resource=resource( external resource uri=none, local file=localfile(filename="\<path to your file>") ), sensor specification=none, should motion compensate=false, postpone external resource import=false ) client = kognicioclient() scene uuid = client scene create scene(scene) scene uuid print("scene uploaded, got uuid ", scene uuid) create scene from cloud resources this guide will walk you through the process of uploading a scene where the sources are located on a bucket that you have access to prerequisites you have successfully followed the quickstart docid\ b6im5u kiwn9ukybzjx6d guide and have the kognic io library installed for users with access to multiple workspaces you need to specify a workspace to upload data too docid\ xmgm2k teox9jtn otqbm to upload scenes using cloud resources you need the following kognic io >= 2 5 1 a valid data integration docid\ l93 pnieahqpk 6j ouef a calibration docid 4mfc9atwcxupflne7v1iz for your scene data on your bucket in a file format docid\ rjcfqbi 5abkcad j7mcw that kognic supports overview instead of providing local file=localfile( ) on each resource (image, pointcloud, imu data) you will instead leave local file=none and provide external resource uri using the native format of your cloud platform i e a gs\ // or s3 // url example the example shows a full 2d+3d scene with imu data an ego vehicle poses it can be reduced to a 2d only scene by removing the imu, ego and pointclouds import may be deferred via postpone external resource import creating so called 'indexed' scenes ('indexed' because we only keep an index of what could be in the system and do not fetch the data until the scene is used or manually requested later ) from kognic io client import kognicioclient from kognic io model scene import scenerequest, frame, imageresource, sensorresource, resource, egovehiclepose scene = scenerequest( workspace id="\<workspace id>", external id="my first scene from external resources", frames=\[ frame( frame id="1", timestamp ns=1742225790, \# for 2d only scenes, omit pointclouds entirely pointclouds=\[ sensorresource( external resource uri="\<uri>", sensor name="my lidar", local file=none, ) ], images=\[ imageresource( external resource uri="\<uri>", sensor name="my camera", start shutter timestamp ns=1742225789, end shutter timestamp ns=1742225790, local file=none, ) ], \# for 2d only scenes, omit ego vehicle pose entirely ego vehicle pose=egovehiclepose( x=0 0, y=0 0, z=0 0, rotation x=0 0, rotation y=0 0, rotation z=0 0, rotation w=1 0 ) ) ], calibration id="\<calibration id>", \# for 2d scenes, omit imudata resource entirely imudata resource=resource( external resource uri="\<uri>", local file=none ), sensor specification=none, should motion compensate=false, # omit for 2d, optionally set for 3d+2d postpone external resource import=false, # set true if you want to import at a later point in time ) client = kognicioclient() scene uuid = client scene create scene(scene) scene uuid print("scene uploaded, got uuid ", scene uuid)
