
AIオーケストレーションを試す〜”【Apple Silicon】Gemma4 + Falcon Perception” と”【CUDA】Gemma4 + Sam3”の比較〜
AIオーケストレーション
最新のGoogle/DeepMindのLocal VLMモデルGemma4と画像AIモデルを組み合わせたAIオーケストレーションを試してみました。
色々なデータで試しましたが、精度はまだまだといった感じではあります。
こちらは、Gemma4とMetaのSAM3.1の組み合わせです。
We are in the era of local AI orchestration
— Google Gemma (@googlegemma) April 14, 2026
Gemma 4 evaluates a scene, reasons about what to ask, and calls a segmentation model to execute the vision tasks:
🚗 "Segment all vehicles." ➔ 64 found
🚙 "Now just the white ones." ➔ 23 found
All happening offline on a laptop. pic.twitter.com/xH9fFcvCKe
Gemma 4 が駐車場を見る。 何を尋ねるかを決める。 SAM 3.1 を呼び出す。 -「すべての車両をセグメント化せよ。」 64 個見つかりました。
-「今度は白いものだけ。」 23 個見つかりました。
一つのモデルが推論し、オーケストレーションする。 一つのモデルが実行する。 両方とも MacBook 上でローカルに動作。 MLX。クラウドなし。API なし。
こちらは、Gemma4とFalcon Perceptionとの組み合わせです。
I used Gemma4 + Falcon Perception from this mlx-vlm release to build a grounded reasoning agent runs fully local on M3
— Yasser Dahou (@dahou_yasser) April 4, 2026
the idea: VLMs are great at reasoning but not great at measuring. Falcon Perception is great at segmentation but cant reason. so you loop them: Gemma4 decides… https://t.co/Db62U60cdw pic.twitter.com/0pTEALG3Mr
VLMsは推論が得意ですが、測定はあまり得意ではありません。Falcon Perceptionはセグメンテーションが得意ですが、推論できません。なので、それらをループさせます
Gemma4が何を探すかを決め、FPがそれをセグメントしてピクセル単位の正確な座標を返し、Gemma4が数字に基づいて推論します
Gemma4-Visual-Agent
モデル概要
Gemma4とFalcon Perceptionの組み合わせ
Apple Siliconで動作します。
Gemma4とFalcon Perceptionモデルについてはこちら

準備
推奨環境はこんな感じ。
macOS with Apple Silicon (M1/M2/M3/M4)
Python 3.10+
16 GB+ RAM recommended
~7 GB disk for model weights (auto-downloaded)
私の実行環境は、M2 Max 96GB です。
仮想環境で試すのがいいです。
Github:https://github.com/PromtEngineer/Gemma4-Visual-Agent
ですので、まずは git clone します。
git clone https://github.com/PromtEngineer/Gemma4-Visual-Agent次に以下をインストールします。
# Install dependencies
pip install mlx-vlm gradio opencv-python-headless Pillow numpy pycocotools
pip install "falcon-perception[mlx] @ git+https://github.com/tiiuae/falcon-perception.git"
pip install fastapi uvicorn画像向けのアプリ立ち上げ
# Launch
python vision_studio.pyGradioのUIが立ち上がります。

実行
初期プロンプト
Are there more cars than people?
Segment 'cars'
Found 5 instance(s) of 'cars'

Segment 'people'
Found 6 instance(s) of 'people'

Compare counts
cars: 5 | people: 6 — More people (6) than cars (5)

Final answer
Found 6 people(s). More people (6) than cars (5)
全体の流れは以下の通り。
User: "Are there more cars than people?"
|
Plan Router
(pattern matching)
/ \
DETECT 'cars' DETECT 'people'
Falcon (0.6B) Falcon (0.6B)
5 found 6 found
\ /
COMPARE counts
cars: 5 | people: 6
|
ANSWER
"More people(6)than cars (5)"以下で動画もできます。
python video_tracker.py※参考

SAM3-Gemma4-CUDA
準備
私の実行環境
- NVIDIA GeForce 4060
- CUDA Version 12.7
Github: https://github.com/PRITHIVSAKTHIUR/SAM3-Gemma4-CUDA
git clone
git clone https://github.com/PRITHIVSAKTHIUR/SAM3-Gemma4-CUDA各種ライブラリインストール
pip install -r requirements.txtこの後、SAM3を使うので、huggingface (https://huggingface.co/facebook/sam3)のアカウント作成とアクセストークンの取得が必要です。
その後、以下でhuggingfaceにログインします。
HuggingFace HubのCLIをインストール
pip install -U "huggingface_hub[cli]"python起動しログイン
python
>>>from huggingface_hub import login
>>>login()ゲットしたアクセストークン(hf_xxxxxxxxxx)を以下にコピペ

実行
アプリ実行でGradioが立ち上がります。
python app.pyプロンプトは、セグメントする対象を指定します。
プロンプト
"people"

Gemma4の回答
1. **Object(s) Selected:** Four instances of "people" (pedestrians).
2. **Match to Prompt:** The selected regions clearly highlight individuals walking across the crosswalk and standing near the vehicles.
3. **Reliability:** The result seems reliable as the bounding boxes accurately capture the people present in the scene.
訳:
選択された物体: 「人(歩行者)」が4人選択されています。
プロンプトとの一致: 選択された領域は、横断歩道を歩いている人々や車の近くに立っている人々を明確に示しています。
信頼性: バウンディングボックスがシーン内の人物を正確に捉えているため、この結果は信頼できるように見えます。
人の数は4人と言っていますが、実際は6人ですね。