r/dsf • u/[deleted] • Oct 24 '21
sd
sfsdvf
| r/MagicEye (Parallel View) | r/MagicEye_CrossView |
|---|---|
| r/depthMaps (Magic Eye Solutions) | r/patternPieces |
This sub has wide parallax parallel view magic eyes and other posts that interest me
Add your cuda ( $LD_LIBRARY_PATH) paths with/etc/profile.d/cuda.sh
pathmunge /usr/local/cuda-11/bin before
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=/usr/local/cuda-11/lib64
else
LD_LIBRARY_PATH=/usr/local/cuda-11/lib64:$LD_LIBRARY_PATH
fi
export PATH LD_LIBRARY_PATHNvidia Driver=450.x NVCC=11.x GCC=9.x
conda create -n stylegan2 python=3.6 cudatoolkit=10.0 numpy cudnn nvcc_linux-64=10.0 cupti scipy=1.3.3 requests=2.22.0 Pillow=6.2.1 protobuf conda-compilers git -c conda-forge -c nvidia
conda activate stlyegan2
pip install tensorflow-gpu==1.15.3
git clone https://github.com/NVlabs/stylegan2.git
https://github.com/facebookresearch/pifuhd
indented bullet points indicate conda enviromentInstall
conda create --name pifuhd python=3.7 pytorch=1.5 torchvision tqdm pyopengl freeglut pillow git -c pytorch
conda activate pifuhd
conda install -c menpo opencvmenpo channel use by https://github.com/shunsukesaito/PIFu ... think I used a different one
conda install -c conda-forge libjpeg-turbo=1.5 trimesh scikit-image json5 ffmpeglibjpeg-turbo=1.5 provides libjpeg.so.8ImportError: libjpeg.so.8: cannot open shared object file: No such file or directory
pip opencv-contrib-python opencv-pythonnot sure if both are needed or either... would lean to keeping contrib version
Download model
sh ./scripts/download_trained_model.sh
below is old (not that old) guide for myself, before I really knew what conda was about.
There has also been upgrades to MiDaS that would make the instructions below outdated.
Let me know if you have issues, conda is new to me :
git clone https://github.com/intel-isl/MiDaS.git
cd MiDaS
wget https://github.com/intel-isl/MiDaS/releases/download/v2/model-f46da743.pt
sudo dnf install conda modify to install based on your system
conda create --prefix ./envs pytorch=1.2.0 opencv=3.4.2
sudo conda init bash bash or your shell
conda activate ~/MiDaS/envs
conda install pytorch torchvision opencv torchvision
**Now it should be ready to run :**I would recommend using a shortcut in your .bashrc file or something like :
cd ~/MiDas && conda activate ~/MiDaS/envs && python run.py
this will process all the images in your ~/MiDas/input folder and put the results in ~/MiDas/output.
As a note, running run.py from the MiDas folder has worked better for me, I should probably submit a bug.
The help / options menu can always be shown by running either
For more in-depth instructions :
man stereograph
q to quit
For more simple instructions :
stereograph -h
I more commonly use this but would read the first one
many of these command line options are not required, and have defaults
Here are the links to dm.i.turtle.png and pat.pumpkin.png, which were used to output out.turtle.pumkin.png
stereograph -b dm.i.turtle.png -t pat.pumkin.png -f png -o out.turtle.pumkin.png -w 156 -p .43 -d 1 -i -a 32
-b is to set your r/depthMaps (base) ex// -b dm.i.turtle.png
-t is to set r/patternPieces (texture) ex// -t pat.pumkin.png
-f is to set your output file type ex// -f png
the program says this is optional, but I find it is required
-o is to set your output file ex// -o out.turtle.pumkin.png
-w is to set your pattern width ex// -w 156
I will make a repeating pattern @ 150 pixels wide, but will add some space to it to make it 200 pixels wide. This is for 2 reasons :
- Tricking the pattern to use my full pattern : it changes with my -p setting / depth map combination to get the proper pattern repeat. It will be your actual pattern width or more. If you go too wide, it will show the colour of your blank space (if it is transparent, it will be black lines)
- For a while now, I've used the same pattern to make both the r/magicEye version and the r/MagicEye_CrossView version. (see below for my command line)
I wouldn't go above this for magic eye viewers, but you can use really wide patterns for magic eye crossview users.
-p controls the depth space ex// -p .43
if you increase it (towards 1) it will increase the depth space (depth expression)
if you decrease it (towards 0) it will decrease the depth space
if you are seeing artefacts in your magic eye render, the setting could be too high. For me, it is now uncommon to have this over .60
Artefacts can also be eliminated by bluring on the depth map
( I might do a whole post on artefacts )
-d is to control distance from the screen ( 1 is farthest away, 20 is closest) ex// -d 1
I almost always use 1 because it creates less issues for me when I make the r/MagicEye_CrossView version
The man stereograph describes it like this (but I understand it like I said above):
-d distance
distance describes the distance of your eyes and the virtual glass that is between you and your stereogram. Allowed are values from 0.0 up to 20.0 where 5.0 is the default.
-i is to invert the depth map
I commonly design as inverted depth maps, because feel I can see the depths are correct better
if I didn't have this -i (for my inverted depth map), it would render as a r/MagicEye_CrossView
-a is for anti-aliasing ( 1 to 32 ; default 4 ) ex // -a 32
I usually don't use this, I use an -a 32 it's usually me hoping it will fix an artefact issue for me.
stereograph -b dm.i.turtle.png -t pat.pumkin.png -f png -o out.turtle.pumkin.cross.png -w 183 -p .43 -d 1 -a 32
This is my MagicEye_CrossView version; notice the lack of the -i with the inverse depth map
Also notice the -w 183
Though the final magic eye crossview render will only show the 150 pattern width that was used
Now you're ready to play : )
Questions are welcomed
Also :
Pattern Shifting for lining up pattern features to the depth map
-x can be used to shift the pattern horizontally ex// -x 10
-y can be used to shift the pattern horizontally ex// -y 35