Project import generated by Copybara.
GitOrigin-RevId: 72933af9ce469acd89cbf41898dcc06c65df7c8a
This commit is contained in:
		
							parent
							
								
									a2823541e6
								
							
						
					
					
						commit
						bf5185f122
					
				| 
						 | 
					@ -24,13 +24,11 @@ bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/a
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/autoflip/run_autoflip \
 | 
					GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/autoflip/run_autoflip \
 | 
				
			||||||
  --calculator_graph_config_file=mediapipe/examples/desktop/autoflip/autoflip_graph.pbtxt \
 | 
					  --calculator_graph_config_file=mediapipe/examples/desktop/autoflip/autoflip_graph.pbtxt \
 | 
				
			||||||
  --input_side_packets=input_video_path=/absolute/path/to/the/local/video/file,\
 | 
					  --input_side_packets=input_video_path=/absolute/path/to/the/local/video/file,output_video_path=/absolute/path/to/save/the/output/video/file,aspect_ratio=1:1
 | 
				
			||||||
    output_video_path=/absolute/path/to/save/the/output/video/file,\
 | 
					 | 
				
			||||||
    aspect_ratio=9:16
 | 
					 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Use the `aspect_ratio` flag to provide the output aspect ratio. The format
 | 
					Use the `aspect_ratio` flag to provide the output aspect ratio. The format
 | 
				
			||||||
should be `weight:height`, where the `weight` and `height` are two positive
 | 
					should be `width:height`, where the `width` and `height` are two positive
 | 
				
			||||||
integers. AutoFlip supports both landscape-to-portrait and portrait-to-landscape
 | 
					integers. AutoFlip supports both landscape-to-portrait and portrait-to-landscape
 | 
				
			||||||
conversions. The pipeline internally compares the target aspect ratio against
 | 
					conversions. The pipeline internally compares the target aspect ratio against
 | 
				
			||||||
the original one, and determines the correct conversion automatically.
 | 
					the original one, and determines the correct conversion automatically.
 | 
				
			||||||
| 
						 | 
					@ -278,7 +276,7 @@ the required features cannot be all covered (for example, when they are too
 | 
				
			||||||
spread out in the video), AutoFlip will apply a padding effect to cover as much
 | 
					spread out in the video), AutoFlip will apply a padding effect to cover as much
 | 
				
			||||||
salient content as possible. See an illustration below.
 | 
					salient content as possible. See an illustration below.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{width="600"}
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Stable vs Tracking Camera Motion
 | 
					### Stable vs Tracking Camera Motion
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -17,9 +17,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/autoflip/run_autoflip \
 | 
					    GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/autoflip/run_autoflip \
 | 
				
			||||||
      --calculator_graph_config_file=mediapipe/examples/desktop/autoflip/autoflip_graph.pbtxt \
 | 
					      --calculator_graph_config_file=mediapipe/examples/desktop/autoflip/autoflip_graph.pbtxt \
 | 
				
			||||||
      --input_side_packets=input_video_path=/absolute/path/to/the/local/video/file,\
 | 
					      --input_side_packets=input_video_path=/absolute/path/to/the/local/video/file,output_video_path=/absolute/path/to/save/the/output/video/file,aspect_ratio=width:height
 | 
				
			||||||
        output_video_path=/absolute/path/to/save/the/output/video/file,\
 | 
					 | 
				
			||||||
        aspect_ratio=width:height
 | 
					 | 
				
			||||||
    ```
 | 
					    ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
3.  View the cropped video.
 | 
					3.  View the cropped video.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -217,6 +217,18 @@ float TimestampsToRate(int64 first_timestamp, int64 second_timestamp) {
 | 
				
			||||||
            sequence);
 | 
					            sequence);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    if (GetPointSize(prefix, *sequence) > 0) {
 | 
				
			||||||
 | 
					      std::string x_key = merge_prefix(prefix, kRegionPointXKey);
 | 
				
			||||||
 | 
					      auto* region_feature_list = MutableFeatureList(x_key, sequence);
 | 
				
			||||||
 | 
					      RET_CHECK_EQ(num_bboxes, region_feature_list->feature_size())
 | 
				
			||||||
 | 
					          << "Expected number of BBox timestamps and boxes to match.";
 | 
				
			||||||
 | 
					      ClearBBoxNumRegions(prefix, sequence);
 | 
				
			||||||
 | 
					      for (int i = 0; i < num_bboxes; ++i) {
 | 
				
			||||||
 | 
					        AddBBoxNumRegions(
 | 
				
			||||||
 | 
					            prefix, region_feature_list->feature(i).float_list().value_size(),
 | 
				
			||||||
 | 
					            sequence);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
    // Collect which timestamps currently match to which indices in timestamps.
 | 
					    // Collect which timestamps currently match to which indices in timestamps.
 | 
				
			||||||
    // skip empty timestamps.
 | 
					    // skip empty timestamps.
 | 
				
			||||||
    // Requires sorted indices.
 | 
					    // Requires sorted indices.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user