From 8c936cd0aa8b44b350af0a36ac0342708b898a0d Mon Sep 17 00:00:00 2001 From: ashawkey Date: Mon, 19 Feb 2024 10:16:31 +0800 Subject: [PATCH] update --- docs/graphics/pbr.md | 19 ++++++++++++++++- docs/python/huggingface.md | 42 +++++++++++++++++++++++++++----------- docs/windows/powertoys.md | 18 ++++++++++++++++ 3 files changed, 66 insertions(+), 13 deletions(-) create mode 100644 docs/windows/powertoys.md diff --git a/docs/graphics/pbr.md b/docs/graphics/pbr.md index 8f6f6edf9..03ae22552 100644 --- a/docs/graphics/pbr.md +++ b/docs/graphics/pbr.md @@ -9,7 +9,7 @@ * $\mathbf h=\frac {w_i + w_o} {||w_i + w_o||}$ is the halfway vector (different from $\mathbf n$ !) * $m$ is the metalness * $\rho$ is the roughness - * $\mathbf a$ is the ambient color + * $\mathbf a$ is the ambient color (base color) * $s(\omega_i)$ is the occlusion probability from the shading point to light. * rendering Equation: @@ -61,3 +61,20 @@ $$ * direct term (from light): only dependent on the outgoing light direction. * indirect term (from other reflective surfaces): also dependent on the current shading point. + + +### Metallic/Roughness v.s. Specular/Glossiness + +Except for the common metallic-roughness model, there is also specular-glossiness model for PBR (e.g., Unity). + +Both models can be converted between: https://kcoley.github.io/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/examples/convert-between-workflows/ + +$$ +\displaylines{ +glossiness = 1 - roughness \\ +diffuse = (1 - metallic) * basecolor \\ +specular = metallic * basecolor \\ +} +$$ + +A detailed documentation can be found: https://kcoley.github.io/glTF/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness/ diff --git a/docs/python/huggingface.md b/docs/python/huggingface.md index fe39ec333..6e5f5eb29 100644 --- a/docs/python/huggingface.md +++ b/docs/python/huggingface.md @@ -10,9 +10,10 @@ pip install huggingface_hub huggingface-cli login ``` + ### upload models to a repo -using python API: +##### using python API: ```python from huggingface_hub import HfApi @@ -36,22 +37,39 @@ api.upload_folder( ) ``` -using CLI: +##### using CLI: + +If the repo is not existing, it will be created automatically! + +```bash +# upload local files to remote repo +huggingface-cli upload + +# upload everything to remote root dir +huggingface-cli upload . . -* Create the repo from website first. +# upload a single file +huggingface-cli upload ./path/to/myfile # remote default to . +huggingface-cli upload ./path/to/myfile /path/to/remote -* upload by +# upload multiple files: use --include --exclude +huggingface-cli upload --include="*.mp4" --exclude="unwanted*" +``` + + +### download models - ```bash - huggingface-cli upload - # example for uploading everything to remote root dir - huggingface-cli upload . . - ``` +##### using CLI: - -### Downloads a repo +By default these commands will download to `~/.cache/huggingface/hub`, use `--local-dir` to change it! ```bash -huggingface-cli download +# download single/multiple files to current dir +huggingface-cli download [ ...] --local-dir . + +huggingface-cli download stabilityai/stable-diffusion-xl-base-1.0 --include "*.safetensors" --exclude "*.fp16.*"* + +# download entire repo +huggingface-cli download --local-dir . ``` diff --git a/docs/windows/powertoys.md b/docs/windows/powertoys.md new file mode 100644 index 000000000..5534888cb --- /dev/null +++ b/docs/windows/powertoys.md @@ -0,0 +1,18 @@ +## Power Toys + +Install from: https://github.com/microsoft/PowerToys/releases + + +### Power Rename + +https://learn.microsoft.com/zh-cn/windows/powertoys/powerrename + +Examples: + +```bash +# using regex +(.*).mp4 --> $1_backup.mp4 +``` + +MS use `$1` for group reference in regex, instead of `\1`! +