Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ashawkey committed Feb 19, 2024
1 parent 68e4e85 commit 8c936cd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 13 deletions.
19 changes: 18 additions & 1 deletion docs/graphics/pbr.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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/
42 changes: 30 additions & 12 deletions docs/python/huggingface.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 <user/repo> <local path> <remote path>

# upload everything to remote root dir
huggingface-cli upload <user/repo> . .

* Create the repo from website first.
# upload a single file
huggingface-cli upload <user/repo> ./path/to/myfile # remote default to .
huggingface-cli upload <user/repo> ./path/to/myfile /path/to/remote

* upload by
# upload multiple files: use --include --exclude
huggingface-cli upload <user/repo> --include="*.mp4" --exclude="unwanted*"
```


### download models

```bash
huggingface-cli upload <user/repo> <local path> <remote path>
# example for uploading everything to remote root dir
huggingface-cli upload <user/repo> . .
```
##### 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 <user/repo>
# download single/multiple files to current dir
huggingface-cli download <user/repo> <file1> [<file2> ...] --local-dir .

huggingface-cli download stabilityai/stable-diffusion-xl-base-1.0 --include "*.safetensors" --exclude "*.fp16.*"*

# download entire repo
huggingface-cli download <user/repo> --local-dir .
```

18 changes: 18 additions & 0 deletions docs/windows/powertoys.md
Original file line number Diff line number Diff line change
@@ -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`!

0 comments on commit 8c936cd

Please sign in to comment.