From c17c315d27041fb1a9671f505c6e983e44b73cb6 Mon Sep 17 00:00:00 2001 From: Duncan McKay Date: Tue, 31 Jul 2018 13:27:39 -0700 Subject: [PATCH] Add support for Linux with respective documentation update. Add support for Linux with respective documentation update. --- .gitignore | 8 +++++--- Documentation/NDDS.pdf | Bin 132 -> 132 bytes .../Components/RandomMaterialComponent.cpp | 14 +++++++++---- .../Public/GroupActorManager.cpp | 4 ++-- .../NVDataObject/Private/NVDataObject.cpp | 1 + .../Private/NVAnnotatedActor.cpp | 4 +++- .../Private/NVImageExporter.cpp | 19 +++++++----------- .../Private/NVSceneCaptureComponent2D.cpp | 1 + .../Private/NVSceneCapturerActor.cpp | 4 ++-- .../Private/NVSceneDataHandler.cpp | 11 +++++++--- .../NVSceneFeatureExtractor_DataExport.cpp | 1 + .../Private/NVSceneManager.cpp | 2 +- .../NVSceneCapturer/Public/NVImageExporter.h | 2 +- .../Public/NVSceneCapturerUtils.h | 2 ++ .../NVUtilities/Public/Movement/NVWaypoint.h | 1 + .../NVUtilities/Public/NVNavigationPath.h | 1 + .../Source/NVUtilities/Public/NVZone.h | 1 + readme.md | 7 +++++-- 18 files changed, 52 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 65716fc3569..4d03bc1b90f 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,11 @@ !*.txt !*.md +# Other Doc files +!*.pdf +!*.png +!*.mp4 + # Script files !*.bat !*.sh @@ -152,9 +157,6 @@ Engine/Binaries/DotNET/AutomationScripts/BuildGraph.Automation.xml # Ignore version files in the Engine/Binaries directory created by UBT /Engine/Binaries/**/*.version -# Ignore content folders -Content/ - # Ignore DDC /Engine/DerivedDataCache/** diff --git a/Documentation/NDDS.pdf b/Documentation/NDDS.pdf index 6bffb20f00d67c1eb43d515eca98a9dcf9427764..775f77f82aa30b4401b292efe05032736af29d28 100644 GIT binary patch delta 85 zcmV~$%MpMe38;wDs2lsNzv39mYs+?0#Z eaxetqFo=@eix fz&SwBs|ZsW-E_E4Y^6iBW*GUto;aXUA*}fW6n_^} diff --git a/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/Components/RandomMaterialComponent.cpp b/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/Components/RandomMaterialComponent.cpp index 9bf6c0c2132..170f490874e 100644 --- a/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/Components/RandomMaterialComponent.cpp +++ b/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/Components/RandomMaterialComponent.cpp @@ -131,16 +131,22 @@ void URandomMaterialComponent::PostEditChangeProperty(struct FPropertyChangedEve Super::PostEditChangeProperty(PropertyChangedEvent); } } - +#endif //WITH_EDITORONLY_DATA bool URandomMaterialComponent::HasMaterialToRandomize() const { +#if WITH_EDITORONLY_DATA return bUseAllMaterialInDirectories? MaterialStreamer.HasAssets() : (MaterialList.Num() > 0); +#else + return false; +#endif //WITH_EDITORONLY_DATA } + class UMaterialInterface* URandomMaterialComponent::GetNextMaterial() { +#if WITH_EDITORONLY_DATA // Choose a random material in the list UMaterialInterface* NewMaterial = nullptr; if (bUseAllMaterialInDirectories) @@ -151,8 +157,8 @@ class UMaterialInterface* URandomMaterialComponent::GetNextMaterial() { NewMaterial = MaterialList[FMath::Rand() % MaterialList.Num()]; } - return NewMaterial; -} - +#else + return nullptr; #endif //WITH_EDITORONLY_DATA +} \ No newline at end of file diff --git a/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/GroupActorManager.cpp b/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/GroupActorManager.cpp index ae11986db2d..b30433fb029 100644 --- a/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/GroupActorManager.cpp +++ b/Source/Plugins/DomainRandomizationDNN/Source/DomainRandomizationDNN/Public/GroupActorManager.cpp @@ -322,6 +322,8 @@ void AGroupActorManager::Tick(float DeltaTime) } } + + void AGroupActorManager::DestroyManagedActors() { for (auto CheckActor : ManagedActors) @@ -334,9 +336,7 @@ void AGroupActorManager::DestroyManagedActors() } ManagedActors.Reset(); } - #if WITH_EDITORONLY_DATA - void AGroupActorManager::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) { const UProperty* PropertyThatChanged = PropertyChangedEvent.MemberProperty; diff --git a/Source/Plugins/NVDataObject/Source/NVDataObject/Private/NVDataObject.cpp b/Source/Plugins/NVDataObject/Source/NVDataObject/Private/NVDataObject.cpp index f7f7ff45268..99dda675041 100644 --- a/Source/Plugins/NVDataObject/Source/NVDataObject/Private/NVDataObject.cpp +++ b/Source/Plugins/NVDataObject/Source/NVDataObject/Private/NVDataObject.cpp @@ -5,6 +5,7 @@ */ #include "NVDataObjectModule.h" +#include "Runtime/Core/Public/Misc/FileHelper.h" #include "Components/ChildActorComponent.h" #include "EditorFramework/AssetImportData.h" #include "Serialization/JsonReader.h" diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVAnnotatedActor.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVAnnotatedActor.cpp index 572df942f82..10a289f1db8 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVAnnotatedActor.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVAnnotatedActor.cpp @@ -8,9 +8,9 @@ #include "NVAnnotatedActor.h" #include "NVCoordinateComponent.h" #include "Components/StaticMeshComponent.h" -#include "Factories/FbxAssetImportData.h" #include "Engine.h" #if WITH_EDITOR +#include "Factories/FbxAssetImportData.h" #include "UnrealEdGlobals.h" #include "Editor/UnrealEdEngine.h" #endif @@ -244,6 +244,7 @@ FMatrix ANVAnnotatedActor::GetMeshInitialMatrix() const UStaticMesh* ActorStaticMesh = MeshComponent ? MeshComponent->GetStaticMesh() : nullptr; if (ActorStaticMesh) { +#if WITH_EDITOR UFbxAssetImportData* FbxAssetImportData = Cast(ActorStaticMesh->AssetImportData); FMatrix MeshImportMatrix = FMatrix::Identity; @@ -270,6 +271,7 @@ FMatrix ANVAnnotatedActor::GetMeshInitialMatrix() const MatY = -MatY; MeshInitialMatrix_OpenCV.SetAxes(nullptr, &MatY, nullptr); ResultFMatrix = MeshInitialMatrix_OpenCV; +#endif // WITH_EDITOR } return ResultFMatrix; } diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVImageExporter.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVImageExporter.cpp index 68ae0531831..79449c6428c 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVImageExporter.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVImageExporter.cpp @@ -350,21 +350,10 @@ FNVImageExporter_Thread::FNVImageExporter_Thread(IImageWrapperModule* InImageWra FNVImageExporter_Thread::~FNVImageExporter_Thread() { - bIsRunning = false; ImageWrapperModule = nullptr; - QueuedImageData.Empty(); - - if (HavePendingImageEvent) - { - // Trigger the event so the thread doesn't wait anymore - HavePendingImageEvent->Trigger(); - FPlatformProcess::ReturnSynchEventToPool(HavePendingImageEvent); - HavePendingImageEvent = nullptr; - } - if (Thread) { - Thread->Kill(); + Thread->Kill(true); Thread = nullptr; } } @@ -432,6 +421,12 @@ uint32 FNVImageExporter_Thread::Run() void FNVImageExporter_Thread::Stop() { bIsRunning = false; + if (HavePendingImageEvent) + { + // Trigger the event so the thread doesn't wait anymore + HavePendingImageEvent->Trigger(); + } + QueuedImageData.Empty(); } uint32 FNVImageExporter_Thread::GetPendingImagesCount() const diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCaptureComponent2D.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCaptureComponent2D.cpp index 6d58434260a..a8ba529958f 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCaptureComponent2D.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCaptureComponent2D.cpp @@ -7,6 +7,7 @@ #include "NVSceneCapturerModule.h" #include "NVSceneCaptureComponent2D.h" #include "Engine/TextureRenderTarget2D.h" +#include "Engine.h" DEFINE_LOG_CATEGORY(LogNVSceneCapturerComponent2D); diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerActor.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerActor.cpp index e476a257e81..34633d02e52 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerActor.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneCapturerActor.cpp @@ -12,13 +12,13 @@ #include "NVSceneManager.h" #include "NVAnnotatedActor.h" #include "NVSceneDataHandler.h" -#include "Factories/FbxAssetImportData.h" #include "Engine.h" #include "JsonObjectConverter.h" #if WITH_EDITOR +#include "Factories/FbxAssetImportData.h" #include "UnrealEdGlobals.h" #include "Editor/UnrealEdEngine.h" -#endif +#endif // WITH_EDITOR const float MAX_StartCapturingDuration = 5.0f; // max duration to wait for ANVSceneCapturerActor::StartCapturing to successfully begin capturing before emitting warning messages diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneDataHandler.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneDataHandler.cpp index da329c569f9..7fb7db297b2 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneDataHandler.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneDataHandler.cpp @@ -14,9 +14,9 @@ #include "NVAnnotatedActor.h" #include "NVSceneManager.h" #include "Engine.h" -#include "Factories/FbxAssetImportData.h" #include "JsonObjectConverter.h" #if WITH_EDITOR +#include "Factories/FbxAssetImportData.h" #include "UnrealEdGlobals.h" #include "Editor/UnrealEdEngine.h" #endif @@ -77,7 +77,7 @@ bool UNVSceneDataExporter::HandleSceneAnnotationData(const TSharedPtr(new FNVImageExporter_Thread(ImageWrapperModule)); } @@ -180,6 +180,7 @@ void UNVSceneDataExporter::ExportCapturerSettings() UStaticMesh* ActorStaticMesh = ActorMeshComp->GetStaticMesh(); if (ActorStaticMesh) { +#if WITH_EDITOR UFbxAssetImportData* FbxAssetImportData = Cast(ActorStaticMesh->AssetImportData); FMatrix ImportMatrix = FMatrix::Identity; @@ -216,6 +217,7 @@ void UNVSceneDataExporter::ExportCapturerSettings() SceneAnnotatedActorData.exported_object_classes.Add(ActorClassName); ActorClassNames.Add(ActorClassName); +#endif // WITH_EDITOR } } } @@ -279,7 +281,10 @@ void UNVSceneDataExporter::ExportCapturerSettings() void UNVSceneDataExporter::OnStopCapturingSceneData() { - ImageExporterThread.Reset(); + if (ImageExporterThread.IsValid()) + { + ImageExporterThread->Stop(); + } } void UNVSceneDataExporter::OnCapturingCompleted() diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneFeatureExtractor_DataExport.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneFeatureExtractor_DataExport.cpp index ba82eea87a3..be3959da6eb 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneFeatureExtractor_DataExport.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneFeatureExtractor_DataExport.cpp @@ -21,6 +21,7 @@ #include "PhysicsEngine/AggregateGeom.h" #include "PhysicsEngine/BodySetup.h" #include "PhysicsEngine/PhysicsAsset.h" +#include "Components/SkeletalMeshComponent.h" //========================================== UNVSceneFeatureExtractor_DataExport ========================================== UNVSceneFeatureExtractor_AnnotationData::UNVSceneFeatureExtractor_AnnotationData(const FObjectInitializer& ObjectInitializer) diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneManager.cpp b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneManager.cpp index 50005320918..51fa42ddfb7 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneManager.cpp +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Private/NVSceneManager.cpp @@ -11,9 +11,9 @@ #include "NVSceneManager.h" #include "NVSceneMarker.h" #include "Components/StaticMeshComponent.h" -#include "Factories/FbxAssetImportData.h" #include "Engine.h" #if WITH_EDITOR +#include "Factories/FbxAssetImportData.h" #include "UnrealEdGlobals.h" #include "Editor/UnrealEdEngine.h" #endif diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVImageExporter.h b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVImageExporter.h index 33217e6766f..18e557d0ea3 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVImageExporter.h +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVImageExporter.h @@ -83,7 +83,7 @@ struct NVSCENECAPTURER_API FNVImageExporter_Thread : public FRunnable protected: FRunnableThread* Thread; - bool bIsRunning; + FThreadSafeBool bIsRunning; TQueue QueuedImageData; diff --git a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVSceneCapturerUtils.h b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVSceneCapturerUtils.h index 0fab7cc21ee..43fa76c2a02 100644 --- a/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVSceneCapturerUtils.h +++ b/Source/Plugins/NVSceneCapturer/Source/NVSceneCapturer/Public/NVSceneCapturerUtils.h @@ -6,6 +6,8 @@ #pragma once #include "NVSceneCapturerModule.h" +#include "Components/ActorComponent.h" +#include "Components/StaticMeshComponent.h" #include "IImageWrapper.h" #include "Runtime/Core/Public/Misc/FileHelper.h" #include "Kismet/BlueprintFunctionLibrary.h" diff --git a/Source/Plugins/NVUtilities/Source/NVUtilities/Public/Movement/NVWaypoint.h b/Source/Plugins/NVUtilities/Source/NVUtilities/Public/Movement/NVWaypoint.h index b5f20ec9d3d..2ca7a1f730f 100644 --- a/Source/Plugins/NVUtilities/Source/NVUtilities/Public/Movement/NVWaypoint.h +++ b/Source/Plugins/NVUtilities/Source/NVUtilities/Public/Movement/NVWaypoint.h @@ -6,6 +6,7 @@ #pragma once #include "CoreMinimal.h" +#include "GameFramework/Actor.h" #include "NVWaypoint.generated.h" /** diff --git a/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVNavigationPath.h b/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVNavigationPath.h index 751c20e46c2..fc3710dca7c 100644 --- a/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVNavigationPath.h +++ b/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVNavigationPath.h @@ -6,6 +6,7 @@ #pragma once #include "CoreMinimal.h" +#include "GameFramework/Actor.h" #include "NVNavigationPath.generated.h" class ANVWaypoint; diff --git a/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVZone.h b/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVZone.h index 8384a17e983..b904a11cab8 100644 --- a/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVZone.h +++ b/Source/Plugins/NVUtilities/Source/NVUtilities/Public/NVZone.h @@ -6,6 +6,7 @@ #pragma once #include "CoreMinimal.h" +#include "GameFramework/Actor.h" #include "NVZone.generated.h" /** diff --git a/readme.md b/readme.md index 0fe1e5dd4c2..17ace7a9053 100644 --- a/readme.md +++ b/readme.md @@ -1,5 +1,8 @@ +NVIDIA Deep learning Dataset Synthesizer (NDDS) +=============================================== + Overview -======== +-------- **NDDS** is a UE4 plugin from NVIDIA to empower computer vision researchers to export high-quality synthetic images with metadata. NDDS supports images, segmentation, depth, object pose, bounding box, keypoints, and custom stencils. In addition to the exporter, the plugin includes different components for generating highly randomized images. This randomization includes lighting, objects, camera position, poses, textures, and distractors, as well as camera path following, and so forth. Together, these components allow researchers to easily create randomized scenes for training deep neural networks. @@ -11,7 +14,7 @@ Downloading ----------- This repository uses gitLFS -- **DO NOT DOWNLOAD AS .ZIP**: -> **First, install git LFS (large file storage):** https://git-lfs.github.com/ , **then clone**. +> **First, install git LFS (large file storage):** https://git-lfs.github.com/ , **then lfs clone**. For further details, please see https://github.com/NVIDIA/Dataset_Synthesizer/blob/master/Documentation/NDDS.pdf