Error while using scalismo.color.RGB

97 views
Skip to first unread message

Rishubh Parihar

unread,
Jan 16, 2018, 1:58:01 PM1/16/18
to scalismo-faces
I am getting "object RGB is not a member of package scalismo.faces.color" error while importing scalismo.faces.color.RGB but RGB.scala file exists in color folder. Please help ASAP.

Thank you

Andreas Forster

unread,
Jan 17, 2018, 4:03:55 AM1/17/18
to Rishubh Parihar, scalismo-faces
Dear Rishubh,

In order that we can help we need a lot more information. Could you please tell us if you are using the tutorial or did you setup your own project in an IDE? How does your build.sbt looks like? And what code snippet did you use?

And please omit sentences like "Please help ASAP."  in the future. We are mostly working voluntary on these open-source projects and do our best to help.

Best regards
Andreas


On Tue, Jan 16, 2018 at 7:58 PM, Rishubh Parihar <parihar...@gmail.com> wrote:
I am getting "object RGB is not a member of package scalismo.faces.color" error while importing scalismo.faces.color.RGB but RGB.scala file exists in color folder. Please help ASAP.

Thank you

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.
To post to this group, send email to scalismo-faces@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scalismo-faces/dd4f041f-a522-461f-aaf5-b98032b9130d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
*****************************************
Dr. Andreas Morel-Forster
Departement Mathematik und Informatik
Spiegelgasse 1
CH-4051 Basel
PHONE: +41 61 207 05 52
MAIL: Andreas.Forster@unibas.ch
*****************************************

Rishubh Parihar

unread,
Jan 17, 2018, 4:26:22 AM1/17/18
to scalismo-faces
Dear Andreas,

Thanks for reverting back and also yes, I will keep the "ASAP" thing in mind.

Okay, so we are following the tutorial on Readme file. The build.sbt file looks like this 
organization  := "ch.unibas.cs.gravis"
name := """scalismo-faces"""
licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0")) 

scalaVersion  := "2.12.1"

crossScalaVersions := Seq("2.12.1", "2.11.8")

scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
    case Some((2,  11)) =>  Seq("-deprecation", "-unchecked", "-feature")
    case _ => Seq("-deprecation", "-unchecked", "-feature", "-opt:l:method")
})

libraryDependencies  ++= Seq(
"ch.unibas.cs.gravis" %% "scalismo-faces" % "0.8.0",
    "ch.unibas.cs.gravis" %% "scalismo" % "0.16.0",
    "ch.unibas.cs.gravis" % "scalismo-native-all" % "4.0.0",
    "org.scalatest" %% "scalatest" % "3.0.0" % "test"
)

resolvers ++= Seq(
Resolver.bintrayRepo("unibas-gravis", "maven"),
Resolver.jcenterRepo
)

// Git versioning
enablePlugins(GitVersioning, GitBranchPrompt)
com.typesafe.sbt.SbtGit.useJGit 
git.baseVersion := "develop"



Also, I used the same code snippet provided in the readme file. 

Thanks,
Rishubh

Andreas Forster

unread,
Jan 17, 2018, 7:45:35 AM1/17/18
to Rishubh Parihar, scalismo-faces
Hi Rishubh,

Unfortunatly our README was outdated. Thank you for making us aware of that.

With your build.sbt the sbt tool should complain when you run sbt update. You have the project name scalismo-faces but you also have the dependency scalsimo-faces. Have you checked out the repository or are you working in your own project?

- If you want to work within the library, throw out the dependency as it would mean that your project depends on it self which does not make sence.
- Or if you want to have a project that depends on scalismo-faces you should rename it by setting a different name.

I would suggest to start with the second option. This is the way I updated the README for now. (Somehow the old code was not working in the console. I have to investigate on that later.) For this:

- Create first a new project directory.
- Add to the project dir a file build.sbt with only the lines:

libraryDependencies += "ch.unibas.cs.gravis" %% "scalismo-faces" % "0.8.0"
resolvers += Resolver.bintrayRepo("unibas-gravis", "maven")

- create a file src/main/scala/ChessExample.scala in the project with the content:
import scalismo.faces.color.RGB
import scalismo.faces.image.PixelImage
import scalismo.faces.io.PixelImageIO
import java.io.File
object Playground extends App {
val checkerboard = PixelImage(128, 128, {(x, y) => if ((x+y)%2 == 0) RGB.White else RGB.Black})
PixelImageIO.write(checkerboard, new File("checkerboard.png")).get
}
- Execute sbt run in your project main directory where your build.sbt file is located.

I hope this helps you getting started.

Best regards

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Rishubh Parihar

unread,
Jan 22, 2018, 11:56:46 AM1/22/18
to scalismo-faces
Hi Andreas,

Thanks for the support. What exactly are required to run the model on a custom image? We used your landmark tool for generating the .tlms file. But how do I generate the .rps file? Also, do I also need the facebox image? If yes, how do I generate one?

Thanks,
Rishubh

Bernhard Egger

unread,
Jan 22, 2018, 5:19:10 PM1/22/18
to scalismo-faces
Hi Rishubh,

what you need is actually the last step of the Basel Face Pipeline:

Our defaultFitscript follows our publications:
To run it on images this code can be helpful:

You just need the image (jpg or png) and a landmarks file (tlms).

Best
Bernhard

Rishubh Parihar

unread,
Jan 23, 2018, 1:13:52 AM1/23/18
to scalismo-faces
Hi Andreas,

Sorry for troubling you again. I am following the tutorial for image fitting and tried to use it as a stand alone application and that requires the data from Basel data set (model2017-1_face12_nomouth). Now, in the face pipeline link you mentioned, it requires the data (BU-3DFE) so I am confused which data set to use. Is there any snippet/application where I can give an input image alongwith landmark points and get the final 3D output. It would be of immense help if such a thing is there.

Warm Regards,
Rishubh Parihar

Andreas Forster

unread,
Jan 23, 2018, 2:41:09 AM1/23/18
to Rishubh Parihar, scalismo-faces
Hi Rishubh,

The BU-3DFE data is used to exemplary build a model starting from scans. As soon as you are interested only in the fitting you can replace the model with the BFM, the Basel face model you mentioned or any other model that can be read by our software. Just skip the model building part and look only at the image fitting.

Best regards
Andreas

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Rishubh Parihar

unread,
Jan 31, 2018, 1:07:14 AM1/31/18
to scalismo-faces
Hi Andreas,

I am still not able to generate 3D reconstructions using images. I tried to run image fitting part from (https://github.com/unibas-gravis/basel-face-pipeline), I tried the following command:

sbt -mem 5000 "fitting.experiments.RecognitionMultiPiePose"

but it shows lots of error mostly of "file not found". As I was unable to find any description where to copy basel dataset.
Also what I have to download along with the basel-face-pipeline repo ( just basel dataset or something else as well ) and where
to store them. Their is no README in recognition-experiment folder as mentioned on this repo.
It would be great help if you could please elaborate how to costruct 3D face from 2D image using basel-face-pipeline because that is the first step of our project and I am quite stucked.

Thank you
Rishubh

Rishubh Parihar

unread,
Feb 1, 2018, 11:24:35 AM2/1/18
to scalismo-faces

Hi Andreas,

I tried to run code of scalismo image fitting tutorial as a standalone application and I was able to reconstruct the 3D face from 2D example image (ws_13). I tried to replace that image with some other image and added the landmark file (tlms) generated using your landmark tool, but I got the following error:

[error] (run-main-0) java.lang.IllegalArgumentException: requirement failed

Could you please help me what does this means and how to remove it.

Thank you
Rishubh

Andreas Forster

unread,
Feb 1, 2018, 11:46:48 AM2/1/18
to Rishubh Parihar, scalismo-faces
Dear Rishubh,

Thanks for pointing out that the README is missing. We are working on adding it soon. I let you know if we came further.

Best regards

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.
To post to this group, send email to scalismo-faces@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andreas Forster

unread,
Feb 1, 2018, 11:50:35 AM2/1/18
to Rishubh Parihar, scalismo-faces
Dear Rishubh,

With so little information it is hard to come up with a guess whats wrong. Please provide at least which class did you call with which command. If you call your own class please provide the code.

Best regards
Andreas


--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.
To post to this group, send email to scalismo-faces@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Bernhard Egger

unread,
Feb 1, 2018, 4:31:32 PM2/1/18
to scalismo-faces
Dear Rishubh and Andreas,

the README file is not missing - it is just not part of the repository on github, it comes with a seperate download:
The pipeline data contains the README file with the instructions to download the Multi-PIE face database.

The fitscript in the tutorial is mainly for teaching purpose, our state-of-the-art fitscript is the one here:

Best
Bernhard

Rishubh Parihar

unread,
Feb 3, 2018, 12:10:43 PM2/3/18
to scalismo-faces
Hi Andreas and Bernhard,

I am now able to fit 3D model to image in my stand alone application. Thanks a lot for valuable time. One last thing, I want to apply original 2D image texture to the generated 3D model. Is there any way to do it using scalismo as in the GUI the correspondence is already made  and also is it possible to store those correspondence somehow for texture mapping ?

Thanks,
Rishubh

Andreas Forster

unread,
Feb 5, 2018, 4:03:46 AM2/5/18
to Rishubh Parihar, scalismo-faces
Dear Rishubh,

Great that it worked for you with fitting an image.

Could you please start a new thread in the future if your question is not related to the old thread you already started. Otherwise the questions/answers are not easy to find for others and our effort for helping is increased a lot. Thx in advance.

For your question, please have a look at the probabilistic fitting tutorial chapter 4, 2nd part "Meshes": http://gravis.dmi.unibas.ch/PMM/lectures/fitting/
What you are looking for are the MeshSurfaceProperties. Here a small code snippet that might help you creating your textured mesh:
val mesh: TriangleMesh[_3D] = ???

val textureImage: PixelImage[RGBA] = ???
val vertexPositionsInTextureImage: IndexedSeq[Point[_2D]] = ???
val textureMapping: MeshSurfaceProperty[Point[_2D]] = SurfacePointProperty[Point[_2D]](mesh.triangulation,vertexPositionsInTextureImage)
val texture: TextureMappedProperty[RGBA] = TextureMappedProperty(mesh.triangulation,textureMapping,textureImage)

val texturedMesh = ColorNormalMesh3D(mesh,texture,mesh.vertexNormals)
I think there is no direct support to calculate a new texture mapping. But if you have one calculated in another program you could load it from another mesh stored for example in the .ply format.

Best regards
Andreas

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-faces+unsubscribe@googlegroups.com.
To post to this group, send email to scalismo-faces@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Rishubh Parihar

unread,
Aug 24, 2018, 11:05:46 AM8/24/18
to Andreas Forster, scalismo-faces
Thank you! 

On Mon, Feb 5, 2018, 2:33 PM Andreas Forster <Andreas...@unibas.ch> wrote:
Dear Rishubh,

Great that it worked for you with fitting an image.

Could you please start a new thread in the future if your question is not related to the old thread you already started. Otherwise the questions/answers are not easy to find for others and our effort for helping is increased a lot. Thx in advance.

For your question, please have a look at the probabilistic fitting tutorial chapter 4, 2nd part "Meshes": http://gravis.dmi.unibas.ch/PMM/lectures/fitting/
What you are looking for are the MeshSurfaceProperties. Here a small code snippet that might help you creating your textured mesh:
val mesh: TriangleMesh[_3D] = ???

val textureImage: PixelImage[RGBA] = ???
val vertexPositionsInTextureImage: IndexedSeq[Point[_2D]] = ???
val textureMapping: MeshSurfaceProperty[Point[_2D]] = SurfacePointProperty[Point[_2D]](mesh.triangulation,vertexPositionsInTextureImage)
val texture: TextureMappedProperty[RGBA] = TextureMappedProperty(mesh.triangulation,textureMapping,textureImage)

val texturedMesh = ColorNormalMesh3D(mesh,texture,mesh.vertexNormals)
I think there is no direct support to calculate a new texture mapping. But if you have one calculated in another program you could load it from another mesh stored for example in the .ply format.

Best regards
Andreas
On Sat, Feb 3, 2018 at 6:10 PM, Rishubh Parihar <parihar...@gmail.com> wrote:
Hi Andreas and Bernhard,

I am now able to fit 3D model to image in my stand alone application. Thanks a lot for valuable time. One last thing, I want to apply original 2D image texture to the generated 3D model. Is there any way to do it using scalismo as in the GUI the correspondence is already made  and also is it possible to store those correspondence somehow for texture mapping ?

Thanks,
Rishubh

--
You received this message because you are subscribed to the Google Groups "scalismo-faces" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scalismo-face...@googlegroups.com.
To post to this group, send email to scalism...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages