GithubHelp home page GithubHelp logo

unity-technologies / synthdet Goto Github PK

View Code? Open in Web Editor NEW
350.0 18.0 53.0 2.24 MB

SynthDet - An end-to-end object detection pipeline using synthetic data

License: Apache License 2.0

ShaderLab 12.81% HLSL 3.48% C# 83.71%
object-detection detection computer-vision deep-learning synthetic-data synthetic-dataset synthetic-dataset-generation domain-randomization pose-estimation machine-learning

synthdet's Introduction

SynthDet: An end-to-end object detection pipeline using synthetic data

license badge

Overview

SynthDet is an open source project that demonstrates an end-to-end object detection pipeline using synthetic image data. The project includes all the code and assets for generating a synthetic dataset in Unity. Based on recent research, SynthDet utilizes Unity's Perception package to generate highly randomized images of 63 common grocery products (example: cereal boxes and candy) and export them along with appropriate labels and annotations (2D bounding boxes). The synthetic dataset generated can then be used to train a deep learning based object detection model. This project is geared towards ML practitioners and enthusiasts who are actively exploring synthetic data or just looking to get started.

Components

  • SynthDet Unity Project - Sample computer vision data generation project, demonstrating proper integration and usage of the Perception package for environment randomization and ground-truth generation.
  • 3D Assets - High quality models of 63 commonly found grocery products
  • Unity's Perception package.

Unity Project overview

This project utilizes the Unity Perception package for randomizing the environment and capturing ground-truth on each frame. Randomization includes elements such as lighting, camera post processing, object placement, and background.

Visit the Unity project documentation page for a brief overview on how ground truth generation and domain randomization are achieved in SynthDet.

Tutorials

In addition to the above, in order to learn how to create a project like SynthDet from scratch using the Perception package, we recommend you follow the Perception Tutorial.

Additional documentation

Inspiration

SynthDet was inspired by the following research paper from Google Cloud AI:

Hinterstoisser, S., Pauly, O., Heibel, H., Marek, M., & Bokeloh, M. (2019). An Annotation Saved is an Annotation Earned: Using Fully Synthetic Training for Object Instance Detection.

Unity project development

The original version of the SynthDet Unity project was developed in tandem with the early versions of Unity's Perception package. This project closely followed the synthetic data generation method introduced by the above mentioned Google Cloud AI paper. However, the original project did not use the randomization toolset that was introduced in later versions of the Perception package. To access this original project, and for more details on how it was implemented to replicate the research paper, please visit the SynthDet_Original branch of this repository. The results reported in our related blog posts were based on this original project. That said, early experiments with datasets generated using the current version of the project have shown very similar model-training performance to that of the original one.

Support

For general questions or concerns please contact the Unity Computer Vision team at [email protected].

For feedback, bugs, or other issues please file a GitHub issue and the Unity Computer Vision team will investigate the issue as soon as possible.

Citation

If you find this project useful, consider citing it using:

@misc{synthdet2020,
    title={Training a performant object detection {ML} model on synthetic data using {U}nity {P}erception tools},
    author={You-Cyuan Jhang and Adam Palmar and Bowen Li and Saurav Dhakad and Sanjay Kumar Vishwakarma and Jonathan Hogins and Adam Crespi and Chris Kerr and Sharmila Chockalingam and Cesar Romero and Alex Thaman and Sujoy Ganguly},
    howpublished = {\url{https://blogs.unity3d.com/2020/09/17/training-a-performant-object-detection-ml-model-on-synthetic-data-using-unity-computer-vision-tools/}},
    journal={Unity Technologies Blog},
    publisher={Unity Technologies},
    year={2020},
    month={Sep}
}

Additional Resources

GTC 2020: Synthetic Data: An efficient mechanism to train Perception Systems

Synthetic data: Simulating myriad possibilities to train robust machine learning models

Use Unity’s computer vision tools to generate and analyze synthetic data at scale to train your ML models

Training a performant object detection ML model on synthetic data using Unity computer vision tools

License

Apache License 2.0

synthdet's People

Contributors

alextha-scale avatar bowenlee919 avatar cherie-unity avatar jonathanhunity avatar mkamalza avatar nupur-yadav avatar sleal-unity avatar stevenborkman avatar unitcck avatar wesley201 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synthdet's Issues

semantic mask label generation

Hey! Great work there!
I have an issue that I want to generate masks for semantic segmentation image, and output labels like COCO dataset.
image

I only found how to generate mask photos like above, but cannot generate a proper json file which include the mask information. Can you guys demonstrate it for me? Many thanks to you~

How to change the background?

I added my own 3d models as described in CreatingAssets.md. Now I want to change the background images and remove the background objects. I tried setting the BackgroundObjectResourcesDirectory attribute to "" and set the BackgroundImageResourcesDirectory to a folder with some background images inside, but now the background is just blue and there sometimes are also some objects in the background.

Turning off random hue shift

Hi, I'm playing around with SynthDet and I want to train a small classification model. Without changing the parameters, this is the example result I'm getting:
image
I'd like to turn off random hue shift to match as closely as possible training (synthetic) and validation (real) data, how do I do that?

Implementing SynthDet in Blender

Hi Unity team,

Firstly, thank you for your contributions to the field of synthetic data.

I've added some new features (PBR materials, HDRI lighting, and ray tracing rendering) and recreated this project using Blender.

If anyone has a need, feel free to refer to this repo.

Torchserve hello

Hi team, I noticed you use torchserve to run inferences

I'm a maintainer on torchserve and we're looking to showcase more how people are using torchserve. So I was wondering if you'd be open to us featuring your project in our repo? I'll send you a draft PR so you can review the wording. Your use case is very informative of how we need to manage our scale out story and work under harsh latency requirements. I've always joked to my friends that a slow game isn't considered a game.

The game dev + ML story is still fragmented today and I'm glad Unity is working so actively to make it saner, so please let me know if you have any feedback or features requests for torchserve so I can make your life easier

In general I'm a big fan of Unity, I've written tutorials about ML agents, ECS and have many Unity tutorials on Youtube https://www.youtube.com/user/marksaroufim/videos

Does SynthDet run on Unity 2019.4.4f1 Personal?

Hi

I'm on Win 10 with 2019.4.4f1 Personal. I downloaded the zip file (not cloned by command line) and upgraded the Perception package to Preview 0.2.0 but I have a bunch of errors e.g.

Failed to load 'ProjectSettings/EditorSettings.asset'. File may be corrupted or was serialized with a newer version of Unity.

and a 'Display 1 No cameras rendering' message in the Game view.

Do I need to use 2019.3? Do I also need to clone the package with the command line (e.g. not use the zip file)?

Please let me know if I can provide more info.

Thanks

Incorrect annotations in real groceries dataset?

Hi! I was going over the real dataset of groceries and I think some annotations have a wrong label_id.

For instance, image IMG_4188.JPG has 3 annotations, one of them being of label_id: 36, which according to the annotation_definitions.json should correspond to snack_chips_pringles. However, by looking at the image I don't see pringles but a snack_coffeecakes_hostess. The other 2 annotations in this image are fine (cereal_rice_krispies and cereal_korn_flakes). I hope I am not missing anything and I am bothering you guys for nothing, but it might be worth looking into this if it is indeed the case that some labels are wrong. This behaviour repeats for other objects and images, not only IMG_4188.JPG.

Test Issue

Testing intergration and comment detection

System.IndexOutOfRangeException: Index {0} is out of range of '{1}' Length.

I am trying to run the SynthDet simulation in the Unity Editor, but it fails with this error before finishing after about 3775 frames.

System
Ubuntu 18.04

Console logs / stack trace

System.IndexOutOfRangeException: Index {0} is out of range of '{1}' Length.
Thrown from job: ForegroundObjectPlacer.ComputePlacementsJob
This Exception was thrown from a job compiled with Burst, which has limited exception support. Turn off burst (Jobs -> Burst -> Enable Compilation) to inspect full exceptions & stacktraces.

UnityEngine.Debug:Log(Object)
EndSimulationSystem:OnUpdate() (at Assets/Scripts/EndSimulationSystem.cs:26)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystem.cs:108)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystemGroup.cs:134)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystemGroup.cs:114)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystem.cs:108)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/[email protected]/Unity.Entities/ScriptBehaviourUpdateOrder.cs:152)

DC[V]: Application quit
UnityEngine.Debug:Log(Object)
Unity.Simulation.Log:Write(Level, String, Boolean) (at Library/PackageCache/[email protected]/Runtime/Log.cs:80)
Unity.Simulation.Log:V(String, Boolean) (at Library/PackageCache/[email protected]/Runtime/Log.cs:135)
Unity.Simulation.Manager:Update(Single) (at Library/PackageCache/[email protected]/Runtime/Manager.cs:401)
Unity.Simulation.Manager:Shutdown() (at Library/PackageCache/[email protected]/Runtime/Manager.cs:341)
Unity.Simulation.<>c:<.cctor>b__0_0(PlayModeStateChange) (at Library/PackageCache/[email protected]/Editor/ExitPlaymode.cs:17)
UnityEditor.EditorApplication:ExitPlaymode()
EndSimulationSystem:OnUpdate() (at Assets/Scripts/EndSimulationSystem.cs:28)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystem.cs:108)
Unity.Entities.ComponentSystemGroup:UpdateAllSystems() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystemGroup.cs:134)
Unity.Entities.ComponentSystemGroup:OnUpdate() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystemGroup.cs:114)
Unity.Entities.ComponentSystem:Update() (at Library/PackageCache/[email protected]/Unity.Entities/ComponentSystem.cs:108)
Unity.Entities.DummyDelegateWrapper:TriggerUpdate() (at Library/PackageCache/[email protected]/Unity.Entities/ScriptBehaviourUpdateOrder.cs:152)

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.