LocalJoost / YoloHolo

HoloLens app using a Yolo model to identify objects in space
MIT License
38 stars 6 forks source link

Error to build and play #4

Open raucal opened 1 year ago

raucal commented 1 year ago

Hello! Your project looks fascinating and I would love to try it on my HL2s. However, he still couldn't get it due to a series of errors. He followed the following steps: 1) I extract the project in D:\ 2) I copy the onnx model to the Model folder of the Assets. 3) I open the project and try to build for the Windows platform and get the following errors: image

When trying to play with Holographic Remoting for Play Mode I get: image

If I switch to UWP when playing I find this: (3) image

If you could tell me how I can solve these errors, I would appreciate it. Greetings.

También obtengo el siguiente erro que me lleva a la línea 1349 del script Service Manager.csr: (4) Object reference not set to an instance of an object at Unity.Barracuda.ModelLoader.Load (Unity.Barracuda.NNModel model, System.Boolean verbose, System.Boolean skipWeights) [0x00000] in D:\YoloHolo\Library\PackageCache\com.unity.barracuda@557e933876\Barracuda\Runtime\Core\ModelLoader.cs:31 at YoloHolo.Services.YoloProcessor.Initialize () [0x00000] in D:\YoloHolo\Assets\Application\Scripts\Services\YoloProcessor.cs:25 at RealityCollective.ServiceFramework.Services.ServiceManager.InitializeAllServices () [0x00033] in D:\YoloHolo\Library\PackageCache\com.realitycollective.service-framework@1.0.3-pre.2\Runtime\Services\ServiceManager.cs:1344 UnityEngine.Debug:LogError (object) RealityCollective.ServiceFramework.Services.ServiceManager:InitializeAllServices () (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Services/ServiceManager.cs:1349) RealityCollective.ServiceFramework.Services.ServiceManager:InitializeServiceLocator (UnityEngine.GameObject) (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Services/ServiceManager.cs:413) RealityCollective.ServiceFramework.Services.ServiceManager:InitializeInstance (RealityCollective.ServiceFramework.Definitions.ServiceProvidersProfile) (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Services/ServiceManager.cs:312) RealityCollective.ServiceFramework.Services.ServiceManager:Initialize (UnityEngine.GameObject,RealityCollective.ServiceFramework.Definitions.ServiceProvidersProfile) (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Services/ServiceManager.cs:260) RealityCollective.ServiceFramework.Services.ServiceManager:.ctor (UnityEngine.GameObject,RealityCollective.ServiceFramework.Definitions.ServiceProvidersProfile,System.Type[]) (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Services/ServiceManager.cs:230) RealityCollective.ServiceFramework.ServiceManagerInstance:InitialiseServiceManager () (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Utilities/ServiceManagerInstance.cs:56) RealityCollective.ServiceFramework.ServiceManagerInstance:Awake () (at Library/PackageCache/com.realitycollective.service-framework@1.0.3-pre.2/Runtime/Utilities/ServiceManagerInstance.cs:101)

LocalJoost commented 1 year ago

What Unity version do you use? What for what platform are you building for? It looks like you are building for Windows stand alone.

image

Also, did you read the blog post? https://localjoost.github.io/HoloLens-AI-using-Yolo-ONNX-models-to-localize-objects-in-3D-space/

raucal commented 1 year ago

Yes, that's what I tried to do at first, but when I switched to Universal Windows Platform I tried to play with Holographic Remoting for Play Mode and got the last two errors I'm telling you about: (3) (4)

I use Unity 2021.3.16f1 in Windows 11

raucal commented 1 year ago

To be more precise in my descriptions I have reopened the project. I want to mention that as soon as I open it I get 247 errors. Then, change the platform to UWP: image

The XR Plug-in Management and OpenXR are: image

image

The MRTK3 settings are: image

When I enable holographic remoting for play mode and press play I get the following errors:

Object reference not set to an instance of an object at Unity.Barracuda.ModelLoader.Load (Unity.Barracuda.NNModel model, System.Boolean verbose, System.Boolean skipWeights) [0x00000] in D:\YoloHolo\Library\PackageCache\com.unity.barracuda@557e933876\Barracuda\Runtime\Core\ModelLoader.cs:31 at YoloHolo.Services.YoloProcessor.Initialize () [0x00000] in D:\YoloHolo\Assets\Application\Scripts\Services\YoloProcessor.cs:25 at RealityCollective.ServiceFramework.Services.ServiceManager.InitializeAllServices () [0x00033] in D:\YoloHolo\Library\PackageCache\com.realitycollective.service-framework@1.0.1\Runtime\Services\ServiceManager.cs:1327 UnityEngine.Debug:LogError (object) RealityCollective.ServiceFramework.Services.ServiceManager:InitializeAllServices () (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Services/ServiceManager.cs:1332) RealityCollective.ServiceFramework.Services.ServiceManager:InitializeServiceLocator (UnityEngine.GameObject) (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Services/ServiceManager.cs:395) RealityCollective.ServiceFramework.Services.ServiceManager:InitializeInstance (RealityCollective.ServiceFramework.Definitions.ServiceProvidersProfile) (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Services/ServiceManager.cs:308) RealityCollective.ServiceFramework.Services.ServiceManager:Initialize (UnityEngine.GameObject,RealityCollective.ServiceFramework.Definitions.ServiceProvidersProfile) (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Services/ServiceManager.cs:257) RealityCollective.ServiceFramework.Services.ServiceManager:.ctor (UnityEngine.GameObject,RealityCollective.ServiceFramework.Definitions.ServiceProvidersProfile,System.Type[]) (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Services/ServiceManager.cs:227) RealityCollective.ServiceFramework.ServiceManagerInstance:InitialiseServiceManager () (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Utilities/ServiceManagerInstance.cs:56) RealityCollective.ServiceFramework.ServiceManagerInstance:Awake () (at Library/PackageCache/com.realitycollective.service-framework@1.0.1/Runtime/Utilities/ServiceManagerInstance.cs:101)

ERROR - Could not find specified video device UnityEngine.StackTraceUtility:ExtractStackTrace () YoloHolo.YoloLabeling.YoloObjectLabeler:Start () (at Assets/Application/Scripts/YoloLabeling/YoloObjectLabeler.cs:51)

[Update] I don't know why but now it lets me build the solution and implement it in HL2. However, I can see errors in the glasses.

LocalJoost commented 1 year ago

Well it does not work on Play mode, I can tell you that. It's hard to see what you are doing wrong. I recently had a few Canadian students asking questions but that was for using a different model. The app itself worked fine

LocalJoost commented 1 year ago

So this is what I did:

0 errors, and app builds. I build for Master and deploy. I run the app, it asks for eye tracker and camera access, and works as intended. So I have no idea what you are doing differently, but I would suggest following this recipe.

raucal commented 1 year ago

I finally managed to implement this application in HL2. I forgot to add the model to the YoloProcessor tab. I wanted to ask you if there is any way to be able to play the application with the Holographic Remoting for Play Mode

LocalJoost commented 1 year ago

Congratulations. And no I don't know. I never tried tbh. The app should work in the editor, insofar as it recognizes stuff - provided you have a camera. But of course it cannot pinpoint them in space as only the HoloLens has a depth camera