1f121dd3eb
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
2.6 KiB
2.6 KiB
layout | title | parent | nav_order |
---|---|---|---|
default | Object Classification | Solutions | TODO |
MediaPipe Object Classification
{: .no_toc }
- TOC {:toc}
Example Apps
Note: To visualize a graph, copy the graph and paste it into MediaPipe Visualizer. For more information on how to visualize its associated subgraphs, please see visualizer documentation.
Desktop
Live Camera Input
Please first see general instructions for desktop on how to build MediaPipe examples.
- Graph:
mediapipe/graphs/object_classification/object_classification_desktop_live.pbtxt
- Target:
mediapipe/examples/desktop/object_classification:object_classification_pytorch_cpu
Video File Input
-
With a PyTorch Model
This uses a MobileNetv2 trace model from PyTorch Hub. To fetch and prepare it, run:
python mediapipe/models/trace_mobilenetv2.py
The pipeline is implemented in this graph.
To build the application, run:
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/object_classification:object_classification_pytorch_cpu
To run the application, replace
<input video path>
and<output video path>
in the command below with your own paths:Tip: You can find a test video available in
mediapipe/examples/desktop/object_detection
.GLOG_logtostderr=1 bazel-bin/mediapipe/examples/desktop/object_classification/object_classification_pytorch_cpu \ --calculator_graph_config_file=mediapipe/graphs/object_classification/object_classification_desktop_live.pbtxt \ --input_side_packets=input_video_path=<input video path>,output_video_path=<output video path>