GithubHelp home page GithubHelp logo

isabella232 / unity-simulation-smart-camera-outdoor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cs-util/unity-simulation-smart-camera-outdoor

0.0 0.0 0.0 2.17 GB

Unity Simulation Sample project for outdoor smart camera usecase

C# 53.19% ShaderLab 45.68% HLSL 1.13%

unity-simulation-smart-camera-outdoor's Introduction

Unity Simulation Sample Project

Windridge

Rendering Pipeline : Universal Rendering Pipeline

This sample project demonstrates the usage of Perception package for RGB images, Depth capture, Semantic segmentation and Data Logs and running it on USim at scale to generate a dataset that can be used for training a machine learning model.

About Project

Category : Smart Cameras

This project exemplifies a general way of capturing synthetic data for any simulation. This approach can be applied to any other use case. The scene setup comprises a predefined waypoint system for cars to drive around the city, a waypoint system for people to walk and other environment objects. There are two cameras setup one at the intersection to visualize the traffic and another one on the dashboard of one of the cars moving around the city.

Unity Simulation

Components

USimCaptureDemo

This object is responsible for driving the simulation. USimCaptureDemo

PerceptionCamera

This component enables capture of RGB images, Semantic segmentation and Bounding box annotations for the source camera on which this script is added. In this case the PerceptionCamera script component is added to the intersection camera and the car dashboard camera. You can choose the view for which you want to generate the dataset by selecting the camera view option on USimDataCaptureDemo game object (discussed later).

Perception Camera

Detailed Documentation on Perception package can be found [here].(https://docs.unity3d.com/Packages/[email protected]/manual/index.html)

DepthGrab

This component captures depth for the dashboard camera of one of the cars. This component is enabled when the dashboard camera is enabled.

Perf Measure

This component keeps track of the number of frames generated and provides an FPS measure at the end based on total wall time elapsed.

Semantic Segmentation

Switch Camera View

You can switch the camera view to car dashboard camera view by checking the Enable Car Dashboard Camera option on SimulationManager Script Component. This will enable the perception camera component on one of the Cars in the scene.

Car Dashboard Camera

Run on Unity Simulation

In order to run your simulation on Unity Simulation, you will have to sign up for the service by visiting our website

You can run your simulation on Unity Simulation using the Unity Simulation CLI by following instructions here, or you can use simulation client package which exposes C# APIs to automate Unity Simulation CLI workflow in Unity Editor as per your requirement, to improve iteration time. This project demonstrates usage of Client package APIs by creating a menu item, which provides options to Build Project and Execute on Unity Simulation. Build Project will perform a Linux Standalone build and zip it up for upload. Execute menu item will create a run definition to run the simulation with the build generated using vCPU6 sysparam and schedule it on Unity Simulation. After the run is scheduled, it will log the execution-id to the console. Make sure you are logged in to Unity Services and your project is linked to a cloudprojectId.

Unity Simulation Execute

Parameterization

This is one of the important aspects of running the simulation to generate a variety of dataset. The project is set up with a few SimulationOptions

  • MaxNumberOfCars
  • MaxNumberOfFramesToCapture
  • EnableCapturingDrivingLogs
  • EnableDepthCamera
  • CameraViewToCapture
  • TimeOfDay
  • Light Intensity

You can set different appParams with these options and run the desired number of instances against each appParam. The simulation config is parsed on RuntimeInitializeOnLoad and applied to the simulation configuration.

How to extend this project

This project can be extended to simulate smart cameras at a traffic intersection. The waypoint system and car physics can be modified to generate different scenarios to generate data sets.

Limitations and known issues

Limitations

  • The current waypoints system supports upto 20 cars.
  • The waypoint system is not configurable.
  • Car physics uses a single raycast to account for cars in the front. It does not account for cars in the blind spot.

Known Issues

Depth Grab bundled with this project has issues and will be fixed in the next update.

FAQs

1. Execute menu option doesn't work for me

 This might typically happen if you are not logged in or linked your project. You can do this by opening the Service window (Cmd + 0 or Ctrl + 0) and clicking on SignIn and link your project.

2. I am logged in and my project is linked, I am still not able to run on Unity Simulation

This might happen if you have not signed up for the Unity Simulation Service.

3. What scene to load?

 Try searching for CityScene in the Project.

unity-simulation-smart-camera-outdoor's People

Contributors

at669 avatar jonathanhunity avatar priyeshwani avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.