Closed andreas-schneider closed 6 years ago
In this implementation the coefficients are always of full rank of the model. In practice it is often desired to have only the first x parameters. The MoMo itself has already a sample function which gives the VertexColorMesh directly. Without the possibility to use less parameters I see no benefit...
@Andreas-Forster I have incorporated your suggestions.
@BernhardEgger
Just a side note: In PancakeDLRGP
you have a coefficientsDistribution
- this could be a possible concept to capture the distribution (including a sample()
method) of the coefficients for a model
@sschoenborn Thank you for pointing that out. I think this is maybe the best solution for this. I provided the implementation in addition to the former one.
@BernhardEgger I think it is a rare case where you want to have coefficients with a lot of different length in one application. So given this new solution, you would truncate the model first before sampling the coefficients. This makes also the generation of instances faster afterward.
@andreas-schneider It would now be possible to write:
val model: MoMo = ???
val modelURI: URI = ???
val renderer = MoMoRenderer(model)
val parameter = RenderParameter.defaultSquare.withMoMo(MoMoInstance.fromCoefficients(model.sampleCoefficients(),modelURI))
val randomRendering = renderer.renderImage(parameter)
What do you think about this solution?
(Please do not merge as we should clean one of the solutions before.)
Yes, the sampleCoefficients sounds good. I have updated it accordingly.
Currently, it is laborious to draw a random MoMoInstance random coefficient that can be used for example rendering a random model sample.
Functionality: Draws shape, color and expression vector entries N(0,1) distributed.
This is a possible use case of the proposed functionality: