{"id":21476621,"url":"https://github.com/kazuhito00/mediapipe-python-sample","last_synced_at":"2025-10-11T10:03:11.664Z","repository":{"id":43780401,"uuid":"319650888","full_name":"Kazuhito00/mediapipe-python-sample","owner":"Kazuhito00","description":"MediaPipeのPythonパッケージのサンプルです。2024/9/1時点でPython実装のある15機能について用意しています。","archived":false,"fork":false,"pushed_at":"2024-09-02T11:30:47.000Z","size":6501,"stargazers_count":322,"open_issues_count":0,"forks_count":91,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-29T08:34:51.707Z","etag":null,"topics":["face-detection","face-mesh","facemesh","hands","holistic","mediapipe","mediapipe-python-sample","opencv","pose","python","selfie-segmentation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kazuhito00.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-08T13:43:05.000Z","updated_at":"2025-09-18T02:57:12.000Z","dependencies_parsed_at":"2025-02-15T06:14:53.861Z","dependency_job_id":"c3ad85bf-b53e-467b-9eeb-0323b0c37034","html_url":"https://github.com/Kazuhito00/mediapipe-python-sample","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/Kazuhito00/mediapipe-python-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazuhito00%2Fmediapipe-python-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazuhito00%2Fmediapipe-python-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazuhito00%2Fmediapipe-python-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazuhito00%2Fmediapipe-python-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kazuhito00","download_url":"https://codeload.github.com/Kazuhito00/mediapipe-python-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kazuhito00%2Fmediapipe-python-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006809,"owners_count":26084204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["face-detection","face-mesh","facemesh","hands","holistic","mediapipe","mediapipe-python-sample","opencv","pose","python","selfie-segmentation"],"created_at":"2024-11-23T11:09:38.032Z","updated_at":"2025-10-11T10:03:11.630Z","avatar_url":"https://github.com/Kazuhito00.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]\n\u003e MediaPipe レガシーソリューションのサポートは、2023年3月1日で終了しています。\u003cbr\u003e\n\u003e 従来のソリューションのサンプルは [_legacy](_legacy)ディレクトリに移動しました。\u003cbr\u003e\n\u003e MediaPipeは後方互換を保っており、現パッケージでもレガシーソリューションのサンプルを実行出来ます。\u003cbr\u003e\n\n# mediapipe-python-sample\n[google-ai-edge/mediapipe](https://github.com/google-ai-edge/mediapipe)のPythonパッケージのサンプルスクリプト集です。\u003cbr\u003e\n2024/9/1時点でPython実装のある以下15機能について用意しています。\n* [物体検出（Object Detection）](https://ai.google.dev/edge/mediapipe/solutions/vision/object_detector?hl=ja)\n* [画像分類（Image Classification）](https://ai.google.dev/mediapipe/solutions/vision/image_classifier?hl=ja)\n* [画像セグメンテーション（Image Segmentation）](https://ai.google.dev/mediapipe/solutions/vision/image_segmenter?hl=ja)\n* [インタラクティブ セグメンテーション（Interactive segmentation）](https://ai.google.dev/mediapipe/solutions/vision/interactive_segmenter?hl=ja)\n* [手検出（Hand Landmark detection）](https://ai.google.dev/mediapipe/solutions/vision/hand_landmarker?hl=ja)\n* [手のジェスチャー認識（Gesture Recognition）](https://ai.google.dev/mediapipe/solutions/vision/gesture_recognizer?hl=ja)\n* [画像の埋め込み表現（Image Embedding）](https://ai.google.dev/mediapipe/solutions/vision/image_embedder?hl=ja)\n* [顔検出（Face Detection）](https://ai.google.dev/mediapipe/solutions/vision/face_detector?hl=ja)\n* [顔のランドマーク検出（Face Landmark Detection）](https://ai.google.dev/mediapipe/solutions/vision/face_landmarker?hl=ja)\n* [顔のスタイル変換（Face Stylization）](https://ai.google.dev/mediapipe/solutions/vision/face_stylizer?hl=ja)\n* [姿勢推定（Pose Landmark Detection）](https://ai.google.dev/mediapipe/solutions/vision/pose_landmarker?hl=ja)\n* [テキスト分類（Text Classification）](https://ai.google.dev/mediapipe/solutions/text/text_classifier?hl=ja)\n* [テキストの埋め込み表現（Text Embedding）](https://ai.google.dev/mediapipe/solutions/text/text_embedder?hl=ja)\n* [テキスト言語分類（Language Detector）](https://ai.google.dev/mediapipe/solutions/text/language_detector?hl=ja)\n* [音分類（Audio Classification）](https://ai.google.dev/mediapipe/solutions/audio/audio_classifier?hl=ja)\n\n# Requirement \n* mediapipe 0.10.14 or later\n* opencv-python 4.10.0.84 or later\n* tqdm 4.66.5 or later　※重みファイルダウンロードに使用\n* requests 2.32.3 or later　※重みファイルダウンロードに使用\n* scipy 1.14.1 or later　※音分類（Audio Classification）サンプルを実行する場合のみ\n* numpy 1.26.4　※NumPyは1.x系\n\n```\npip install -r requirements.txt\n```\n\n# Demo\nデモの実行方法は以下です。\n\n### 物体検出（Object Detection）\n```bash\npython sample_object_detection.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --model\u003cbr\u003e\n使用モデル[0, 1, 2, 3, 4, 5, 6, 7]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\n[COCOデータセット](https://cocodataset.org/#home)でトレーニングされた重みで、サポートされているラベルは[labelmap.txt](https://storage.googleapis.com/mediapipe-tasks/object_detector/labelmap.txt)\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:EfficientDet-Lite0(int8)\n  * 1:EfficientDet-Lite0(float 16)\n  * 2:EfficientDet-Lite0(float 32)\n  * 3:EfficientDet-Lite2(int8)\n  * 4:EfficientDet-Lite2(float 16)\n  * 5:EfficientDet-Lite2float 32）\n  * 6:SSDMobileNet-V2(int8)\n  * 7:SSDMobileNet-V2(float 32)\n* --score_threshold\u003cbr\u003e\nスコア閾値\u003cbr\u003e\nデフォルト：0.5\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/049776c6-bf7c-47df-982b-8d2e21e1f322\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 画像分類（Image Classification）\n```bash\npython sample_image_classification.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --model\u003cbr\u003e\n使用モデル[0, 1, 2, 3]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\n[ImageNet](https://www.image-net.org/)でトレーニングされた重みで、サポートされているラベルは[labels.txt](https://storage.googleapis.com/mediapipe-tasks/image_classifier/labels.txt)\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:EfficientNet-Lite0(int8)\n  * 1:EfficientNet-Lite0(float 32)\n  * 2:EfficientNet-Lite2(int8)\n  * 3:EfficientNet-Lite2(float 32)\n* --max_results\u003cbr\u003e\n結果出力数\u003cbr\u003e\nデフォルト：5\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/78b2c7ef-83b9-47e3-9849-70d16bd7f241\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 画像セグメンテーション（Image Segmentation）\n```bash\npython sample_image_segmentation.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --model\u003cbr\u003e\n使用モデル[0, 1, 2, 3, 4]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:SelfieSegmenter(square)\n  * 1:SelfieSegmenter(landscape)\n  * 2:HairSegmenter\n  * 3:SelfieMulticlass(256x256)\n  * 4:DeepLab-V3\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/2033ba3b-3a66-437e-99d8-61fb38984b0b\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/93881e8c-cb19-4e14-b2f5-38bc061e481f\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/572f94d4-cbbc-4813-a408-f23f25abc1f9\" loading=\"lazy\" width=\"250px\"\u003e\n\n\n### インタラクティブ セグメンテーション（Interactive segmentation）\n```bash\npython sample_interactive_image_segmentation.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --image\u003cbr\u003e\n画像パスの指定\u003cbr\u003e\nデフォルト：asset/hedgehog01.jpg\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:MagicTouch\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/04f987b2-67e0-49f1-ad78-c5086d1bb6d4\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 手検出（Hand Landmark detection）\n```bash\npython sample_hand_landmarks_detection.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --unuse_mirror\u003cbr\u003e\nミラー表示不使用\u003cbr\u003e\nデフォルト：指定なし\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:HandLandmarker (full)\n* --num_hands\u003cbr\u003e\n検出数\u003cbr\u003e\nデフォルト：2\n* --use_world_landmark\u003cbr\u003e\nワールド座標表示\u003cbr\u003e\nデフォルト：指定なし\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/0bc2d091-6eae-4029-9a4c-44ea151980fb\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/9946c203-93e9-4fac-9979-e1a752f67dc4\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 手のジェスチャー認識（Gesture Recognition）\n```bash\npython sample_hand_gesture_recognition.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --unuse_mirror\u003cbr\u003e\nミラー表示不使用\u003cbr\u003e\nデフォルト：指定なし\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\n認識ジェスチャーは「Closed fist」「Open palm」「Pointing up」「Thumbs down」「Thumbs up」「Victory」「Love」「Unknown」\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:HandGestureClassifier\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/844dd2cf-3bf7-4803-8782-8fc2eb9bc3dc\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 画像の埋め込み表現（Image Embedding）\n```bash\npython sample_image_embedding.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --image01\u003cbr\u003e\n画像パス1の指定\u003cbr\u003e\nデフォルト：asset/hedgehog01.jpg\n* --image02\u003cbr\u003e\n画像パス2の指定\u003cbr\u003e\nデフォルト：asset/hedgehog02.jpg\n* --model\u003cbr\u003e\n使用モデル[0, 1]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:MobileNet-V3 (small)\n  * 1:MobileNet-V3 (large)\n* --unuse_l2_normalize\u003cbr\u003e\n特徴ベクトルを L2 ノルムで正規化しない\u003cbr\u003e\nデフォルト：指定なし\n* --unuse_quantize\u003cbr\u003e\n特徴ベクトルを スカラー量子化によってバイトに量子化しない\u003cbr\u003e\nデフォルト：指定なし\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/58fea0f1-83fa-448c-a36e-e9c760669a61\" loading=\"lazy\" width=\"500px\"\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/d1d0718c-4bf7-4151-ab51-bdb4806a264e\" loading=\"lazy\" width=\"500px\"\u003e\u003cbr\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/c1e5a632-2000-4949-9914-feeafac2ae17\" loading=\"lazy\" width=\"500px\"\u003e\u003cbr\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/7e1e788b-dd01-4521-bb54-fbddd2b698e3\" loading=\"lazy\" width=\"500px\"\u003e\n\n### 顔検出（Face Detection）\n```bash\npython sample_face_landmark_detection.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:BlazeFace (short-range)\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/10b79e31-7d0e-4d1e-9552-34b6ea9aa419\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 顔のランドマーク検出（Face Landmark Detection）\n```bash\npython sample_face_landmark_detection.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:FaceLandscapeer\n* --num_faces\u003cbr\u003e\n検出数\u003cbr\u003e\nデフォルト：1\n* --unuse_output_face_blendshapes\u003cbr\u003e\n顔のブレンドシェイプを出力しない\u003cbr\u003e\nデフォルト：指定なし\n* --unuse_output_facial_transformation_matrixes\u003cbr\u003e\n顔変換行列を出力しない\u003cbr\u003e\nデフォルト：指定なし\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/e204f9f2-2284-4f5e-b26d-b846fc01e529\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 顔のスタイル変換（Face Stylization）\n```bash\npython sample_face_stylization.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --model\u003cbr\u003e\n使用モデル[0, 1, 2]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:Color sketch\n  * 1:Color ink\n  * 2:Oil painting\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/de975b72-7dab-4fe6-800e-99d68a42e939\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/3d224686-948a-48c2-bacb-52aa8285719e\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/9483b711-5c1c-40ca-8ae4-6e8f6beabb74\" loading=\"lazy\" width=\"250px\"\u003e\n\n### 姿勢推定（Pose Landmark Detection）\n```bash\npython sample_pose_landmark_detection.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --device\u003cbr\u003e\nカメラデバイス番号の指定\u003cbr\u003e\nデフォルト：0\n* --video\u003cbr\u003e\n動画パスの指定 ※指定時はカメラより優先\u003cbr\u003e\nデフォルト：None\n* --width\u003cbr\u003e\nカメラキャプチャ時の横幅\u003cbr\u003e\nデフォルト：960\n* --height\u003cbr\u003e\nカメラキャプチャ時の縦幅\u003cbr\u003e\nデフォルト：540\n* --unuse_mirror\u003cbr\u003e\nミラー表示不使用\u003cbr\u003e\nデフォルト：指定なし\n* --model\u003cbr\u003e\n使用モデル[0, 1, 2]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:Pose landmarker(lite)\n  * 1:Pose landmarker(Full)\n  * 2:Pose landmarker(Heavy)\n* --use_output_segmentation_masks\u003cbr\u003e\nセグメンテーションを実施\u003cbr\u003e\nデフォルト：指定なし\n* --use_world_landmark\u003cbr\u003e\nワールド座標表示を実施\u003cbr\u003e\nデフォルト：指定なし\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/54b752b9-8374-41d5-bd48-4cf76f803f18\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/9325e6e5-52df-4e8a-9e13-8c6d00d7ae37\" loading=\"lazy\" width=\"250px\"\u003e \u003cimg src=\"https://github.com/user-attachments/assets/ec001fa0-3042-4fb6-a653-633403e93691\" loading=\"lazy\" width=\"250px\"\u003e \n\n### テキスト分類（Text Classification）\n```bash\npython sample_text_classification.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --input_text\u003cbr\u003e\n入力テキスト\u003cbr\u003e\nデフォルト：I'm looking forward to what will come next.\n* --model\u003cbr\u003e\n使用モデル[0, 1]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:BERT-classifier\n  * 1:Average word embedding\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/d40b6a51-b50a-4d5b-879f-0c5bfc1e62e5\" loading=\"lazy\" width=\"500px\"\u003e\n\n### テキストの埋め込み表現（Text Embedding）\n```bash\npython sample_text_embedding.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --input_text01\u003cbr\u003e\n入力テキスト1\u003cbr\u003e\nデフォルト：I'm feeling so good\n* --input_text02\u003cbr\u003e\n入力テキスト2\u003cbr\u003e\nデフォルト：I'm okay I guess\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:Universal Sentence Encoder\n* --unuse_l2_normalize\u003cbr\u003e\n特徴ベクトルを L2 ノルムで正規化しない\u003cbr\u003e\nデフォルト：指定なし\n* --use_quantize\u003cbr\u003e\n特徴ベクトルを スカラー量子化によってバイトに量子化する\u003cbr\u003e\nデフォルト：指定なし\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/6c82d941-98f3-4d91-8b9d-d2d7439de47e\" loading=\"lazy\" width=\"500px\"\u003e\n\n### テキスト言語分類（Language Detector）\n```bash\npython sample_text_language_detection.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --input_text\u003cbr\u003e\n入力テキスト\u003cbr\u003e\nデフォルト：分久必合合久必分\n* --model\u003cbr\u003e\n使用モデル[0, 1]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:Language Detector\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/537e341e-9534-4b4b-9204-d7c0ac31af21\" loading=\"lazy\" width=\"500px\"\u003e\n\n### 音分類（Audio Classification）\n```bash\npython sample_audio_classification.py\n```\n\u003cdetails\u003e\n\u003csummary\u003eコマンドライン引数オプション\u003c/summary\u003e\n \n* --input_audio\u003cbr\u003e\n入力音声ファイルのパス\u003cbr\u003e\nデフォルト：asset/hyakuninisshu_02.wav\n* --model\u003cbr\u003e\n使用モデル[0]　※対象モデルの重みがmodelディレクトリ内に無い場合ダウンロードを実行\u003cbr\u003e\nデフォルト：0\u003cbr\u003e\n  * 0:YamNet\n* --max_results\u003cbr\u003e\n結果出力数\u003cbr\u003e\nデフォルト：5\n\u003c/details\u003e\n\u003cimg src=\"https://github.com/user-attachments/assets/a0f42d85-15e5-490f-b305-c99d063251af\" loading=\"lazy\" width=\"500px\"\u003e\n\n# Reference\n* [google-ai-edge/mediapipe](https://github.com/google-ai-edge/mediapipe)\n\n# Author\n高橋かずひと(https://twitter.com/KzhtTkhs)\n \n# License \nmediapipe-python-sample is under [Apache-2.0 License](LICENSE).\n\n# License(Image, Video, Audio)\nサンプル実行用に格納している画像などは以下を利用しています。\n* [ぱくたそ](https://www.pakutaso.com)様：[トゲトゲのサボテンとハリネズミ](https://www.pakutaso.com/20190257050post-19488.html)\n* [ぱくたそ](https://www.pakutaso.com)様：[人間の靴にはまり込むハリネズ](https://www.pakutaso.com/20171041289post-13677.html)\n* [ぱくたそ](https://www.pakutaso.com)様：[靴にすっぽり隠れるハリネズミ](https://www.pakutaso.com/20171039289post-13676.html)\n* [NHKクリエイティブ・ライブラリー](https://www.nhk.or.jp/archives/creative/)様：「[猫カフェのネコ（３）](https://www2.nhk.or.jp/archives/movies/?id=D0002161325_00000)」\n* [NHKクリエイティブ・ライブラリー](https://www.nhk.or.jp/archives/creative/)様：「[寅さんの像　アップ](https://www2.nhk.or.jp/archives/movies/?id=D0002022189_00000)」\n* [NHKクリエイティブ・ライブラリー](https://www.nhk.or.jp/archives/creative/)様：「[音声 　百人一首　二](https://www2.nhk.or.jp/archives/movies/?id=D0002110102_00000)」\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazuhito00%2Fmediapipe-python-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkazuhito00%2Fmediapipe-python-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkazuhito00%2Fmediapipe-python-sample/lists"}