メインコンテンツへスキップ
見出し画像

DGX Sparkで「客観動画→主観VR動画」を生成するEgoXを使う

    前回、興奮してとりあえずそれっぽいものを作らせるところまでClaude Codeにやらせて「なんかできそう」というところまでは言ったものの、なかなかフリーハンドでできるところまで行かなかったのが、本家から新しいコードがリリースされてちゃんとできるようになった。そしてコツも少しわかったのでご紹介させていただきたい。

    まず、RTX PRO 6000やDGX Spark、いわゆる「Blakcwell」世代で動かすには、Dockerを使うのが手っ取り早い。

    そこで今回はFlaskを使ったWebUIを用意した。

    画像
    ファイルを選択してプロンプトを入力

    問題は、この「プロンプト」である。
    公式のサンプルにはさらっと流されているが、実はこのプロンプトがEgoXの成否を決めるキモだったのだ。このプロンプトを得るためには、まずChatGPTなどのVLMを搭載したチャットを別途起動して、そこに変換したい動画の一コマ目の静止画を打ち込み、以下のようなプロンプトとともに推論させる。

    画像

    [Exo view]\n**Scene Overview:**\nThe scene is set on a street in front of a hospital, indicated by the large \"EMERGENCY\" sign visible in the background. The ground is asphalt, marked with yellow lines, and appears to have debris scattered across it, including small rocks and larger pieces of material. To the left, a gray sedan is parked, partially obscured by smoke. In the background, an ambulance is visible, and smoke billows from the building, suggesting a fire or explosion. The building itself has large glass windows and a beige exterior. A red fire hydrant is positioned on the right side of the frame, and the area is shrouded in a haze of smoke, reducing visibility.\n\n**Action Analysis:**\nThe sequence begins with a figure standing in the middle of the street, wearing a white uniform with red trim. The figure's hands are initially positioned in front of them, possibly holding an object that is not clearly visible. In the second frame, the figure raises a small metallic object, which appears to be a lighter or similar item, with the right hand while the left hand remains open and slightly raised. The third frame captures a moment of ignition, as flames erupt in the background, indicating an explosion or fire. The figure's hands are now in a more dynamic position, with the right hand holding the lighter and the left hand moving as if reacting to the sudden event. In the final frame, the figure turns away from the explosion, with the left arm extended outward and the right hand still gripping the lighter. The transition from a static pose to a reactionary movement illustrates a shift from calm to urgency, as the figure responds to the unfolding chaos.\n\n[Ego view]\n**Scene Overview:**\nFrom the inferred first-person perspective, the environment appears chaotic and filled with smoke. The \"EMERGENCY\" sign looms in the background, indicating proximity to a hospital. The ground is uneven with debris scattered around, and the asphalt is hot underfoot. The figure's uniform is white with red trim, and the hands are visible, one holding a small metallic lighter. The view is partially obscured by smoke, creating a sense of urgency and confusion.\n\n**Action Analysis:**\nInitially, the hands are positioned in front of the body, with the lighter held in the right hand. As the lighter is ignited, the flames from the explosion in the background become visible, creating a stark contrast against the smoke-filled scene. The left hand instinctively raises, possibly in a defensive gesture or to shield from the heat. As the explosion occurs, the body reacts by turning away, with the left arm extending outward, suggesting a need to escape the immediate danger. The grip on the lighter remains firm, indicating a focus on the object even amidst the chaos. The sequence captures a rapid transition from a moment of stillness to an urgent response to an explosive event.", こういう感じのプロンプトをこの写真を元に生成して欲しい。

    すると、以下のようなプロンプトが得られる。

    [Exo view]
    Scene Overview:
    
    The scene takes place inside a casual noodle restaurant with warm lighting and wooden interiors. Orange plastic seats and white tables fill the space, creating a compact and lively dining environment. In the background, other diners are seated closely together, partially out of focus, contributing to the sense of a busy lunchtime atmosphere. Condiment containers and utensils are placed on the tables, reinforcing the utilitarian, everyday nature of the setting.
    
    In the foreground, a diner sits at a table wearing a dark padded jacket and a light-colored disposable bib. A large bowl with an orange rim rests on the table, filled with noodles, vegetables, and pieces of meat immersed in a richly colored broth. Steam subtly rises from the bowl, indicating that the dish is hot and freshly served.
    
    Action Analysis:
    
    The sequence centers on the act of eating. The diner leans forward over the bowl, holding a pair of red chopsticks in the right hand. The chopsticks lift a small bundle of noodles, which are drawn toward the mouth. The head tilts downward, and the mouth opens slightly as the noodles are slurped in a continuous motion.
    
    The left hand steadies the bowl near its rim, preventing it from shifting during the movement. The posture suggests focus and immersion, with attention fully directed toward the act of eating. The motion is deliberate and practiced, indicating familiarity with the dish and comfort within the environment. The action conveys a moment of quiet concentration amid the surrounding bustle.
    
    [Ego view]
    Scene Overview:
    
    From a first-person perspective, the bowl of noodles dominates the field of view. The orange-rimmed edge frames the contents: pale noodles, green vegetables, and darker chunks of meat glistening with broth. Steam rises toward the face, slightly blurring the view and carrying the impression of heat.
    
    The table surface is close, and peripheral vision catches glimpses of nearby diners and seating, but these remain indistinct. The environment feels enclosed yet lively, with ambient movement and presence sensed rather than directly observed.
    
    Action Analysis:
    
    The right hand grips the chopsticks, lifting noodles from the bowl. As the noodles approach the mouth, heat and texture become the primary focus. The body naturally leans forward to shorten the distance, minimizing spills and maintaining control.
    
    The left hand holds the bowl steady, fingers curled around its edge. As the noodles are drawn in, attention narrows to the sensation of eating—the resistance of the noodles, the warmth of the broth, and the coordination between hands and mouth. External distractions fade, replaced by a brief, self-contained moment centered entirely on the act of consuming the meal.

    こうすると、ちゃんと麻辣湯を食べる吾輩の主観動画がワンタッチで得られるのである。

    画像
    マーラータンを食べる吾輩

    いざできるとかなり驚異を感じる。
    「できそうだ」と「できる」は決定的に違う。

    まつゆう*のシャンパン注ぎ動画もこんな感じでより主観視点っぽくなる

    画像
    君もまつゆう*になれる!

    AI凄すぎんか?
    なんか俺がいうのもナンだけど
    なんでこんなことできるんだ

    考察 プロンプトは何をしているか?

    このEgoXの効果は驚異的だが、プロンプトをちゃんと与えないと全く意味のない画像が生成されてしまったことがある。プロンプトはとても大切なのだが、実際にどんなプロンプトが生成されたのか日本語で振り返って考察してみよう。最初の麻辣湯をたべた時の動画は、こんなプロンプトで生成した。

    [Exo view]
    Scene Overview:

    シーンは、暖かい照明と木目調の内装が特徴的な、気取らないラーメン店の店内で展開される。オレンジ色のプラスチック製の椅子と白いテーブルが所狭しと並び、コンパクトで活気のある食事空間を形成している。背景には、他の客たちが近い距離で座っており、ややピントの外れた状態で映り込むことで、昼時の混雑した雰囲気が強調されている。各テーブルには調味料入れや箸、備品が置かれており、実用的で日常的な店の性格を感じさせる。

    前景には、一人の客がテーブルに座り、黒い中綿入りのジャケットと淡い色の使い捨てエプロンを身につけている。テーブルの上にはオレンジ色の縁取りがされた大きな丼が置かれ、中には麺、野菜、肉が濃い色合いのスープに浸されている。丼からはかすかに湯気が立ち上り、料理が出来立てで熱いことを示している。



    Action Analysis:

    このシークエンスは「食べる」という行為そのものに焦点を当てている。客は丼の上に身を乗り出すように前傾し、右手に赤い箸を持っている。箸で少量の麺を持ち上げ、そのまま口元へと引き寄せていく。頭部はやや下向きに傾き、口がわずかに開いて、麺を途切れなくすすり込む動作が続く。

    左手は丼の縁付近を押さえ、動作中に丼がずれないよう安定させている。その姿勢からは、周囲への意識が薄れ、食事そのものに集中している様子がうかがえる。動きは落ち着いており、慣れた手つきであることから、この料理や環境に親しんでいることが示唆される。店内の賑わいの中にありながら、静かな集中の一瞬が切り取られている。



    [Ego view]
    Scene Overview:

    一人称視点では、丼の存在が視界の大半を占めている。オレンジ色の縁がフレームとなり、中には淡い色の麺、緑の野菜、そして濃い色の肉がスープに艶やかに浮かんでいる。湯気が顔の方へと立ち上り、視界をわずかにぼかしながら、熱さを感じさせる。

    テーブルの天板はすぐ目の前にあり、周辺視野には近くに座る他の客や椅子の気配がかすかに映り込むが、いずれもはっきりとは認識されない。空間はやや窮屈でありながらも活気があり、周囲の動きや存在を「感じ取る」程度に留まっている。



    Action Analysis:

    右手で箸を握り、丼から麺を持ち上げる。麺が口元へ近づくにつれ、熱や質感への意識が強くなる。こぼさないよう、体は自然と前へ傾き、距離を縮める動きが生まれる。

    左手は丼の縁をしっかりと掴み、安定させている。麺をすすり込むにつれて、意識は食べるという感覚そのものへと収束していく。麺の抵抗感、スープの温かさ、そして両手と口の連携――それらに集中することで、外部の雑音や視覚情報は次第に薄れ、食事という行為だけに閉じた短い瞬間が形作られる。

    まず、これらのプロンプトは、[exo view]と[ego view]の二つのセクションから成り立っている。

    [exo view]が三人称視点、[ego view]が一人称視点だ。
    このプロンプトの時点で、「その空間がどんな空間で、誰が、どんなことをしているのか」ということが規定される。

    また、それぞれの視点から見たときのScene Overview、つまり場面の概要と、Action Analysis、つまり実際に行われている行動を分析している。

    続く[ego view]セクションも同様で、まず場面の概要と、次にアクションが説明される。

    これを人間に例えると、まず第三者視点からの映像を見せられて、その映像で何が起きてるか分析し、次にその映像の主観的な視点を変えた場合、どのような見え方になるかということを想像して言語化している段階だ。つまり、EgoXの成立には単なる数学的・空間的な推測や画像/動画生成そのもののではなく、LLM(VLM)による高度な推論結果が色濃く反映されている。ある意味で「これぞ真のマルチモーダル」と呼べるのではないかと思った。

    プロンプトの段階で客観と主観を入れ替えることができるというのは目から鱗だったので追記した。

     

    shi3z

     
     
    さすらいのプログラマー 知能と生命の研究者