emilianavt / OpenSeeFaceSample

This is a cross-platform sample Unity project showing a basic OpenSeeFace setup. Open the included scene.
BSD 2-Clause "Simplified" License
55 stars 14 forks source link

"DllNotFoundException: SVMModel" when trying to "Train" with OpenSeeExpression #4

Open Beat24 opened 2 years ago

Beat24 commented 2 years ago

I'm using Unity 2020.3.30f1 Personal running on KDE Neon 5.24 (Ubuntu 20.04 LTS)

I'm trying to record expressions with the OpenSeeExpression Script, but when I click "Train" I get this Exception in the Console:

DllNotFoundException: SVMModel OpenSee.SVMModel.trainModel (System.Single[] features, System.Single[] labels, System.Single[] weights, System.Int32 rows, System.Int32 cols, System.Int32 classes, System.Int32 probability, System.Single C) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:19) OpenSee.SVMModel.TrainModel (System.Single[] features, System.Single[] labels, System.Single[] weights, System.Int32 rows, System.Int32 cols, System.Int32 probability, System.Single C) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:174) OpenSee.OpenSeeExpression.TrainModel () (at Assets/OpenSeeFace/OpenSeeExpression.cs:528) OpenSee.OpenSeeExpression.Update () (at Assets/OpenSeeFace/OpenSeeExpression.cs:701)

I also get this message when clicking the "Load" tick:

ArgumentNullException: Buffer cannot be null. Parameter name: buffer System.IO.MemoryStream..ctor (System.Byte[] buffer, System.Boolean writable) (at <695d1cc93cca45069c528c15c9fdd749>:0) System.IO.MemoryStream..ctor (System.Byte[] buffer) (at <695d1cc93cca45069c528c15c9fdd749>:0) (wrapper remoting-invoke-with-check) System.IO.MemoryStream..ctor(byte[]) OpenSee.SVMModel.LoadSerialized (System.Byte[] modelBytes, System.Int32& cols, System.Int32& maxClasses, System.Boolean compress) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:82) OpenSee.SVMModel.LoadModel (System.Byte[] modelBytes, System.Boolean compress) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:129) OpenSee.SVMModel.LoadModel (System.Byte[] modelBytes) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:134) OpenSee.SVMModel..ctor (System.Byte[] modelBytes) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:277) OpenSee.OpenSeeExpression+OpenSeeExpressionRepresentation.LoadSerialized (System.Byte[] modelBytes, System.Collections.Generic.Dictionary`2[System.String,System.Collections.Generic.List1[System.Single[]]]& expressions, OpenSee.SVMModel& model, System.String[]& classLabels, System.Int32[]& indices, OpenSee.OpenSeeExpression+PointSelection& pointSelection) (at Assets/OpenSeeFace/OpenSeeExpression.cs:172) OpenSee.OpenSeeExpression.LoadFromBytes (System.Byte[] data) (at Assets/OpenSeeFace/OpenSeeExpression.cs:653) OpenSee.OpenSeeExpression.LoadFromFile () (at Assets/OpenSeeFace/OpenSeeExpression.cs:675) OpenSee.OpenSeeExpression.Update () (at Assets/OpenSeeFace/OpenSeeExpression.cs:704)

I haven't edited neither the script nor the plugin, I also seem to be getting the corresponding Debug.Logs when clicking "Train" up until

Training LibSVM UnityEngine.Debug:Log (object)

I also tried with ThunderSVM but it also fails

DllNotFoundException: ThunderSVMWrapper ThunderSVMModel.trainModel (System.Single[] features, System.Single[] labels, System.Single[] weights, System.Int32 rows, System.Int32 cols, System.Int32 classes, System.Int32 probability, System.Single C) (at Assets/OpenSeeFace/Plugins/ThunderSVMModel.cs:18) OpenSee.SVMModel.TrainModel (System.Single[] features, System.Single[] labels, System.Single[] weights, System.Int32 rows, System.Int32 cols, System.Int32 probability, System.Single C) (at Assets/OpenSeeFace/Plugins/SVMModel.cs:174) OpenSee.OpenSeeExpression.TrainModel () (at Assets/OpenSeeFace/OpenSeeExpression.cs:528) OpenSee.OpenSeeExpression.Update () (at Assets/OpenSeeFace/OpenSeeExpression.cs:701)

emilianavt commented 2 years ago

Hi! I believe the expression detection may not currently work natively under Linux.

You can probably make a Linux build using the files here:

https://github.com/emilianavt/OpenSeeFace/tree/master/Source

I haven't tested it, but something like g++ SVMWrapper.cpp svm.cpp -shared -o LibSVM.so might work. Then place it into the Plugins folder inside the Unity project.

Beat24 commented 2 years ago

When trying to build I get:

SVMWrapper.cpp:4:10: fatal error: stdafx.h: No existe el archivo o el directorio (The file nor the path exists) 4 | #include "stdafx.h" | ^~~~~~ compilation terminated. svm.cpp:1:10: fatal error: stdafx.h: No existe el archivo o el directorio (The file nor the path exists) 1 | #include "stdafx.h" | ^~~~~~ compilation terminated.

I checked with Visual Studio Code to see what was happening and I got some the exceptions (Translated)

svm.cpp (3)

  • Include errors have been detected. Update the value of includePath. The undulating underline is disabled for this translation unit

  • The source file can not be opened (Error code "stadfx.h").
  • The source file can not be opened (Error code "combaseapi.h").

svm.h (1)

  • Include errors have been detected. Update the value of includePath. The undulating underline is disabled for this translation unit

SVMWrapper.cpp (2)

  • Include errors have been detected. Update the value of includePath. The undulating underline is disabled for this translation unit

  • The source file can not be opened (Error code "stadfx.h").

ThunderSVMWrapper.cpp (7)

  • The source file can not be opened (Error code "pch.h").
  • The source file can not be opened (Error code "framework.h").
  • The source file can not be opened (Error code "ThunderSVMWrapper.h").
  • The source file can not be opened (Error code "thundersvm.h").
  • The source file can not be opened (Error code "svmmodel.h").
  • The source file can not be opened (Error code "svc.h").

I thought this was a problem with Linux so I checked in Windows and tried to build there, but I get the same problems. I searched and found that it seems I'm missing some header files that are supposed to be bundled with the IDE but I couldn't find them.

emilianavt commented 2 years ago

I'll look into making this part build properly.

Beat24 commented 2 years ago

Ok, thank you so much!