How does faceeffect decide where to attach the 3dmesh? e.g attach the axis to the nose - mediapipe

Looking into below Mediapipe's faceeefect module's graph definition
node_options: {
[type.googleapis.com/mediapipe.SwitchContainerOptions] {
contained_node: {
calculator: "FaceGeometryEffectRendererCalculator"
node_options: {
[type.googleapis.com/mediapipe.FaceGeometryEffectRendererCalculatorOptions] {
effect_texture_path: "mediapipe/graphs/face_effect/data/axis.pngblob"
effect_mesh_3d_path: "mediapipe/graphs/face_effect/data/axis.binarypb"
}
}
}
I further checked the calculator code of FaceGeometryEffectRendererCalculator, I couldn't pinpoint the code where it determines the exact location the renderer render the axis. Maybe I don't understand the OpenGL well which leads to the misunderstanding.
Can someone help shed some lights where should I look for?
Thanks!

By digging into the document and paper I get to understand that the estimated face geometry is aligned with the canonical face model. You can refer the pager https://arxiv.org/pdf/1907.06724.pdf and the explanation here

Related

ShieldUI Grid Export to PDF options

I am working with the ShieldUI Grid control and have setup a pretty standard sample, similar to this sample.
As demonstrated in it, I have setup the datasource and standard options, however I would like to change the paper size and possibly orientation, since the layout is somewhat bulky. Any pointers in the right direction would be helpful.
Paper size and orientation can be changed using the
exportOptions.pdf.size and exportOptions.pdf.orientation properties.
For example:
exportOptions: {
pdf: {
size: "a4",
orientation: "portrait",
...
}
}
More information can be found in this documentation page.

ExpandableListView in iOS

I am trying to get my brain around what I can and can't reasonably do UI-wise in a multi-platform app. Initially we are only concerned about iOS and Android, but may need a mobile Windows version eventually.
The specific question is: How do I replicate the Android ExpandableListView functionality in iOS? I've tried a few searches, but haven't found a hint. The key I need is collapsible sections. Is that doable with an iOS listview? If so, do you have/know of an example?
The related non-specific question is: What advice do you have for someone just starting out developing in multimobilemono? I've been working from Greg Shackles' excellent book, "Mobile Development in C#" (which has been wildly helpful!), so I've got some basics. But I'm sure there are some hidden landmines when you get into more complex UI design. Any advice would be greatly appreciated.
Thank you!
You can use the UITableView, and merely change the size of your cell to display more content as needed.
Let us discuss DialogViewController (part of MonoTouch.Dialog) which simplifies the setup of a UITableView.
What you could do is create a UIView that contains both the content, and the expanded content. It would be controller with some property, for example:
bool expanded;
public bool Expanded { get { return expanded; }}
set {
if (expanded == value)
return;
Frame = ComputeSize (value);
expanded = value;
}
}
Then, create a UIViewElement:
new RootElement ("My Root") {
new Section () {
new UIViewElement (new MyView ());
}
}
For your first question, perhaps you could try :
https://github.com/OliverLetterer/SLExpandableTableView

How do I get graphviz to generate fixed sized subgraphs?

I've been struggling with this for a while and cannot seem to find a straight answer. I'm working with compound subgraphs in graphviz and cannot seem to find the right combination of settings to force two subgraphs to align with each other.
Enclosed is a simple example to show the problem...
digraph g {
compound=true;
subgraph cluster_top {
graph [color=black, label="Top", rank=min];
nodeA; nodeB; nodeC
cluster_top_DUMMY [shape=point style=invis]
}
subgraph cluster_service {
graph [color=black, label="Bottom", rank=min];
node1; node2; node3; node4; node5; extra_long_node
cluster_bottom_DUMMY [shape=point style=invis]
}
cluster_top_DUMMY -> cluster_bottom_DUMMY [ style=invis ]
}
This generates output with the Bottom subgraph significantly wider than the Top subgraph.
What I really want is for to ensure that both Top and Bottom are always exactly the same width. In addition, if there are too many nodes to fit into the available width, it would generate additional rows of nodes.
A possible (bad but working) solution would be to use invisible nodes and set width.
Consider the following:
digraph g {
compound=true;
subgraph cluster_top {
graph [color=black, label="Top", rank=min];
nodeAI0 [style=invisible]
nodeAI1 [style=invisible]
nodeAI2 [style=invisible,fixedsize=true,width=1.65]
nodeA; nodeB; nodeC
cluster_top_DUMMY [shape=point style=invis]
}
subgraph cluster_service {
graph [color=black, label="Bottom", rank=min];
node1; node2; node3; node4; node5; extra_long_node
cluster_bottom_DUMMY [shape=point style=invis]
}
cluster_top_DUMMY -> cluster_bottom_DUMMY [ style=invis ]
}
The invisible nodes (NodeAI0-NodeAI2) take the space. fixedsize=true,width=1.65 makes the last one take exactly 1.65 inches.
Another, better solution would be to also set the relevant longer node specifically (to avoid having to look for the correct value) by adding something like:
node [fixedsize=true,width=0.75]
after the compound=true portion.

Tapku Coverflow: Programmatically change image

i'm trying to implement a button to increment the album art using Tapku Library and not having much luck.
I was considering replicating a touch using 'touchesBegan' but this is a bit hacky and would rather a cleaner approach.
My code to increment the image, which does not update the image is as follows:
(IBAction)nextImage:(id)sender {
if(imageSelected++ < kNumberOfImages){
coverView.image = [imagesArray objectAtIndex:imageSelected];
[self coverflowView:coverFlow coverAtIndexWasBroughtToFront:imageSelected];
}else{
imageSelected--;
}
}
Can anyone tell me where i might be going wrong? Thanks

GraphKit framework in Cocoa

I try to draw an XY graph using GraphKit.
Information of this framework is very limited on the internet...
Here's what I did:
// a xychart is predefined in header as GRChart
GRDateSet *dataset = [[GRXYDataSet alloc] initWithOwnerChart:xychart];
[xychart addDataSet:dataSet loadData:YES];
[xychart reloaddata];
also I implement delegate methods:
(double)chart:(GRChartView *)aChart xValueForDataSet:(GFDataSet*)aDataSet element:(NSUInteger)index
{ return index * 10.0; }
(double)chart:(GRChartView *)aChart yValueForDataSet:(GFDataSet*)aDataSet element:(NSUInteger)index
{ return index * 10.0; }
(NSUInteger) chart:(GRChartView *)aChart numberOfElementsForDataSet:(GFDataSet*)aDataSet {
return 10;
}
however, it only draws the axes but no data points at all...
what did I miss here?
thanks!
I got it. This framework only stores data points and draws axes according to the data points. (It automatically calculates the bounds of each axes and zoom into a suitable plot area.)
However, no drawing method is rooted. To get an immediate graph, I have to use GRAreaDataSet, which is a subclass of GRXYDataSet. Then it will draw an area chart.
I also tried out core-plot. But it's more difficult to use to me. I have to calculate the bounds myself; and padding the graph to show the label values of axes. Also, it's not so beautiful if I don't customize the symbols and lines. However, the default GraphKit charting is nice-looking enough. Though it doesn't have a document...
I'll try to write a tutorial of it when I try out everything in it :)