A method, comprising, by a computing device : obtaining one or more first video frames associated with a scene ; generating , based on the one or more first video frames , first tracking data using a first tracking algorithm; generating a first confidence score associated with the first tracking data ; displaying an augmented-reality effect based on the first tracking data ; determining that the first confidence score is above a first threshold; obtaining one or more second video frames associated with the scene , the one or more second video frames being subsequent to the one or more first video frames ; generating , based on the one or more second video frames , second tracking data using the first tracking algorithm; generating a second confidence score associated with the second tracking data ; determining that the second confidence score is below a second threshold; obtaining one or more third video frames associated with the scene , the one or more third video frames being subsequent to the one or more second video frames ; generating , based on the one or more third video frames , third tracking data using a second tracking algorithm different from the first tracking algorithm, wherein the second tracking algorithm is selected in response to the determining that the second confidence score is below the second threshold; displaying the augmented-reality effect based on the third tracking data ; wherein the first tracking data , the second tracking data and the third tracking data are associated with a first object in the scene ; and wherein the first tracking algorithm is more computationally expensive than the second tracking algorithm, characterized in that the first tracking algorithm is a SLAM algorithm or facial-recognition algorithm, and the second tracking algorithm is a region tracking algorithm. obtaining one or more first video frames associated with a scene ; generating , based on the one or more first video frames , first tracking data using a first tracking algorithm; generating a first confidence score associated with the first tracking data ; displaying an augmented-reality effect based on the first tracking data ; determining that the first confidence score is above a first threshold; obtaining one or more second video frames associated with the scene , the one or more second video frames being subsequent to the one or more first video frames ; generating , based on the one or more second video frames , second tracking data using the first tracking algorithm; generating a second confidence score associated with the second tracking data ; determining that the second confidence score is below a second threshold; obtaining one or more third video frames associated with the scene , the one or more third video frames being subsequent to the one or more second video frames ; generating , based on the one or more third video frames , third tracking data using a second tracking algorithm different from the first tracking algorithm, wherein the second tracking algorithm is selected in response to the determining that the second confidence score is below the second threshold; displaying the augmented-reality effect based on the third tracking data ; wherein the first tracking data , the second tracking data and the third tracking data are associated with a first object in the scene ; and wherein the first tracking algorithm is more computationally expensive than the second tracking algorithm, characterized in that the first tracking algorithm is a SLAM algorithm or facial-recognition algorithm, and the second tracking algorithm is a region tracking algorithm. <EOS>