waps101 / AlbedoMM

Albedo Morphable Model
249 stars 34 forks source link

Cannot compile assembly.jar from source code #7

Open QixinDeng opened 3 years ago

QixinDeng commented 3 years ago

Hi, thank you for your great work. I have a problem when running the fitter. I am using Ubuntu 16.04, and java-8 when I run the command

sbt run -mem 2000

the program will produce the following error:

[info] Compiling 11 Scala sources to D:\AlbedoMM\AlbedoMM-1.0\scala\target\scala-2.11\classes...
sbt.InvalidComponent: Could not find required component 'xsbti'
        at sbt.ComponentManager.invalid(ComponentManager.scala:57)
        at sbt.ComponentManager.sbt$ComponentManager$$notFound$1(ComponentManager.scala:34)
        at sbt.ComponentManager.sbt$ComponentManager$$createAndCache$1(ComponentManager.scala:37)
        at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:27)
        at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:26)
        at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:55)
        at xsbt.boot.Locks$.apply0(Locks.scala:47)
        at xsbt.boot.Locks$.apply(Locks.scala:36)
        at sbt.ComponentManager.lock(ComponentManager.scala:50)
        at sbt.ComponentManager.lockGlobalCache(ComponentManager.scala:49)
        at sbt.ComponentManager.sbt$ComponentManager$$fromGlobal$1(ComponentManager.scala:25)
        at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
        at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
        at sbt.ComponentManager.sbt$ComponentManager$$getOrElse$1(ComponentManager.scala:32)
        at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
        at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
        at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:55)
        at xsbt.boot.Locks$.apply0(Locks.scala:47)
        at xsbt.boot.Locks$.apply(Locks.scala:36)
        at sbt.ComponentManager.lock(ComponentManager.scala:50)
        at sbt.ComponentManager.lockLocalCache(ComponentManager.scala:47)
        at sbt.ComponentManager.files(ComponentManager.scala:44)
        at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1.apply(ComponentCompiler.scala:114)
        at sbt.compiler.IvyComponentCompiler$$anonfun$sbt$compiler$IvyComponentCompiler$$compileAndInstall$1.apply(ComponentCompiler.scala:111)
        at sbt.IO$.withTemporaryDirectory(IO.scala:358)
        at sbt.compiler.IvyComponentCompiler.sbt$compiler$IvyComponentCompiler$$compileAndInstall(ComponentCompiler.scala:111)
        at sbt.compiler.IvyComponentCompiler$$anonfun$apply$1.apply$mcV$sp(ComponentCompiler.scala:102)
        at sbt.IfMissing$Define.apply(ComponentManager.scala:75)
        at sbt.ComponentManager.sbt$ComponentManager$$createAndCache$1(ComponentManager.scala:39)
        at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:27)
        at sbt.ComponentManager$$anonfun$sbt$ComponentManager$$fromGlobal$1$1.apply(ComponentManager.scala:26)
        at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
        at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
        at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
        at xsbt.boot.Using$.withResource(Using.scala:12)
        at xsbt.boot.Using$.apply(Using.scala:9)
        at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
        at xsbt.boot.Locks$.apply0(Locks.scala:47)
        at xsbt.boot.Locks$.apply(Locks.scala:36)
        at sbt.ComponentManager.lock(ComponentManager.scala:50)
        at sbt.ComponentManager.lockGlobalCache(ComponentManager.scala:49)
        at sbt.ComponentManager.sbt$ComponentManager$$fromGlobal$1(ComponentManager.scala:25)
        at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
        at sbt.ComponentManager$$anonfun$files$1$$anonfun$apply$2.apply(ComponentManager.scala:44)
        at sbt.ComponentManager.sbt$ComponentManager$$getOrElse$1(ComponentManager.scala:32)
        at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
        at sbt.ComponentManager$$anonfun$files$1.apply(ComponentManager.scala:44)
        at sbt.ComponentManager$$anon$1.call(ComponentManager.scala:50)
        at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:113)
        at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:91)
        at xsbt.boot.Locks$GlobalLock.$anonfun$withFileLock$1(Locks.scala:119)
        at xsbt.boot.Using$.withResource(Using.scala:12)
        at xsbt.boot.Using$.apply(Using.scala:9)
        at xsbt.boot.Locks$GlobalLock.withFileLock(Locks.scala:119)
        at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:71)
        at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:59)
        at xsbt.boot.Locks$.apply0(Locks.scala:47)
        at xsbt.boot.Locks$.apply(Locks.scala:36)
        at sbt.ComponentManager.lock(ComponentManager.scala:50)
        at sbt.ComponentManager.lockLocalCache(ComponentManager.scala:47)
        at sbt.ComponentManager.files(ComponentManager.scala:44)
        at sbt.ComponentManager.file(ComponentManager.scala:53)
        at sbt.compiler.IvyComponentCompiler.apply(ComponentCompiler.scala:102)
        at sbt.compiler.ComponentCompiler$$anon$2.apply(ComponentCompiler.scala:35)
        at sbt.compiler.AnalyzingCompiler.loader(AnalyzingCompiler.scala:118)
        at sbt.compiler.AnalyzingCompiler.getInterfaceClass(AnalyzingCompiler.scala:128)
        at sbt.compiler.AnalyzingCompiler.call(AnalyzingCompiler.scala:104)
        at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:62)
        at sbt.compiler.AnalyzingCompiler.newCachedCompiler(AnalyzingCompiler.scala:57)
        at sbt.compiler.CompilerCache$$anon$2.apply(CompilerCache.scala:47)
        at sbt.compiler.AnalyzingCompiler.compile(AnalyzingCompiler.scala:45)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply$mcV$sp(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler$$anonfun$compileScala$1$1.apply(MixedAnalyzingCompiler.scala:50)
        at sbt.compiler.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:74)
        at sbt.compiler.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:49)
        at sbt.compiler.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:64)
        at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt.compiler.IC$$anonfun$compileInternal$1.apply(IncrementalCompiler.scala:160)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:66)
        at sbt.inc.IncrementalCompile$$anonfun$doCompile$1.apply(Compile.scala:64)
        at sbt.inc.IncrementalCommon.cycle(IncrementalCommon.scala:32)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:72)
        at sbt.inc.Incremental$$anonfun$1.apply(Incremental.scala:71)
        at sbt.inc.Incremental$.manageClassfiles(Incremental.scala:99)
        at sbt.inc.Incremental$.compile(Incremental.scala:71)
        at sbt.inc.IncrementalCompile$.apply(Compile.scala:54)
        at sbt.compiler.IC$.compileInternal(IncrementalCompiler.scala:160)
        at sbt.compiler.IC$.incrementalCompile(IncrementalCompiler.scala:138)
        at sbt.Compiler$.compile(Compiler.scala:155)
        at sbt.Compiler$.compile(Compiler.scala:141)
        at sbt.Defaults$.sbt$Defaults$$compileIncrementalTaskImpl(Defaults.scala:927)
        at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:918)
        at sbt.Defaults$$anonfun$compileIncrementalTask$1.apply(Defaults.scala:916)
        at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
        at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:63)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
        at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
        at sbt.Execute.work(Execute.scala:237)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
        at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
[error] (compile:compileIncremental) sbt.InvalidComponent: Could not find required component 'xsbti'
[error] Total time: 39 s, completed Apr 16, 2021 12:06:32 AM

I tried on both Ubuntu 18.04 and windows 10, but got this same error.

Could you please help me with this? Thank you very much.

BernhardEgger commented 3 years ago

Hi,

I'm surprised to see a completely different issue here than indicated in the notification email I got. In the notification email the assembly.jar was running properly and as expected. The code was produces using an MCMC sampling strategy as indicated in the manuscript. This method is pretty slow since it uses a software renderer. The specular and diffuse albedo model is on top of that implemented via two rendering passes which makes it even slower. We did not focus on speed for the sampling. So the only thing you need to do to fix your first issue would be to wait for longer, the first 5k samples are for initialization, once the samples reach 15k you should get the result for the first image.

I have not seen the issue reported here before, the reported error seems to be related to sbt and/or cache. According to a google search it might help to delete the directories ~/.m2 ~/.ivy2. Since you tried under both, windows and ubuntu, the issue might be something else. Can you indicate what version of sbt and java (openjdk or oracle) you are using?

Best Bernhard

QixinDeng commented 3 years ago

Hi,

I'm surprised to see a completely different issue here than indicated in the notification email I got. In the notification email the assembly.jar was running properly and as expected. The code was produces using an MCMC sampling strategy as indicated in the manuscript. This method is pretty slow since it uses a software renderer. The specular and diffuse albedo model is on top of that implemented via two rendering passes which makes it even slower. We did not focus on speed for the sampling. So the only thing you need to do to fix your first issue would be to wait for longer, the first 5k samples are for initialization, once the samples reach 15k you should get the result for the first image.

I have not seen the issue reported here before, the reported error seems to be related to sbt and/or cache. According to a google search it might help to delete the directories ~/.m2 ~/.ivy2. Since you tried under both, windows and ubuntu, the issue might be something else. Can you indicate what version of sbt and java (openjdk or oracle) you are using?

Best Bernhard

Hi, sorry for late reply, I do not know why I did not receive notice for this reply. The version of sbt is 1.5.0 and java-8. Also I have a little bit confuse that for your albedo model, do I have to use Sperical Harmonics paramters to simulate environment lighting? If I have to, how to combine those? In the fitting results, I can only see the "color" attribute, but I believe your diffuse albedo and specular are controled independently, is there any possible to produce both of it? Thank you very much for your help.

BernhardEgger commented 3 years ago

Hi,

can you tell me if you are using java 8 from oracle or openjdk? Also, can you let me know if your goal is to run the jar file or to compile the code?

You can use whatever illumination model you would like to use, we provide here an implementation that parametrizes light via spherical harmonics. The parameters for the diffuse and specular albedo are coupled as described in the paper (section statistical modeling and equation 9 and 10 https://openaccess.thecvf.com/content_CVPR_2020/papers/Smith_A_Morphable_Face_Albedo_Model_CVPR_2020_paper.pdf). So the color parameters lead to both a diffuse and specular albedo map and the code derives both from the color parameter.

Best Bernhard

QixinDeng commented 3 years ago

Hi, I use openjdk-java: 8.0.282.hs-adpt. I would like to compile the code from the source.

I see, so the parameter for specular and diffuse are coupled and not independent right?

Also, for the parametrizes light of SH, the way you did is to calculate per-vertex color using equation(11), and then apply SH lighting on per-vertex color, and finally render it, right? Because in my opinion, SH is usually used for diffuse lighting simulation, hope you can clearify this process.

Thank you very much!

BernhardEgger commented 3 years ago

Hi, can you try to run sbt compile first? yes, the parameters are not separated and the defuse and specular model are coupled.

Best Bernhard

QixinDeng commented 3 years ago

Hi,

I'm surprised to see a completely different issue here than indicated in the notification email I got. In the notification email the assembly.jar was running properly and as expected. The code was produces using an MCMC sampling strategy as indicated in the manuscript. This method is pretty slow since it uses a software renderer. The specular and diffuse albedo model is on top of that implemented via two rendering passes which makes it even slower. We did not focus on speed for the sampling. So the only thing you need to do to fix your first issue would be to wait for longer, the first 5k samples are for initialization, once the samples reach 15k you should get the result for the first image.

I have not seen the issue reported here before, the reported error seems to be related to sbt and/or cache. According to a google search it might help to delete the directories ~/.m2 ~/.ivy2. Since you tried under both, windows and ubuntu, the issue might be something else. Can you indicate what version of sbt and java (openjdk or oracle) you are using?

Best Bernhard

Could you please explain a little bit " implemented via two rendering passes"? Because as I see by applied equation(11) in your paper, there should be only one rendering passes. Thank you very much.

BernhardEgger commented 3 years ago

We implemented I_diff and I_spec with separate rendering passes. You can implement it in one. The equation leaves the choice of implementation open. We choose two for the scala implementation because it was easier, especially when we want to be able to afterwards visualize them separately.

QixinDeng commented 3 years ago

Hi, can you try to run sbt compile first? yes, the parameters are not separated and the defuse and specular model are coupled.

Best Bernhard

Hi, It just produces the same error. Maybe I missed some package? There are too few info I can find on the internet. Thank you very much.

BernhardEgger commented 3 years ago

I use openjdk 8 on Ubuntu (now 20.04 but previously 18.04 and 16.04) and sbt 1.3 so the sbt version is probably the main difference Since you said previously that you also observe the issue under windows, can you perhaps try sbt 1.3 or 1.4 instead of the most recent version? sbt 1.5 was released 2 weeks ago, so it is very likely that if there is an issue there you are the first one to run into it

an other alternative would be to import the project into intellij idea and try to compile from there?

QixinDeng commented 3 years ago

We implemented I_diff and I_spec with separate rendering passes. You can implement it in one. The equation leaves the choice of implementation open. We choose two for the scala implementation because it was easier, especially when we want to be able to afterwards visualize them separately.

Hi, From your Scala code, I think your two render passes are different. For diffuse albedo, it looks like you directly rendered it without apply any lighting assumption. For specular albedo, it looks like you combine SH with BRDF to render it. Is that true? I am not familiar with Scala, I want to implement a similar render process in python or matlab, thus I can do some research by using your albedo model. Thank you very much!

BernhardEgger commented 3 years ago

Hi, both diffuse and specular albedo are rendered with SH. And yes, the specular part has to be rendered separately, since specular reflections work differently. Best Bernhard

QixinDeng commented 3 years ago

Hi, both diffuse and specular albedo are rendered with SH. And yes, the specular part has to be rendered separately, since specular reflections work differently. Best Bernhard

Hi, So the SH is same for both diffuse and specular albedo, right?

For diffuse, I think you should directly apply SH with vertex normal and diffuse color, right?

For specular, I think the following code is used to calculate per-vertex specular color, right?

object SphericalHarmonicsSpecularMapsShader {
  def specularPart(posWorld: Point[_3D], normalWorld: EuclideanVector[_3D], specularAlbedo: RGBA, environmentMap: IndexedSeq[EuclideanVector[_3D]], specularExp: Double): RGBA = {
    /** BRDF: find outgoing vector for given view vector (reflect) */
    val vecToEye: EuclideanVector3D = (Point3D(0, 0, 0) - posWorld).normalize
    val viewAdjusted = vecToEye * vecToEye.dot(normalWorld)
    val reflected = normalWorld + (normalWorld - viewAdjusted)
    /** Read out value in environment map in out direction for specularity */
    val lightInOutDirection = SphericalHarmonicsLambertShader.shade(specularAlbedo, reflected, environmentMap)
    val specularFactor = math.pow(vecToEye.dot(reflected).toDouble, specularExp)
    specularFactor *: lightInOutDirection
  }
}

Thank you for your clearification.

BernhardEgger commented 3 years ago

yes, the SH parameters are the same for both. yes on both, diffuse and specular

the specular component is slightly more complex to calculate since it depends not only on the light SH but also on the viewpoint.

QixinDeng commented 3 years ago

yes, the SH parameters are the same for both. yes on both, diffuse and specular

the specular component is slightly more complex to calculate since it depends not only on the light SH but also on the viewpoint.

Thank you very much! I am really appreciating your patience and every response. I will try to work it out. Hope you have a good night!

BernhardEgger commented 3 years ago

Good night :)

Let me know if the compilation issue resolved?