question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Objectron predicts low confidence and tracking jitter

See original GitHub issue

Plugin Version or Commit ID

v0.10.0

Unity Version

2021.3f1

Your Host OS

MacOS M1

Target Platform

iOS

Description

Hi, I’m try to create a shoes try-on app, but there are some problems:

  1. Low confidence
  2. tracking jitter
  3. Need to set FOCAL_LENGTH and PRINCIPAL_POINT

What do I need to do to get rid of these two problems?

As shown in the video effect.

https://user-images.githubusercontent.com/82647748/171526093-6fc1f1dc-6824-4889-8527-732d5b841d21.mp4

Thanks in advance.

Code to Reproduce the issue

var tmp_Rotation = CameraCoordinate.GetApproximateQuaternion(target);
sneaker.rotation = tmp_Rotation;
var tmp_Position = screen.rect.GetPoint(target.Keypoints[0].Point3D,
Application.isEditor ? Vector2.one : new Vector2(2.0975f, 1.5731f), Vector2.zero, 1, rotationAngle, isMirrored); 
sneaker.localPosition = tmp_Position;
sneaker.localScale = (target.Scale[0] + target.Scale[1] + target.Scale[2]) / 3 * Vector3.one * 90000 ;

Additional Context

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
Phantomxm2021commented, Jun 4, 2022

var tmp_Position = screen.rect.GetPoint(target.Keypoints[0].Point3D, Application.isEditor ? Vector2.one : new Vector2(2.0975f, 1.5731f), Vector2.zero, 1, rotationAngle, isMirrored); sneaker.localPosition = tmp_Position;

@Phantomxm2021 nice work to get it running I would like to know how did you get the screen.rect from please explain or share some code on how you got it and also please tell me how did you do your occlusion did you use a shader or something else.

Any kind of help will be highly appreciated thanks.

About Screen rect

The screen.rect is a gameobject of Annotatable Screen. And it’s a RectTransform component, we can using GameObject.Find("Annotatable Screen").GetComponent<RectTransform>(); to got it.

About Occlusion

We wrote a shader for it.

image
Shader "Custom/ObjectOcclusionShader"
{
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        Tags { "Queue" = "Geometry-1" }
        ZWrite On
        ZTest LEqual
        ColorMask 0

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
            
            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
            };

            struct v2f
            {
                float4 vertex : SV_POSITION;
            };

            v2f vert (appdata v)
            {
                v2f o;
                o.vertex = UnityObjectToClipPos(v.vertex);
                return o;
            }
            
            fixed4 frag (v2f i) : SV_Target
            {
                return fixed4(0.0, 0.0, 0.0, 0.0);
            }
            ENDCG
        }
    }
}

0reactions
burungiucommented, Feb 20, 2023

I have a problem, the capsule and sphere are black on the iPhone. Do you know how to solve it? I used the shader which you wrote in a early comment.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mediapipe/docs/solutions/objectron.md at master
It also retains object identity across frames and ensures that the prediction is temporally consistent, reducing the jitter. The Objectron 3D object detection ......
Read more >
Keypoint-Based Category-Level Object Pose Tracking from ...
Pose tracking encourages temporally consistent pose predictions, allowing past observations to inform current predictions.
Read more >
Deep Learning on Monocular Object Pose Detection and ...
Among methods for object pose detection and tracking, deep learning is the ... As a result, the mechanism for predicting a 3D confidence...
Read more >
Real-Time 3D Object Detection on Mobile Devices with ...
It also retains object identity across frames and ensures that the prediction is temporally consistent, reducing the jitter. For further ...
Read more >
Using Computer Vision and Machine Learning to control ...
Minimum confidence value ([0.0, 1.0]) from the landmark-tracking model for the pose landmarks to be considered tracked successfully, or ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found