Grae n
Magnetic Fields in Augmented Reality
updated
Code
(part of a larger project) github.com/graemeniedermayer/live-3d-gen-basic-game/blob/main/core/ui_components/ui_components.js
UI library used
github.com/pmndrs/uikit
Animation
github.com/tweenjs/tween.js
Today we're going to be doing 3 different quest 3 projects.
Timeline
0:00 Intro
0:28 Gaussian Splats
3:52 Throwing app
5:59 Porting SimonDev
Project 1 Gaussian Splats
Sources
github.com/mkkellogg/GaussianSplats3D (library used slightly modified example)
https://repo-sam.inria.fr/fungraph/3d-gaussian-splatting/
Splat videos sources
youtube.com/watch?v=brr8oO37lkQ
youtube.com/watch?v=EXalSlCjrU0&t=205s
youtube.com/watch?v=8yfBOcM2WvY
Project 2 Hand throwing
github.com/graemeniedermayer/ArExperiments/blob/main/html/quest_throwing.html
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/quest_throwing_app.js
Project 3 Porting threejs projects to quest (using simondev)
Code (with ww2 planes instead)
github.com/graemeniedermayer/ArAce/tree/quest
Original project
youtube.com/watch?v=XkvH7z4GxHM
github.com/graemeniedermayer/3d-depth-gen
Here we are building a prompt to 3d app for quest 3. Very rudimentary but exciting for the future!
Heavily uses monodepth big thanks to thygate + semjon00
Method for creating 3d models
youtube.com/watch?v=_6gD_pEis58
Academic Sources
@misc{ke2023repurposing,
title={Repurposing Diffusion-Based Image Generators for Monocular Depth Estimation},
author={Bingxin Ke and Anton Obukhov and Shengyu Huang and Nando Metzger and Rodrigo Caye Daudt and Konrad Schindler},
year={2023},
eprint={2312.02145},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@misc{doi.org/10.48550/arxiv.2302.12288,
doi = {10.48550/ARXIV.2302.12288},
url = {arxiv.org/abs/2302.12288},
author = {Bhat, Shariq Farooq and Birkl, Reiner and Wofk, Diana and Wonka, Peter and Müller, Matthias},
keywords = {Computer Vision and Pattern Recognition (cs.CV), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {ZoeDepth: Zero-shot Transfer by Combining Relative and Metric Depth},
publisher = {arXiv},
year = {2023},
copyright = {arXiv.org perpetual, non-exclusive license}
}
Chapters
0:00 intro
1:09 reference frame transform
1:50 magnetic examples
3:37 code
Code here:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/websockets/quest3_magnets.js
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/websockets/mobiles_magnets.js
(this repo is messy needs restructuring)
Marigold
github.com/prs-eth/Marigold
My noise edits to Marigold
github.com/graemeniedermayer/Marigold-Inpainting/tree/main
Depthmap marigold
github.com/thygate/stable-diffusion-webui-depthmap-script/tree/marigold
Academic Citation
@misc{ke2023repurposing,
title={Repurposing Diffusion-Based Image Generators for Monocular Depth Estimation},
author={Bingxin Ke and Anton Obukhov and Shengyu Huang and Nando Metzger and Rodrigo Caye Daudt and Konrad Schindler},
year={2023},
eprint={2312.02145},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
My Fork
github.com/graemeniedermayer/ar-example-gsplat.js
Gaussian splat JavaScript libraries
github.com/dylanebert/gsplat.js (library used)
github.com/antimatter15/splat
github.com/mkkellogg/GaussianSplats3D (maybe the best for vr)
github.com/cvlab-epfl/gaussian-splatting-web
Gaussian splats repo
github.com/graphdeco-inria/gaussian-splatting
Dreamgaussian repo
github.com/dreamgaussian/dreamgaussian
doi.org/10.48550/arXiv.2309.16653
Amazing open source repos. Big thanks to everyone!
github.com/dreamgaussian/dreamgaussian
doi.org/10.48550/arXiv.2309.16653
Super awesome repo. Big thanks to the authors!
This repo/paper combines a large number of ideas including 3d gaussian splatting, 3d generative ai, single image reconstruction, and a number of other numerical wizardry. Neural/Differential rendering are taking off much faster than I expected!
Very useful thread
github.com/dreamgaussian/dreamgaussian/issues/22
Code is here (I'm thinking about finding a better place for it):
github.com/graemeniedermayer/stableScripts/blob/main/tangent_normalmaps.py
Extra normal map resources
Freya Holmer
youtube.com/@UC7M-Wz4zK8oikt6ATcoTwBA
aVersionOfReality
youtube.com/@aVersionOfReality
Timeline
Intro 0:00
Manual Stylizing 0:30
Gen Normals 1:05
Materials 2:17
3d Normals 2:57
Shadows 3:22
Original Video
youtube.com/watch?v=s8N00rjil_4 (youtube version)
tiktok.com/@codygindy/video/7264345365950795050?lang=en
Impasto Lora
civitai.com/models/82582/thick-impasto-painting
Timeline
0:00 Intro
0:33 Img tips
2:00 Depth tips
4:35 Blender
6:45 Mixamo
Depthmaps
github.com/thygate/stable-diffusion-webui-depthmap-script
Add detail lora
civitai.com/models/58390
Other img-to-3d videos
youtube.com/watch?v=tBLk4roDTCQ
youtube.com/watch?v=Wf-OmHyFduo
Also for post processing AI models this videos is really interest
youtube.com/watch?v=-rfNOBGIiyk
gaussian edge blur script and opencv contour script available here
github.com/graemeniedermayer/stableScripts/tree/main
If this was too fast-pace dense let me know.
github.com/ashawkey/Drag3D
Acknowledgements
github.com/XingangPan/DragGAN
github.com/nv-tlabs/GET3D
Super excited open source repo! You can drag 3d models around and they will be constrained to the original object type.
This was put together using
github.com/thygate/stable-diffusion-webui-depthmap-script
Projectionist / Visuals / Musician
instagram.com/_fiatlvx/?hl=en
instagram.com/1000joules/?hl=en
Resources
Academic Papers
Zoedepth: arxiv.org/abs/2302.12288
github.com/isl-org/ZoeDepth
Sadtalker: arxiv.org/abs/2211.12194
github.com/Winfredy/SadTalker
Youtube
Mickmumpitz
youtube.com/@mickmumpitz
Prompt muse channel
youtube.com/@promptmuse
Depth repo:
github.com/thygate/stable-diffusion-webui-depthmap-script
timestamps
0:00 intro
1:29 Google's Dreambooth3d
2:45 My pipeline
3:38 My results
5:18 Emergent 3d?
Sources
academic
-dreambooth3d arxiv.org/abs/2303.13508
opensource
-mikubull's controlnet extension github.com/Mikubill/sd-webui-controlnet
-controlnet repo - github.com/lllyasviel/ControlNet
-my scripts github.com/graemeniedermayer/stableScripts
The models were found on civitai and huggingfaces sites
Code (very messy): github.com/graemeniedermayer/augmented_reality_SD/blob/main/frontend/js/autoInpainting.js
It's a work in progress there's a lot of fixing to do but I'm super excited about the possibilities
messy code (hopefully I'll have some cleaner code next week): github.com/graemeniedermayer/ArExperiments/blob/main/javascript/auto1111ar.js
Demo (Android ARCore only):
graemeniedermayer.github.io/ArExperiments/html/maze.html
Code:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/arMaze.js
MiDaS (for normal maps) :
@article {Ranftl2022,
author = "Ren\'{e} Ranftl and Katrin Lasinger and David Hafner and Konrad Schindler and Vladlen Koltun",
title = "Towards Robust Monocular Depth Estimation: Mixing Datasets for Zero-Shot Cross-Dataset Transfer",
journal = "IEEE Transactions on Pattern Analysis and Machine Intelligence",
year = "2022",
volume = "44",
number = "3"
}
The amazing depthmap repo
github.com/thygate/stable-diffusion-webui-depthmap-script
Academic reference
@inproceedings{Shih3DP20,
author = {Shih, Meng-Li and Su, Shih-Yang and Kopf, Johannes and Huang, Jia-Bin},
title = {3D Photography using Context-aware Layered Depth Inpainting},
booktitle = {IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2020}
}
Timeline
0:00 Intro
1:15 opencv Contour
1:48 mediapipe
2:38 rembg
3:50 automatic1111 api
5:03 numpy image scripting
Code
Main repo - github.com/graemeniedermayer/stableScripts
Auto1111 clothing seg extension (work-in-progress) - github.com/graemeniedermayer/clothseg
Timestamps:
0:00 Intro
0:56 NeRF
2:00 NGP + mip360
3:25 SNeRG + NeRV + dNeRF
6:03 Single views
7:18 Latent Dif + Neural
Repos
torch-ngp - github.com/ashawkey/torch-ngp
ngp_pl - github.com/kwea123/ngp_pl
Academic Papers:
I ran out of characters with standard citations. You should be able to google the arXiv citation, if you have trouble find a source let me know! Many of the papers from 2022 may still be in pre-print (non-peer reviewed).
[0] arXiv:2111.11426 - nerf review
[1] arXiv:2210.00379 - nerf paper
[2] arXiv:2201.05989 - ngp paper
[3] arXiv:2111.12077 - mip360 paper
[4] arXiv:2103.14645 - snerg paper
[5] arXiv:2012.03927 - nerv paper
[6] arXiv:2011.13961 - dnerf paper
[7] arXiv:2204.00928 - sinnerf paper
[8] arXiv:2210.08936 - s^3 nerf paper
[9] arXiv:2212.03267 - nerdi paper
[10] arXiv:1901.05103 - deepSDF paper
[11] arXiv:2104.09877 - shadow nerfs paper
[12] arXiv:2211.10440 - magic3d paper
[13] arXiv:2209.14988 - dreamfusion paper
Not used but referred to
[14] arXiv:2203.12575 - neuMan paper
[15] arXiv:2203.07182 - NeILF paper
Thanks arXiv for being free!
This should work for non-ai art. You might also be able to get this workflow too work with just a depth map. I have not tried using depth2img with this. In principle I'd expect it to give better results; however, I have not tested it.
Timestamps:
0:00 Intro
0:20 Workflow
1:47 Problems and fixes
3:10 Materials?
4:40 Other Experiments
normal map plug-in:
github.com/graemeniedermayer/stable-diffusion-webui-normalmap-script
depth plug-in (super huge thanks to thygate):
github.com/thygate/stable-diffusion-webui-depthmap-script
midas:
github.com/isl-org/MiDaS
normal map plug-in:
github.com/graemeniedermayer/stable-diffusion-webui-normalmap-script
depth plug-in (super huge thanks to thygate):
github.com/thygate/stable-diffusion-webui-depthmap-script
midas:
github.com/isl-org/MiDaS
webxr mobile demo (no iphone support) (stable diffusion 2 examples):
graemeniedermayer.github.io/ArExperiments/fantasyDepth.html
code:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/fantasyDepth.js
depth plug-in (super huge thanks to thygate):
github.com/thygate/stable-diffusion-webui-depthmap-script
midas:
github.com/isl-org/MiDaS
Sorry for the low resolution.
timestamps
0:00 intro
0:28 Lenticular Analogy
1:20 Pose Experiment
1:50 RCMP to Goth
2:30 Truck to Art Supplies
3:05 Trying it yourself!
4:30 Differences with Dreamfusion
Academic Sources (they include code)
nerfs - matthewtancik.com/nerf
llff - bmild.github.io/llff
colmap - colmap.github.io
dream fusion (no code) - dreamfusion3d.github.io
Sources:
how to make lenticular images
youtube.com/watch?v=38lMTSIXrok
augmented thinker's post reddit.com/r/augmentedreality/comments/yls9b6/i_believe_i_nerfd_a_first_lava_lamp_with_motion_i
sarai marte's video that made me think about layering
youtube.com/watch?v=JtRDVmqqn7c
Timestamps
0:00 Intro
1:05 Steampunk
1:59 Summer and Gothic
2:50 Code Discussion
4:13 Trying yourself
Code*:
stable diffusion websocket script (this code is a little buggy):
github.com/graemeniedermayer/ArExperiments/blob/main/python/websocket-client/stableDiffusionClient.py
webxr JavaScript:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/websockets/stableClient.js
django channel routing
github.com/graemeniedermayer/ArExperiments/tree/main/python/django/stableDiffusion
* There are some very big issues with this code notably sending images through json and the websocket-client code is questionable.
Google Colab:
github.com/graemeniedermayer/ArExperiments/blob/main/notebooks/minimal_img2img.ipynb
Particle Image used:
github.com/graemeniedermayer/ArExperiments/blob/main/data/images/particles.png
Webapp:
graemeniedermayer.github.io/ArExperiments/html/particleSystemUploadable.html
timestamps
0:00 Intro
1:00 Follow along google colab
2:30 Using these particle system in blender
3:37 Using these particle systems in unity
4:24 Fun math problem
6:20 Directional particle system
Javascript for this project is located
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/arParticleSystem.js
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/arDirectionalParticles.js
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/particleSystemUploadable.js
Today we are exploring using stable diffusion to create special effects with particles systems. Stable diffusion img2img can help create unique special effect very easily. A lot of this code originated from @SimonDev particle system videos.
Other word art / useful related videos I've found are:
bitmaps to svgs - youtube.com/watch?v=cNXGnEKz0Rw
channel with lots of word art - youtube.com/channel/UCXJpHQFclSVm_PkPwDQeGQg/videos?view=0&sort=p&flow=grid
more consistence ai videos
youtube.com/watch?v=xtFFKDgyJ7A
Timestamps
0:00 Intro
0:13 Word Art
1:00 Animations
2:51 Fonts
5:20 Outro
To be clear this was using img2img from:
github.com/CompVis/stable-diffusion
NOT (which is higher in googles algorithm)
huggingface.co/spaces/lambdalabs/stable-diffusion-image-variations
This is very much a work-in-progress. There's still lots of room for improvement. In particular you could probably get better results from using cleaner meshes.
It seems like new variants of stable diffusion are being release every few days.
Time stamps
0:00 Intro
0:12 Augmented Reality (UV Maps)
2:36 Hands
3:00 Feet
3:41 Stable Diffusion fixing artefacts
4:11 PIFuHD examples
4:27 Photogrammetry
5:13 More Faces
Stable Diffusion
github.com/CompVis/stable-diffusion
Meshroom
github.com/alicevision/Meshroom
PIFuHD
shunsukesaito.github.io/PIFuHD
Some other exciting videos I saw this week
Single image of person to 3d model of person (I used this for pifuHD):
youtube.com/watch?v=GK1WdnULYMQ
Timestamps
0:00 Intro
0:52 Image textures examples
1:34 The process
2:37 Projected into augmented reality
3:34 Light in Cycles
3:55 Useful tutorial
some of the prompts I used ['universe', 'vampire', 'cyberpunk', 'steampunk','french revolution'','gothic', 'samurai', 'dragon', 'spring', 'autumn, 'rusted']
Super helpful remeshing tutorial:
youtube.com/watch?v=I-lH2_Ca3Dw
Stable Diffusion
github.com/CompVis/stable-diffusion
Meshroom
github.com/alicevision/Meshroom
Some other exciting videos I saw this week.
2minutepaper just dropped a video about an amazing extension to stable diffusion that's super relevant to retexturing
youtube.com/watch?v=XW_nO2NMH_g
Single image of person to 3d model of person:
youtube.com/watch?v=GK1WdnULYMQ
Inpainting textures in blender:
youtube.com/watch?v=2rA4Ny-QQfg
This project uses a fairly significant amount of code from simondev .
Timestamps
0:00 Intro
1:05 Colliders
2:16 Goals
2:53 Code Discussion
3:50 Code
The Repo is (Heavy WIP) here:
github.com/graemeniedermayer/aiar
Other texture related videos I've found are:
youtube.com/watch?v=UvJkQPtr-8s
youtube.com/watch?v=FmY5AiempII
youtube.com/watch?v=Me8-dKhQ0UU
To be clear this was using:
github.com/CompVis/stable-diffusion
NOT (which is higher in googles algorithm)
huggingface.co/spaces/lambdalabs/stable-diffusion-image-variations
Time Stamps:
0:00 Intro
0:17 Using Stable Diffusion
2:02 Image Processing
2:23 Blender
4:49 Comparing My Art with the AI
5:21 Code
8:03 Up Next
Links
Stable Diffiusion web app:
huggingface.co/spaces/stabilityai/stable-diffusion
Stable Diffiusion Google Colab Book:
colab.research.google.com/github/huggingface/notebooks/blob/main/diffusers/stable_diffusion.ipynb
Code (Me also a WIP):
github.com/graemeniedermayer/aiar
Code:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/jarVis.js
Credit to @SebastianLague and @simondev758 for teaching me about procedural terrain.
Timestamps:
Intro 0:00
Image Tracking 0:36
Delanauy Traingulation (aside) 2:25
Image Tracking Second Part 3:10
Terrain Generation 3:35
Combining Terrain and Tracking 5:04
Code 6:39
Code is located at (You'll need to take your own pictures):
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/catanTerrain.js
This is a visualization of the wieghts of AlexNet a neural network that won a competition in 2012 that kicked off some of the more recent advancements in artificial intelligence. Many more recent networks are much more complicated but they are still often represented by blocked of weights/parameters.
Time Codes
0:00 AlexNet
1:17 Basic Walkthrough
2:30 More Through Walkthrough
8:04 Image To Weights
9:01 Visualizing with Units or Connections
10:06 Code
There's a lot of sources
medium.com/@sdoshi579/convolutional-neural-network-learn-and-apply-3dac9acfe2b6
github.com/mikechen66/AlexNet_TensorFlow2.0-2.3 (this was the alexnet version I used)
en.wikipedia.org/wiki/AlexNet
proceedings.neurips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf (alexnet paper)
This visualisation contains all of the 60,954,656 weights of AlexNet. Gosh I need to learn how to do 3d video stabilization.
Code is at
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/arVisNN.js
Timestamp
0:00 Intro
0:56 Maths
2:09 Example
4:47 Code
Code
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/websockets/followerWebsocket.js
Timestamps
0:00 Intro
0:48 Quick Demos
2:16 Image Quality
3:29 Gravity Simulation
5:07 Skeleton Code
6:55 Animation Code
7:35 Gravity Sim Code
Demo:
gravity:
graemeniedermayer.github.io/ArExperiments/html/gravityMarker.html
skeleton:
graemeniedermayer.github.io/ArExperiments/html/webxrMarker.html
Code:
gravity markers: github.com/graemeniedermayer/ArExperiments/blob/main/javascript/gravityMarkers.js
skeleton:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/webxrMarker.js
animation: github.com/graemeniedermayer/ArExperiments/blob/main/javascript/animationMarker
Time Codes:
0:00 Intro
0:53 Charts
2:17 Energy conservation discussion
3:56 Code
_
the code discussed:
github.com/graemeniedermayer/ArExperiments/blob/main/javascript/websockets/websocketCharts.js
**Please make sure websockets are secure if you do anything in the wild with this.
Time Stamps
0:00 Intro
2:24 Server setup
3:22 Example
4:30 JavaScript Client Code
6:14 Python Server Code
Django Channels / Nginx setups:
1. digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04#step-8-%E2%80%94-checking-for-the-gunicorn-socket-file
2. digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
3. channels.readthedocs.io/en/stable
Code: github.com/graemeniedermayer/ArExperiments/tree/main/javascript/websockets
Live Demo
Bloom:
graemeniedermayer.github.io/ArAce/postProcessBloom.html
AfterImage:
graemeniedermayer.github.io/ArAce/postProcessAfterImage.html
Depth of Field:
graemeniedermayer.github.io/ArAce/postProcessDOF.html
Code is here:
github.com/graemeniedermayer/ArAce
demo
graemeniedermayer.github.io/ArAce/occlusionShadow.html
code
github.com/graemeniedermayer/ArAce/tree/main/src/occlusionShadow
This video focuses on using depth information to cast shadows and using light estimation. It is primarily webxr, threejs, and javascript.
This uses a fair amount of @simondev758 's code.
This is a code is available here: github.com/graemeniedermayer/ArAce
Demo: graemeniedermayer.github.io/ArExperiments/html/arPlaneDetection.html
Code: github.com/graemeniedermayer/ArExperiments/blob/main/javascript/planeDetect.js
simondev original video youtube.com/watch?v=XkvH7z4GxHM
code: github.com/graemeniedermayer/PewPewInAR
simondev original github: github.com/simondevyoutube/Quick_Game2_StarWarsThing/tree/main/src


