3DCG屋さんの活動記録

PROFILE ★★こんな人です

3DCGを活用した映像や没入体験コンテンツの制作をしています。テクノロジーの社会実装に興味があり。テクニカルディレクター。面白いこと新しいことにワクワクする気持ちに『素直』でいつづける。

ラベル AI の投稿を表示しています。 すべての投稿を表示
ラベル AI の投稿を表示しています。 すべての投稿を表示

2026年1月21日水曜日

【Gemini】ローカル音源を波形で見たい!「Adobe Stock風」に閲覧するアプリを1時間で作った話


映像制作をしていると、BGMやSE(効果音)の選定で無限に時間が溶けていく。
Webのアセットサイト(Adobe Stockとか)は波形が見えてて最高に使いやすいのに、ローカルに落とした瞬間、FinderやExplorerでスペースキーを連打する苦行が始まる。。。



「ローカルでも、あの波形UIでサクサク探したい」



探しても丁度いいのがなかったので、Geminiとペアプロして自作した。
結論から言うと、ベースは5分、実用レベルへのブラッシュアップ含めても1時間で完成した。AI開発、恐るべし。


作ったもの:Local Audio Browser

  • 指定フォルダ以下の音源を再帰的にリスト化
  • Adobe Stock風の波形一覧表示
  • 波形クリック&スクラブ再生
  • Finderで表示ボタン

機能はこれだけ。だが、これが欲しかった。



開発ログ

1. 爆速のプロトタイプ(所要時間:5分)

要件をGeminiに投げる。
「ローカル音源を波形一覧表示して再生できるアプリ作って。UIはWebのアセットサイトでよくあるようなやつっぽく」

コードが吐き出される。コピペして実行。
動いた。すご!

ここまで5分。
ファイル検索、Librosaでの解析、GUI描画。これ全部自力で書いたら休日が終わるやつだが、カップ麺を作ってる間に終わってしまった。


2. 壁:読み込みが重い

プロトタイプは動いたが、ファイル数が多いとフリーズする。
音声解析の Librosa が高機能すぎて重いらしい。

  • 対策: 標準ライブラリ wave とのハイブリッド化。
    • WAVは爆速な標準ライブラリで読む。
    • MP3などだけLibrosaに投げる。
    • 描画用にデータをガッツリ間引く。

これで数百ファイルのフォルダでもサクサクになった。


3. 進化:神機能「スクラブ再生」

クリック再生だけだと、「曲のサビだけ聴きたい」みたいな時に不便。
「波形の上をマウスでなぞったら、そこを再生するようにしたい」と追加オーダー。

PyQtの mouseMoveEvent をフックして、座標から再生位置を即シークする処理が追加された。
これが入った瞬間、「ただの再生機」から「実用的な選定ツール」に化けた。


4. 配布用にダイエット

自分用に作ったが、便利なので配布することに。
PyInstaller でビルドしたら300MBを超えた。犯人はPyQt6が抱え込んだWebブラウザ機能。
不要なモジュールを exclude してダイエットさせ、最終的に50MB程度に着地。


まとめ

「欲しいツールがないなら作る」が、AIのおかげで「ランチタイムに作る」くらいの感覚になってきている。
ロジックの実装はAIに任せて、人間は「どんな体験(UI/UX)にしたいか」に集中できるのが最高に楽しい。


今後公開予定・・・

ソースコードとアプリは公開しているので、同じ悩みを持つ動画編集者やDTMerの方は使ってみてください。

2025年7月1日火曜日

MacbookでGemini CLIを使うまでの完全セットアップ手順(成功記録)


GoogleのAIモデル「Gemini」をローカルのターミナルから使うために、MacBook ProでCLIのセットアップを行いました。環境変数やパーミッションで詰まったものの、最終的に成功したので手順を記録します。

✅ 環境

  • 端末:MacBook Pro(Apple Silicon)
  • シェル:zsh
  • 目的:Gemini CLIでチャットやスクリプト実行
  • APIキー:Google AI Studioで発行

✅ セットアップ手順

1. nvmでNode.js(LTS)をインストール

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.zshrc
nvm install --lts
nvm use --lts

2. Gemini CLIをグローバルインストール

npm install -g @google/gemini-cli

3. APIキーを環境変数に設定

一時的に使う場合:

export GEMINI_API_KEY="あなたのAPIキー"

恒久的に使う場合(起動時に有効):

echo 'export GEMINI_API_KEY="あなたのAPIキー"' >> ~/.zshrc
source ~/.zshrc

4. Geminiチャットを開始

gemini chat

🎉 これでターミナル上に対話プロンプトが表示されます。

✅ 補足メモ

  • 一部バージョンでは ~/.gemini/config.json を読まず、環境変数が必須
  • nvm を使えば npm の権限エラー(EACCES)を回避できる
  • APIキーを保護したい場合は:
    chmod 600 ~/.gemini/config.json

✍️ 最後に

CLIでGeminiを使うと、ちょっとしたプロンプトテストやスクリプト実行がとても便利になります。 Chatアプリを作ったり、テキスト解析に活かしたり、今後も活用していく予定です。

2022年8月30日火曜日

Midjourneyで田園風景を生成してみた


 前回の初使用「Midjourneyで日本の神社画像を生成してみるテスト」に続き、

AI画像生成テスト第2段!試したメモ。

・・・・・無料残り回数7回!


「広葉樹林の山にそびえたつ和風木造建築」で生成した画像。




■個人的に好きな絵に近づくPrompt

・日本的な森
many mountains of landscape with broadleaf forest,old forest,

・高解像度でフォトリアル
hyperdimensional photography, hyper realistic,

・田んぼ道
long road between rice garden, 

・夏の雲
large beautifull clouds in summer,





■Test画像とPrompt

hyperdimensional photography,huge structure, realistic, cinematic,Landscape with broadleaf forest, bright daytime, birds flying, pleasant breeze, ancient forest, huge Japanese-style wooden structure towering over the landscape,--aspect 7:3 


(version3)


hyperdimensional photography,huge structure to the cosmo, ultrarealistic, cinematic,Landscape with broadleaf forest, bright daytime, little birds flying near camera, pleasant breeze, ancient forest, playing dogs,huge Japanese-style wooden structure towering over the landscape,--aspect 7:3


(version3)


hyperdimensional photography, ultrarealistic, cinematic, landscape with broadleaf forest, bright daylight with strong sunlight, small bird flying near camera, pleasant breeze, old forest, dog playing in front of camera, huge Japanese style wooden structure reaching to the sky in the landscape,spaceship docked next to villa built by aliens, -- Aspect ratio 7:3


hyperdimensional photography, cinematic, landscape with broadleaf forest its roundly, bright daylight with strong sunlight, small bird flying in the high sky, pleasant breeze, old forest,  Japanese style huge wooden structure reaching to the sky in the landscape,kawaii spaceship docked next to villa built by aliens, -- Aspect ratio 7:3



hyperdimensional photography, ultrarealistic,  landscape with broadleaf forest its roundly, bright daylight with strong sunlight, small bird flying in the high sky, pleasant breeze, old forest,  Japanese style huge and high wooden structure reaching to the sky in the traditional japanese-style garden,villa built by aliens,kawaii spaceship going on there,  -- Aspect ratio 7:3



hyperdimensional photography, ultrarealistic,  many mountains of landscape with broadleaf forest , bright daylight with strong sunlight, many small birds flying in the high sky,large beautifull clouds in summer, old forest,  Japanese style huge and high wooden structure reaching to the sky ,long road between rice garden -- Aspect ratio 7:3



hyperdimensional photography, hyper realistic,  many mountains of landscape with broadleaf forest , bright daylight with strong sunlight, many small birds flying in the high sky,large beautifull clouds in summer, old forest,  huge Japanese-style wooden structure towering over the landscape,long road between rice garden, --ar 7:3


(version3)






2022年8月28日日曜日

Midjourneyで日本の神社画像を生成してみる テスト


 初めて本格的にMidjourneyを使ってみた。


「美しい雲の切れ間から光が差し込む神社」で生成した画像。







以下備忘録メモ。


このページを参考に始めた。

https://ciclo.jp/midjourney-discord/



PCにDicordをインストール。

グループに参加。


そして、 /imagine つかって指示。

指示の出し方はこちら参考にさせてもらいました、まじ感謝。

https://note.com/shi3zblog/n/n9e3976f0c7f4




/info で残り時間を確認。



アスペクト比をデフォルトの1:1から変更

https://trpg-japan.com/knowledge/how-to-use-midjourney/



高解像度にする

https://mutsumutsu-daifuku.com/howto-midj/

Uボタン→ もしくはコマンドでできた。



■個人的メモ

・高解像度の写真風 冒頭に追加

hyperdimensional photography of


・ジブリ風 末尾に

in Hayao Miyazaki style


■最後に、テスト画像を貼ります

A detailed oli painting of organic shaped photorealistic view of an old shrine and its torii (torii gate) in a rural area  in Hayao Miyazaki style



A detailed oli painting of photorealistic view of an old japanese shrine and its torii (torii gate) at a rural area forest  in Hayao Miyazaki style



Walking down the road of  old japanese shrine's precincts ,over the torii (torii gate) , at sunrise, many birds flying,very beautiful clouds,between  komainu  ,Rural landscape with rice fields,A mountain of broad-leaved forest spreads out



camera lens 12mm super wide, Walking down the road of  old large shrine's precincts its japanese style over the small torii , at sunrise, many birds flying,very beautiful clouds,between  komainu  ,Rural landscape with rice fields,A mountain of broad-leaved forest spreads out, run and playing children,pop color 




Walking down the road of  old japanese jinja,with  the small torii , at sunrise, many birds flying,very beautiful clouds ,showa age with rice fields,A mountain of broad-leaved forest spreads out,  Japanese people smiling and greeting each other as they work the farm.



Izumo-taisha shrine illuminated by light shining through a beautiful gap in the clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour 


Izumo-taisha shrine illuminated by light shining through a beautiful gap in the clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour ::  in Hayao Miyazaki style, --aspect 9:19





hyperdimensional photography of Izumo-taisha shrine illuminated by light shining through a beautiful gap in the large clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour new year, with high buildingth future



hyperdimensional photography of  Izumo-taisha shrine illuminated by light shining through a beautiful gap in the clouds,  people are lining up to worship, very large pine trees are lining the road, far landscape is several mountains of hardwood trees are lined up side by side, in the magic hour,  --aspect 2.35:1