mirror of
https://github.com/tiyn/wiki.git
synced 2026-08-25 17:51:37 +02:00
Compare commits
6 Commits
8abca04b9a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| ef929292da | |||
| dfe169870d | |||
| 834487439a | |||
| cfef5b10ec | |||
| 4dd67c6c2c | |||
| ee3d5929bb |
13
wiki/android/episteme_reader.md
Normal file
13
wiki/android/episteme_reader.md
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Episteme Reader
|
||||||
|
|
||||||
|
[Episteme Reader](https://github.com/Aryan-Raj3112/episteme) is a free and open-source
|
||||||
|
[e-book](/wiki/e-book.md) reader for [Android](/wiki/android.md).
|
||||||
|
It supports annotations and OPDS catalogs and can handle large PDF files.
|
||||||
|
For looking up words while reading, an offline dictionary application such as
|
||||||
|
[OSS Dict](/wiki/android/oss_dict.md) can be used.
|
||||||
|
Episteme Reader also features using translation apps like [DeepL](/wiki/deepl.md).
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
On [Android](/wiki/android.md) Episteme Reader is available on [F-Droid](/wiki/android/f-droid.md)
|
||||||
|
in a package called [Episteme Reader](https://f-droid.org/en/packages/com.aryan.reader.oss/).
|
||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
[F-Droid](https://f-droid.org) is an installable catalogue of free and open source
|
[F-Droid](https://f-droid.org) is an installable catalogue of free and open source
|
||||||
software for [Android](/wiki/android.md) systems.
|
software for [Android](/wiki/android.md) systems.
|
||||||
|
Alternatively, [Neo Store](/wiki/android/neo_store.md) can be used as a modern F-Droid client and
|
||||||
|
alternative.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
|
|||||||
10
wiki/android/neo_store.md
Normal file
10
wiki/android/neo_store.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Neo Store
|
||||||
|
|
||||||
|
[Neo Store](https://github.com/NeoApplications/Neo-Store) is a free and open-source
|
||||||
|
[F-Droid](/wiki/android/f-droid.md) client and alternative for [Android](/wiki/android.md).
|
||||||
|
It can be used to browse, install and update applications from F-Droid and other repositories.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
On [Android](/wiki/android.md) Neo Store is available on [F-Droid](/wiki/android/f-droid.md) in a
|
||||||
|
package called [Neo Store](https://f-droid.org/packages/com.machiav3lli.fdroid/).
|
||||||
22
wiki/android/oss_dict.md
Normal file
22
wiki/android/oss_dict.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# OSS Dict
|
||||||
|
|
||||||
|
[OSS Dict](https://github.com/fengdeyingzi/OSS-Dict) is a free and open-source offline dictionary
|
||||||
|
application for [Android](/wiki/android.md) and a fork of Aard 2.
|
||||||
|
The application can for example be used together with
|
||||||
|
[Episteme Reader](/wiki/android/episteme_reader.md) for looking up words while reading.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
On [Android](/wiki/android.md) OSS Dict is available on [F-Droid](/wiki/android/f-droid.md)
|
||||||
|
in a package called [OSS-Dict](https://f-droid.org/en/packages/com.akylas.aard2/).
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
This section addresses the usage of OSS Dict.
|
||||||
|
|
||||||
|
### Installing Dictionaries
|
||||||
|
|
||||||
|
Dictionary files have to be downloaded separately and added to OSS Dict.
|
||||||
|
This is usually done by using `.slob` files.
|
||||||
|
A guide on where to find them can be found in the
|
||||||
|
[wiki of the slob Github page](https://github.com/itkach/slob/wiki/Dictionaries).
|
||||||
@@ -154,9 +154,9 @@ This section focuses on the basic usage of calibre's web version.
|
|||||||
|
|
||||||
#### Problems Logging in With Reverse Proxy
|
#### Problems Logging in With Reverse Proxy
|
||||||
|
|
||||||
It is [a known problem](https://github.com/janeczku/calibre-web/issues/2916?utm_source=chatgpt.com)
|
It is [a known problem](https://github.com/janeczku/calibre-web/issues/2916) not being able to login
|
||||||
not being able to login when using a [reverse proxy](/wiki/reverse-proxy.md) like
|
when using a [reverse proxy](/wiki/reverse-proxy.md) like [Nginx](/wiki/nginx.md) or
|
||||||
[Nginx](/wiki/nginx.md) or [Traefik](/wiki/traefik.md).
|
[Traefik](/wiki/traefik.md).
|
||||||
In this case a 504 error will be displayed.
|
In this case a 504 error will be displayed.
|
||||||
According to various sources this can be fixed by trying previous sections until it works again.
|
According to various sources this can be fixed by trying previous sections until it works again.
|
||||||
|
|
||||||
|
|||||||
14
wiki/deepl.md
Normal file
14
wiki/deepl.md
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# DeepL
|
||||||
|
|
||||||
|
[DeepL](https://www.deepl.com) is an AI-based translation service for translating text and documents
|
||||||
|
between various languages.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
DeepL is a website that can be visited without additional setup needed.
|
||||||
|
|
||||||
|
On [Android](/wiki/android.md) DeepL is available on [F-Droid](/wiki/android/f-droid.md) in a
|
||||||
|
package called [DeepL](https://f-droid.org/en/packages/com.example.deeplviewer/).
|
||||||
|
Additionally, it is available on the [Google Play store](/wiki/android.md#app-store) in a package
|
||||||
|
called
|
||||||
|
[DeepL Translate](https://play.google.com/store/apps/details?id=com.deepl.mobiletranslator&hl=en-US).
|
||||||
@@ -25,18 +25,18 @@ If the software is to be used by you check your local laws first.
|
|||||||
## Tracking
|
## Tracking
|
||||||
|
|
||||||
Many e-book readers include a feature to keep track of read books.
|
Many e-book readers include a feature to keep track of read books.
|
||||||
However they do not track the time that was needed to finish them or the number of e-books read in
|
However they do not track the time that was needed to finish them or the number of e-books read in
|
||||||
a specific timeframe.
|
a specific timeframe.
|
||||||
This can be done by using a special tracker like [Jelu](/wiki/jelu.md) which can be used to keep
|
This can be done by using a special tracker like [Jelu](/wiki/jelu.md) which can be used to keep
|
||||||
track of e-books and normal books at the same time which is a feature no e-book reader has.
|
track of e-books and normal books at the same time which is a feature no e-book reader has.
|
||||||
|
|
||||||
## E-Reader
|
## E-Reader
|
||||||
|
|
||||||
An e-reader is a device that is designed for reading digital e-books.
|
An e-reader is a device that is designed for reading digital e-books.
|
||||||
Some of them also feature [annotation tools](/wiki/note-taking.md).
|
Some of them also feature [annotation tools](/wiki/note-taking.md).
|
||||||
|
|
||||||
- [Episteme Reader](https://github.com/Aryan-Raj3112/episteme) is a native
|
- [Episteme Reader](/wiki/android/episteme_reader.md) is a native [Android](/wiki/android.md)
|
||||||
[Android](/wiki/android.md) [e-book](/wiki/e-book.md) reader, that is capable of annotations.
|
e-book reader, that is capable of annotations.
|
||||||
In contrast to [Saber](/wiki/note-taking.md#software) it is able to handle large PDF-files.
|
In contrast to [Saber](/wiki/note-taking.md#software) it is able to handle large PDF-files.
|
||||||
Additionally it features the OPDS protocol for catalogs which can, for example, connect to
|
Additionally it features the OPDS protocol for catalogs which can, for example, connect to
|
||||||
[the OPDS catalog of calibre's web version](/wiki/calibre.md#connect-via-opds).
|
[the OPDS catalog of calibre's web version](/wiki/calibre.md#connect-via-opds).
|
||||||
|
|||||||
@@ -98,10 +98,10 @@ The following add-ons provide translation options.
|
|||||||
add-on made by Mozilla itself that gives an option for marked text to display its translations
|
add-on made by Mozilla itself that gives an option for marked text to display its translations
|
||||||
quickly from the extension menu but can also translate whole sites.
|
quickly from the extension menu but can also translate whole sites.
|
||||||
- [Simple Translate](https://addons.mozilla.org/en-US/firefox/addon/simple-translate) is an add-on
|
- [Simple Translate](https://addons.mozilla.org/en-US/firefox/addon/simple-translate) is an add-on
|
||||||
supporting both DeepL and Google Translate to translate marked text in various different ways that
|
supporting both [DeepL](/wiki/deepl.md) and Google Translate to translate marked text in various
|
||||||
can be automatically displayed.
|
different ways that can be automatically displayed.
|
||||||
- [To DeepL translation](https://addons.mozilla.org/en-US/firefox/addon/to-deepl/) gives an option
|
- [To DeepL translation](https://addons.mozilla.org/en-US/firefox/addon/to-deepl/) gives an option
|
||||||
for marked text to display its translation in a pop-up window using DeepL.
|
for marked text to display its translation in a pop-up window using [DeepL](/wiki/deepl.md).
|
||||||
|
|
||||||
#### Shopping Add-ons
|
#### Shopping Add-ons
|
||||||
|
|
||||||
|
|||||||
@@ -24,3 +24,7 @@ The following is a list of these tools.
|
|||||||
Basic guides for this can be found on the pages of
|
Basic guides for this can be found on the pages of
|
||||||
[toromtomtom](https://www.toromtomtom.com/blog/2021/10/17/pdfpc.html) and
|
[toromtomtom](https://www.toromtomtom.com/blog/2021/10/17/pdfpc.html) and
|
||||||
[Utah university](https://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/pdfpc/pdfpc-doc.pdf).
|
[Utah university](https://ctan.math.utah.edu/ctan/tex-archive/macros/latex/contrib/pdfpc/pdfpc-doc.pdf).
|
||||||
|
Most importantly the tab key opens the overview mode, `p` pauses, `f` freezes, `t` opens
|
||||||
|
clickable options, `g` opens the option to navigate to a specific page, `h` hides and `b` shows
|
||||||
|
`a` blank foil. After selecting a rectangular space with the pointer tool, `z` can be pressed to
|
||||||
|
zoom into it.
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ can be referenced.
|
|||||||
### TensorFlow
|
### TensorFlow
|
||||||
|
|
||||||
This section addresses the [TensorFlow module](https://www.tensorflow.org/).
|
This section addresses the [TensorFlow module](https://www.tensorflow.org/).
|
||||||
Tensorflos is a machine learning resource which is often used for
|
TensorFlow is a machine learning resource which is often used for
|
||||||
[neural networks](/wiki/neural_network.md).
|
[neural networks](/wiki/neural_network.md).
|
||||||
|
|
||||||
Apart from [package managers](/wiki/linux/package_manager.md) and
|
Apart from [package managers](/wiki/linux/package_manager.md) and
|
||||||
@@ -390,6 +390,88 @@ on [the official website](https://www.tensorflow.org/install/source).
|
|||||||
This may especially be useful if specific configurations are needed such as vendor specific GPU
|
This may especially be useful if specific configurations are needed such as vendor specific GPU
|
||||||
support.
|
support.
|
||||||
|
|
||||||
|
#### Setup TensorFlow with CUDA in a uv Project
|
||||||
|
|
||||||
|
TensorFlow can install its required CUDA user-space libraries as optional dependencies on Linux.
|
||||||
|
The NVIDIA driver still has to be installed on the host system.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
nvidia-smi
|
||||||
|
uv add 'tensorflow[and-cuda]'
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify whether TensorFlow was built with CUDA support and detects the GPU.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
uv run python -c 'import tensorflow as tf; print("CUDA build:", tf.test.is_built_with_cuda()); print(tf.config.list_physical_devices("GPU"))'
|
||||||
|
```
|
||||||
|
|
||||||
|
If `CUDA build` is `True` but no GPU is listed and TensorFlow reports that it cannot load GPU
|
||||||
|
libraries, the dynamic linker may not find the NVIDIA libraries installed inside the virtual
|
||||||
|
environment.
|
||||||
|
The following command temporarily adds all library directories from the installed `nvidia-*`
|
||||||
|
packages.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
SITE_PACKAGES=$(uv run python -c 'import site; print(site.getsitepackages()[0])')
|
||||||
|
CUDA_LIBS=$(find "$SITE_PACKAGES/nvidia" -type d -name lib -printf '%p:')
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH="${CUDA_LIBS}/usr/lib" uv run python -c \
|
||||||
|
'import tensorflow as tf; print(tf.config.list_physical_devices("GPU"))'
|
||||||
|
```
|
||||||
|
|
||||||
|
If the test succeeds, store the path in a machine-specific dotenv file.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
printf 'LD_LIBRARY_PATH=%s/usr/lib\n' "$CUDA_LIBS" > .env.cuda
|
||||||
|
printf '.env.cuda\n' >> .gitignore
|
||||||
|
```
|
||||||
|
|
||||||
|
Run the project with the file explicitly.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
uv run --env-file .env.cuda python <script>.py
|
||||||
|
```
|
||||||
|
|
||||||
|
To load it automatically, create a `.envrc` file and use
|
||||||
|
[direnv](https://direnv.net/).
|
||||||
|
|
||||||
|
```sh
|
||||||
|
printf 'export UV_ENV_FILE="$PWD/.env.cuda"\n' > .envrc
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
direnv allow
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information about dotenv files in uv, refer to the
|
||||||
|
[uv environment variable section](/wiki/programming_language/python/uv.md#loading-environment-variables).
|
||||||
|
|
||||||
|
Some recent GPUs may require CUDA kernels to be compiled from PTX on the first run because the
|
||||||
|
TensorFlow wheel does not yet contain native kernel binaries for their compute capability.
|
||||||
|
For example, TensorFlow 2.21 reports this for an RTX 5060 Ti with compute capability `12.0a`.
|
||||||
|
According to NVIDIA's
|
||||||
|
[explanation of PTX compatibility](https://developer.nvidia.com/blog/understanding-ptx-the-assembly-language-of-cuda-gpu-computing/),
|
||||||
|
embedded PTX can be compiled for newer GPU generations at runtime.
|
||||||
|
The first start can therefore take considerably longer, while the resulting binary is normally
|
||||||
|
cached for subsequent runs.
|
||||||
|
|
||||||
|
Make sure the `ptxas` executable installed by the CUDA dependency is available in the virtual
|
||||||
|
environment.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
VENV_DIR=$(uv run python -c 'import sys; print(sys.prefix)')
|
||||||
|
PTXAS=$(find "$VENV_DIR" -type f -name ptxas -print -quit)
|
||||||
|
ln -sf "$PTXAS" "$VENV_DIR/bin/ptxas"
|
||||||
|
```
|
||||||
|
|
||||||
|
The library lookup problem is not caused by the GPU being new; it is an environment configuration
|
||||||
|
issue.
|
||||||
|
The new GPU generation only explains why TensorFlow falls back to PTX JIT compilation after the
|
||||||
|
libraries have been found.
|
||||||
|
|
||||||
|
Refer to the
|
||||||
|
[official TensorFlow installation guide](https://www.tensorflow.org/install/pip) for the current
|
||||||
|
CUDA installation and troubleshooting steps.
|
||||||
|
|
||||||
#### Basic Usage of TensorFlow
|
#### Basic Usage of TensorFlow
|
||||||
|
|
||||||
The basic usage of TensorFlow is described in
|
The basic usage of TensorFlow is described in
|
||||||
|
|||||||
@@ -113,6 +113,44 @@ desired package.
|
|||||||
uv add <package>
|
uv add <package>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Loading Environment Variables
|
||||||
|
|
||||||
|
[`uv run`](https://docs.astral.sh/uv/concepts/configuration-files/#environment-variable-files) can
|
||||||
|
load environment variables from dotenv files.
|
||||||
|
Use `--env-file` to load a file for one command.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
uv run --env-file .env.local python <script>.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, set `UV_ENV_FILE` to use the same file for subsequent `uv run` commands in the
|
||||||
|
current shell.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export UV_ENV_FILE="$PWD/.env.local"
|
||||||
|
uv run python <script>.py
|
||||||
|
```
|
||||||
|
|
||||||
|
For project-local automation, [direnv](https://direnv.net/) can set `UV_ENV_FILE` whenever the
|
||||||
|
project directory is entered.
|
||||||
|
Create `.envrc` in the project root with the following content.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export UV_ENV_FILE="$PWD/.env.local"
|
||||||
|
```
|
||||||
|
|
||||||
|
Enable the shell hook, then approve the file.
|
||||||
|
The example uses Zsh.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
eval "$(direnv hook zsh)"
|
||||||
|
direnv allow
|
||||||
|
```
|
||||||
|
|
||||||
|
The shell hook should be added to `~/.zshrc` to enable it in new shells.
|
||||||
|
`direnv allow` always expects a `.envrc`; it does not load `.env.local` directly.
|
||||||
|
Machine-specific dotenv files should usually be added to `.gitignore`.
|
||||||
|
|
||||||
### Installing CLI Tools
|
### Installing CLI Tools
|
||||||
|
|
||||||
Besides managing projects and virtual environments, `uv` can also install
|
Besides managing projects and virtual environments, `uv` can also install
|
||||||
|
|||||||
45
wiki/rembg.md
Normal file
45
wiki/rembg.md
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
# rembg
|
||||||
|
|
||||||
|
[rembg](https://github.com/danielgatis/rembg) is a [command line](/wiki/linux/shell.md) tool and
|
||||||
|
Python library for removing image backgrounds using pretrained
|
||||||
|
[neural networks](/wiki/neural_network.md) executed through ONNX Runtime.
|
||||||
|
|
||||||
|
## Setup
|
||||||
|
|
||||||
|
rembg can be installed from source as described on the
|
||||||
|
[official GitHub repository](https://github.com/danielgatis/rembg).
|
||||||
|
|
||||||
|
Alternatively a [Python package manager](/wiki/programming_language/python.md#package-management)
|
||||||
|
can be used to install rembg.
|
||||||
|
For the backend one must select CPU or GPU usage.
|
||||||
|
For command line usage an extra package has to be installed in addition to the inference backend.
|
||||||
|
Depending on that choice the name of the package will be `"rembg[cpu,cli]"` or `rembg[gpu,cli]`.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
This section addresses the usage of rembg.
|
||||||
|
|
||||||
|
### Remove Background
|
||||||
|
|
||||||
|
The following command removes the background from an image using a specific `<model>`.
|
||||||
|
In this case `<input>` is a placeholder for the input image path and `<output>` for the output image
|
||||||
|
path.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rembg i -m <model> <input> <output>
|
||||||
|
```
|
||||||
|
|
||||||
|
Depending on the use-case other models may also be used.
|
||||||
|
`u2net` is a general purpose model and most of the time a good default.
|
||||||
|
`u2net_human_seg` is optimized for human subjects.
|
||||||
|
`isnet-general-use` is an alternative general-purpose model.
|
||||||
|
|
||||||
|
The quality depends on the selected model and the input image.
|
||||||
|
For portraits with complex backgrounds such as bushes or trees, `u2net` often produces the best
|
||||||
|
overall results, while other models may perform better on different types of images.
|
||||||
|
|
||||||
|
Additionally, alpha matting can improve difficult edges such as hair.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
rembg i -m <model> -a <input> <output>
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user