Skip to content

Commit

Permalink
Add support for Linux with respective documentation update.
Browse files Browse the repository at this point in the history
Add support for Linux with respective documentation update.
  • Loading branch information
Sserpenthraxus-nv committed Jul 31, 2018
1 parent 3a9faf0 commit c17c315
Show file tree
Hide file tree
Showing 18 changed files with 52 additions and 31 deletions.
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
!*.txt
!*.md

# Other Doc files
!*.pdf
!*.png
!*.mp4

# Script files
!*.bat
!*.sh
Expand Down Expand Up @@ -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/**

Expand Down
Binary file modified Documentation/NDDS.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -151,8 +157,8 @@ class UMaterialInterface* URandomMaterialComponent::GetNextMaterial()
{
NewMaterial = MaterialList[FMath::Rand() % MaterialList.Num()];
}

return NewMaterial;
}

#else
return nullptr;
#endif //WITH_EDITORONLY_DATA
}
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ void AGroupActorManager::Tick(float DeltaTime)
}
}



void AGroupActorManager::DestroyManagedActors()
{
for (auto CheckActor : ManagedActors)
Expand All @@ -334,9 +336,7 @@ void AGroupActorManager::DestroyManagedActors()
}
ManagedActors.Reset();
}

#if WITH_EDITORONLY_DATA

void AGroupActorManager::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent)
{
const UProperty* PropertyThatChanged = PropertyChangedEvent.MemberProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -244,6 +244,7 @@ FMatrix ANVAnnotatedActor::GetMeshInitialMatrix() const
UStaticMesh* ActorStaticMesh = MeshComponent ? MeshComponent->GetStaticMesh() : nullptr;
if (ActorStaticMesh)
{
#if WITH_EDITOR
UFbxAssetImportData* FbxAssetImportData = Cast<UFbxAssetImportData>(ActorStaticMesh->AssetImportData);
FMatrix MeshImportMatrix = FMatrix::Identity;

Expand All @@ -270,6 +271,7 @@ FMatrix ANVAnnotatedActor::GetMeshInitialMatrix() const
MatY = -MatY;
MeshInitialMatrix_OpenCV.SetAxes(nullptr, &MatY, nullptr);
ResultFMatrix = MeshInitialMatrix_OpenCV;
#endif // WITH_EDITOR
}
return ResultFMatrix;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "NVSceneCapturerModule.h"
#include "NVSceneCaptureComponent2D.h"
#include "Engine/TextureRenderTarget2D.h"
#include "Engine.h"

DEFINE_LOG_CATEGORY(LogNVSceneCapturerComponent2D);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,7 +77,7 @@ bool UNVSceneDataExporter::HandleSceneAnnotationData(const TSharedPtr<FJsonObjec

void UNVSceneDataExporter::OnStartCapturingSceneData()
{
if (!ImageExporterThread)
if (!ImageExporterThread.IsValid())
{
ImageExporterThread = TUniquePtr<FNVImageExporter_Thread>(new FNVImageExporter_Thread(ImageWrapperModule));
}
Expand Down Expand Up @@ -180,6 +180,7 @@ void UNVSceneDataExporter::ExportCapturerSettings()
UStaticMesh* ActorStaticMesh = ActorMeshComp->GetStaticMesh();
if (ActorStaticMesh)
{
#if WITH_EDITOR
UFbxAssetImportData* FbxAssetImportData = Cast<UFbxAssetImportData>(ActorStaticMesh->AssetImportData);
FMatrix ImportMatrix = FMatrix::Identity;

Expand Down Expand Up @@ -216,6 +217,7 @@ void UNVSceneDataExporter::ExportCapturerSettings()
SceneAnnotatedActorData.exported_object_classes.Add(ActorClassName);

ActorClassNames.Add(ActorClassName);
#endif // WITH_EDITOR
}
}
}
Expand Down Expand Up @@ -279,7 +281,10 @@ void UNVSceneDataExporter::ExportCapturerSettings()

void UNVSceneDataExporter::OnStopCapturingSceneData()
{
ImageExporterThread.Reset();
if (ImageExporterThread.IsValid())
{
ImageExporterThread->Stop();
}
}

void UNVSceneDataExporter::OnCapturingCompleted()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct NVSCENECAPTURER_API FNVImageExporter_Thread : public FRunnable

protected:
FRunnableThread* Thread;
bool bIsRunning;
FThreadSafeBool bIsRunning;

TQueue<FNVImageExporterData> QueuedImageData;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "NVWaypoint.generated.h"

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "NVNavigationPath.generated.h"

class ANVWaypoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "NVZone.generated.h"

/**
Expand Down
7 changes: 5 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand Down

0 comments on commit c17c315

Please sign in to comment.