3DCG屋さんの活動記録

PROFILE ★★こんな人です

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

2022年9月24日土曜日

フェイシャルアニメーションをUEで試してみたメモ(Faceware to UE)


「スマホでFacialCaptureができる」時代、ってことで

最新のソフトの実状検証。


仕事で Dynamixyz 使ったものの、やりたいことを実現するための作業コストの高さから挫折した経験も踏まえて、検証してみる。


Faceware Studio


Epicがチュートリアルも作って押しているFacialAnimationのソフト。

フロー的には以下の通り。


顔撮影

 ↓動画ファイル読み込み or WEBカメラ

Faceware Studio でTrackingと信号送信

 ↓専用のLiveLinkプラグインでリアルタイム連動

UE で「Faceware専用BP」により信号受信、それをMetahumanに流してリアルタイムフェイシャルアニメ


Dynamixyzはじめ他のソフトと変わらない。


------------------------------------------------

先に、重要リンク3つ

①Epic公式チュートリアル(Faceware+Metahuman)

https://dev.epicgames.com/community/learning/courses/d66/metahuman-workflows-with-faceware-studio/bL8y/unreal-engine-livelink-client


②サンプルUEプロジェクト(Epic)

https://www.dropbox.com/sh/qd0nyv3banf6ch1/AABbSk9sC8R2ZeycMXvk4mQ_a?dl=0?dl=1


③Faceware用のBP ダウンロード(Faceware)

http://support.facewaretech.com/live-link-plugin



--------------------------------------------------

ここからは使ってみた所感。


■FacewareとUEの連動

これは素晴らしい!簡単!

撮影素材→Tracking(デフォ自動、計算一瞬)→UE連動 の流れが超簡単速い。

(今後それぞれのソフトのVersionupにどれだけ対応するか知らんけど)




■Faceware でのチューニング

・・・・これが、

結局フェイシャルのOptimizeが大変です。 Profileつくるのが大変(眉毛の右の下部、とか超細かい設定をしまくらないといけないのが)なので、やっぱりこれはやらないことにする。AI活用期待。。。



取り急ぎ、以上!

2022年9月20日火曜日

StableDiffusion AUTOMATIC1111 備忘録



Seamless Texture を超簡単に作成できる。



■ GOOD(試したみて良い点)

・SeamlessTexure超簡単  Tiling=on するだけ

・X/Y plot の使い勝手慣れてきた

 ①繰り返し、いい感じで②繰り返し。Seed活用で狙った画に近づける

・Seam具合はBlenderで確認

・AUTOMATIC1111 毎日更新してるらしい。Git pull。→Seed Bake?が便利そう


※設定画面




■ まだうまく使いこなせていない点

・初期パラメータ変更(ui-config.json)がうまく反映しない

・512x512で生成したあとの高解像度化がうまくいかない


2022年9月15日木曜日

Stable Diffusion の img2img を試す


ローカル環境で StableDiffusion を試してみたところ

txt2img が成功したので、続けて img2img も試してみた。




以下サイトを参考にして、無事成功した !🙏

https://self-development.info/%E3%80%90stable-diffusion%E3%80%91img2img%E3%81%AE%E3%82%A8%E3%83%A9%E3%83%BC%E8%A7%A3%E6%B1%BA%E6%96%B9%E6%B3%95/



また、Pythonでコードをカスタマイズして、

・生成される画像ファイル名の末尾の連番をインクリメントセーブする

・promptなどのパラメータをテキストで保存する

というのも実装できた!


※一応Code貼っておきます(py3.9)



・・・けれど、

地味に時間かかるし、使い勝手悪いので、ちょっと先行き怪しい、、、

とのことで、ちまたで騒がしい既存の超便利なWebUIを試してみる!


色々ありすぎるが、自分の用途が達成できそうな

-----------------------------------

「AUTOMATIC1111版Stable Diffusion web UI」が良さそう。

全部入り機能だが、特に気になった機能4選!!!

Inpainting:特定の部分の描き直し ・Stable Diffusion upscale:512x512で作成後、高解像度化機能 ・Loopback:作成した画像をinputにして繰り返すことで、ブラッシュアップする ・Textual Inversion:自分で用意した学習データを使う

-----------------------------------

ということで、次回は、、、


Stable Diffusion web UI(AUTOMATIC1111版)のインストール

https://gigazine.net/news/20220907-automatic1111-stable-diffusion-webui/


■基本の「tex2img」

https://gigazine.net/news/20220909-automatic1111-stable-diffusion-webui-how-to-use/


■クリエイティブを加速せよ「img2img」

https://gigazine.net/news/20220913-automatic1111-stable-diffusion-webui-img2img/


を試す!


ひとまず、ローカルのVRAMが12GBあるので ローカル環境でためそう。

どっかのタイミングで、Google Colabを使ってみたい。



2022年9月14日水曜日

StableDiffusionをローカル環境で試す


・StableDiffusionを回数気にせず試したい!

・機械学習についてPythonとともに学びたい!


ということで、トライしたところ

なんとか開発環境構築が終わり、ローカルで何回でもStableDiffusionを使えるようになった!

たので備忘録メモ!




■事前チェック

CUDA 11.6をインストール済み



■Python3.9インストール

C:\Users\{userName}\AppData\Local\Programs\Python\Python39

 (デフォルトのまま)



■仮想環境

任意のフォルダに仮想環境を構築(今回はC:\Python39)

>cd C:\Python39

>py -3.9 -m venv my_venv


■パッケージインストール

仮想環境にインストールしたいので、


まず仮想環境への切り替え(仮想環境 .venv ディレクトリのactivate.batを実行)

>C:\Python39\my_venv\Scripts\activate.bat


この状態で、まず pip upgrade。

(.venv) >C:\Python39\my_venv\Scripts\python.exe -m pip install --upgrade pip


続けて、pipでインストール。 ※仮想環境を作ったときのバージョンになる

(.venv) >python -m pip install <package name>


・PyTorch

(.venv) >python -m pip install torch


・Transformers【仮想環境にインストール推奨】

(.venv) >python -m pip install tranformers


・Diffusers【仮想環境にインストール推奨】

(.venv) >python -m pip install diffusers


■Diffusersの動作確認

pythonをコピペして、仮想環境で実行→OK


■StableDiffusionの動作確認

Pythonをコピペして、仮想環境で実行 →OK !簡単


もし、PyTorchエラーがでたら、PyTrochを入れ直してみる。

・PyTorch入れ直し

(my_venv) >pip list

で +cu116 が入っていないものをアンインストール

(my_venv) >pip uninstall torch

つづけてインストールし直し。

(my_venv) >pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116

※https://pytorch.org/



--------------

StableDiffusionのテストPython



============================================

■参考サイト(諸先輩の説明に感謝)

・ローカル環境でStableDiffusionを実行する

https://self-development.info/%E3%80%90%E7%B0%A1%E5%8D%98%E3%80%91%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%E7%92%B0%E5%A2%83%E3%81%A7stable-diffusion%E3%81%A7%E5%AE%9F%E8%A1%8C%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95/

・DreamStudio金額は?

https://ciclo.jp/dreamstudio/

・Prompt参考(lexica)

https://lexica.art/?q=city++siver&prompt=d9b2c577-5083-4b76-9de0-e01117682f56

・Promptまとめ 

https://golabo.net/stable-diffusion-command/

2022年9月1日木曜日

TortoiseGit で初Push ~デフォルトブランチ名は master じゃなくて main !


備忘録

 GitHubで、初めてちゃんとリポジトリをプッシュしてみた。


■やったこと

・GitHubでリポジトリ作成

・TortoiseGitでクライアント側操作

・ローカルのフォルダ&ファイルをリモートリポジトリに反映



■重要 事前設定変更

TortoiseGitのSettigsで、デフォルトブランチ名を「master」→「main」に変更。





■【手順】ローカルのフォルダをリモートリポジトリにする

管理したいローカルのフォルダ名を使って、Gitにリポジトリ作成。

 →ここでURLコピーしておく(Code。httpからOK、gitからNG)


ローカルのフォルダで右クリックして「Git create repository here」

 →.gitのフォルダが作成される

 ※まだここでは反映していない


ローカルのフォルダで右クリックして「Commit」。 

 チェック入れて、コメント入れて、「Commit&Push」

 ここで、URLを聞かれるので以下の通り回答。

 URL入れるダイアログで 「Manage」ボタン押す。

 →次のダイアログのURLにURL入れる。(httpからの)

 →AddNew/Save

 →OK 

 →OK

 →Close

以上で、GitHub のリポジトリ確認すれば、ローカルのファイルがアップ(Push)されています!




■【手順】リモートリポジトリをローカルフォルダに反映

①ローカルフォルダで右クリック「Git Clone...」

 →事前にフォルダは空にしておく


②URLを聞かれるので、リモートリポジトリのURLをコピペ

 →Directoryはフォルダを新規作成するか決める


以上。




■個人的ポイント

・Commit&Push をつかう

・プルリクエスト  ←全体にプッシュしたこと伝える



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