@@ -50,28 +50,28 @@ function analyze_object_tracking_file($path, array $options = [])
5050 if ($ operation ->operationSucceeded ()) {
5151 $ results = $ operation ->getResult ()->getAnnotationResults ()[0 ];
5252 # Process video/segment level label annotations
53- $ objectAnnotation = $ results ->getObjectAnnotations ()[0 ];
53+ $ objectEntity = $ results ->getObjectAnnotations ()[0 ];
5454
55- printf ('Video object entity: %s ' . PHP_EOL , $ objectAnnotation ->getEntity ()->getEntityId ());
56- printf ('Video object description: %s ' . PHP_EOL , $ objectAnnotation ->getEntity ()->getDescription ());
55+ printf ('Video object entity: %s ' . PHP_EOL , $ objectEntity ->getEntity ()->getEntityId ());
56+ printf ('Video object description: %s ' . PHP_EOL , $ objectEntity ->getEntity ()->getDescription ());
5757
58- $ startTimeOffset = $ objectAnnotation ->getSegment ()->getStartTimeOffset ();
58+ $ startTimeOffset = $ objectEntity ->getSegment ()->getStartTimeOffset ();
5959 $ startSeconds = $ startTimeOffset ->getSeconds ();
6060 $ startNanoseconds = floatval ($ startTimeOffset ->getNanos ())/1000000000.00 ;
6161 $ startTime = $ startSeconds + $ startNanoseconds ;
62- $ endTimeOffset = $ objectAnnotation ->getSegment ()->getEndTimeOffset ();
62+ $ endTimeOffset = $ objectEntity ->getSegment ()->getEndTimeOffset ();
6363 $ endSeconds = $ endTimeOffset ->getSeconds ();
6464 $ endNanoseconds = floatval ($ endTimeOffset ->getNanos ())/1000000000.00 ;
6565 $ endTime = $ endSeconds + $ endNanoseconds ;
6666 printf (' Segment: %ss to %ss ' . PHP_EOL , $ startTime , $ endTime );
67- printf (' Confidence: %f ' . PHP_EOL , $ objectAnnotation ->getConfidence ());
67+ printf (' Confidence: %f ' . PHP_EOL , $ objectEntity ->getConfidence ());
6868
69- foreach ($ objectAnnotation ->getFrames () as $ objectAnnotationFrame ) {
70- $ startSeconds = $ objectAnnotationFrame ->getTimeOffset ()->getSeconds ();
71- $ startNanoseconds = $ objectAnnotationFrame ->getTimeOffset ()->getNanos ();
69+ foreach ($ objectEntity ->getFrames () as $ objectEntityFrame ) {
70+ $ startSeconds = $ objectEntityFrame ->getTimeOffset ()->getSeconds ();
71+ $ startNanoseconds = $ objectEntityFrame ->getTimeOffset ()->getNanos ();
7272 $ timeOffSet = $ startSeconds + $ startNanoseconds /1000000000.00 ;
7373 printf (' Time offset: %ss ' . PHP_EOL , $ timeOffSet );
74- $ boundingBox = $ objectAnnotationFrame ->getNormalizedBoundingBox ();
74+ $ boundingBox = $ objectEntityFrame ->getNormalizedBoundingBox ();
7575 printf (' Bounding box position: ' . PHP_EOL );
7676 printf (' Left: %s ' , $ boundingBox ->getLeft ());
7777 printf (' Top: %s ' , $ boundingBox ->getTop ());
0 commit comments