Skip to content

Commit de88e2d

Browse files
committed
docs: switch to mkdocs materials
1 parent ac19b1d commit de88e2d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+285
-235
lines changed

.github/workflows/docs.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,23 @@ jobs:
1111
steps:
1212
- uses: actions/setup-python@v5
1313
with:
14-
python-version: '3.11'
14+
python-version: '3.13'
1515
- uses: actions/checkout@v4
16-
with:
17-
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo
18-
- name: install ammico
19-
run: |
20-
python -m pip install uv
21-
uv pip install --system -e .[dev]
22-
- name: set google auth
23-
uses: 'google-github-actions/auth@v0.4.0'
24-
with:
25-
credentials_json: '${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}'
26-
- name: get pandoc
27-
run: |
28-
sudo apt-get install -y pandoc
29-
- name: Build documentation
30-
run: |
31-
cd docs
32-
make html
33-
- name: Push changes to gh-pages
34-
uses: JamesIves/github-pages-deploy-action@v4
35-
with:
36-
folder: docs # The folder the action should deploy.
16+
uses: actions/checkout@v4
17+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
18+
- uses: actions/cache@v4
19+
with:
20+
key: mkdocs-material-${{ env.cache_id }}
21+
path: .cache
22+
restore-keys: |
23+
mkdocs-material-
24+
- run: pip install mkdocs-material mkdocstrings
25+
- name: Build main site
26+
run: mkdocs build
27+
- name: Deploy to gh-pages
28+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
29+
uses: oprypin/push-to-gh-pages@v3
30+
with:
31+
publish_dir: site
32+
33+

docs/Makefile

Lines changed: 0 additions & 20 deletions
This file was deleted.

docs/api.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# API Reference
2+
3+
## Text
4+
::: ammico.text
5+
6+
## Image Summary
7+
::: ammico.image_summary
8+
9+
## Video Summary
10+
::: ammico.video_summary
11+
12+
## Colors
13+
::: ammico.colors
14+
15+
## Utils
16+
::: ammico.utils
17+
18+
## Display
19+
::: ammico.display
20+
21+
## Model
22+
::: ammico.model
23+
24+
## Prompt Builder
25+
::: ammico.prompt_builder

docs/faq.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# FAQ
2+
3+
## Compatibility problems solving
4+
5+
Some ammico components require `tensorflow` (e.g. Emotion detector), some `pytorch` (e.g. Summary detector). Sometimes there are compatibility problems between these two frameworks. To avoid these problems on your machines, you can prepare proper environment before installing the package (you need conda on your machine):
6+
7+
### 1. First, install tensorflow (https://www.tensorflow.org/install/pip)
8+
- create a new environment with python and activate it
9+
10+
```conda create -n ammico_env python=3.13```
11+
12+
```conda activate ammico_env```
13+
- install cudatoolkit from conda-forge
14+
15+
``` conda install -c conda-forge cudatoolkit=11.8.0```
16+
- install nvidia-cudnn-cu11 from pip
17+
18+
```python -m pip install nvidia-cudnn-cu11==8.6.0.163```
19+
- add script that runs when conda environment `ammico_env` is activated to put the right libraries on your LD_LIBRARY_PATH
20+
21+
```
22+
mkdir -p $CONDA_PREFIX/etc/conda/activate.d
23+
echo 'CUDNN_PATH=$(dirname $(python -c "import nvidia.cudnn;print(nvidia.cudnn.__file__)"))' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
24+
echo 'export LD_LIBRARY_PATH=$CUDNN_PATH/lib:$CONDA_PREFIX/lib/:$LD_LIBRARY_PATH' >> $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
25+
source $CONDA_PREFIX/etc/conda/activate.d/env_vars.sh
26+
```
27+
- deactivate and re-activate conda environment to call script above
28+
29+
```conda deactivate```
30+
31+
```conda activate ammico_env ```
32+
33+
- install tensorflow
34+
35+
```python -m pip install tensorflow==2.15```
36+
37+
### 2. Second, install pytorch
38+
39+
- install pytorch for same cuda version as above
40+
41+
```python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118```
42+
43+
### 3. After we prepared right environment we can install the ```ammico``` package
44+
45+
- ```python -m pip install ammico```
46+
47+
It is done.
48+
49+
### Micromamba
50+
If you are using micromamba you can prepare environment with just one command:
51+
52+
```micromamba create --no-channel-priority -c nvidia -c pytorch -c conda-forge -n ammico_env "python=3.10" pytorch torchvision torchaudio pytorch-cuda "tensorflow-gpu<=2.12.3" "numpy<=1.23.4"```
53+
54+
### Windows
55+
56+
To make pycocotools work on Windows OS you may need to install `vs_BuildTools.exe` from https://visualstudio.microsoft.com/visual-cpp-build-tools/ and choose following elements:
57+
- `Visual Studio extension development`
58+
- `MSVC v143 - VS 2022 C++ x64/x86 build tools`
59+
- `Windows 11 SDK` for Windows 11 (or `Windows 10 SDK` for Windows 10)
60+
61+
Be careful, it requires around 7 GB of disk space.
62+
63+
![Screenshot 2023-06-01 165712](https://github.com/ssciwr/AMMICO/assets/8105097/3dfb302f-c390-46a7-a700-4e044f56c30f)
64+
65+
### Version clashes between tensorflow and numpy
66+
67+
Due to the `faces` module, the tensorflow version is currently fixed to at most `2.14.0`. This requires that `numpy` is restricted to `numpy==1.23.5`. If you experience issues with compatibility between tensorflow and numpy, you can try fixing the numpy version to this version.
68+
69+
## What happens to the images that are sent to google Cloud Vision?
70+
71+
You have to accept the privacy statement of ammico to run this type of analyis.
72+
73+
According to the [google Vision API](https://cloud.google.com/vision/docs/data-usage), the images that are uploaded and analysed are not stored and not shared with third parties:
74+
75+
> We won't make the content that you send available to the public. We won't share the content with any third party. The content is only used by Google as necessary to provide the Vision API service. Vision API complies with the Cloud Data Processing Addendum.
76+
77+
> For online (immediate response) operations (`BatchAnnotateImages` and `BatchAnnotateFiles`), the image data is processed in memory and not persisted to disk.
78+
For asynchronous offline batch operations (`AsyncBatchAnnotateImages` and `AsyncBatchAnnotateFiles`), we must store that image for a short period of time in order to perform the analysis and return the results to you. The stored image is typically deleted right after the processing is done, with a failsafe Time to live (TTL) of a few hours.
79+
Google also temporarily logs some metadata about your Vision API requests (such as the time the request was received and the size of the request) to improve our service and combat abuse.
80+
81+
## What happens to the text that is sent to google Translate?
82+
83+
You have to accept the privacy statement of ammico to run this type of analyis.
84+
85+
According to [google Translate](https://cloud.google.com/translate/data-usage), the data is not stored after processing and not made available to third parties:
86+
87+
> We will not make the content of the text that you send available to the public. We will not share the content with any third party. The content of the text is only used by Google as necessary to provide the Cloud Translation API service. Cloud Translation API complies with the Cloud Data Processing Addendum.
88+
89+
> When you send text to Cloud Translation API, text is held briefly in-memory in order to perform the translation and return the results to you.
90+
91+
## What happens if I don't have internet access - can I still use ammico?
92+
93+
Some features of ammico require internet access; a general answer to this question is not possible, some services require an internet connection, others can be used offline:
94+
95+
- Text extraction: To extract text from images, and translate the text, the data needs to be processed by google Cloud Vision and google Translate, which run in the cloud. Without internet access, text extraction and translation is not possible.
96+
- Image summary and query: After an initial download of the models, the `summary` module does not require an internet connection.
97+
- Facial expressions: After an initial download of the models, the `faces` module does not require an internet connection.
98+
- Multimodal search: After an initial download of the models, the `multimodal_search` module does not require an internet connection.
99+
- Color analysis: The `color` module does not require an internet connection.
100+
101+
## Why don't I get probabilistic assessments of age, gender and race when running the Emotion Detector?
102+
Due to well documented biases in the detection of minorities with computer vision tools, and to the ethical implications of such detection, these parts of the tool are not directly made available to users. To access these capabilities, users must first agree with a ethical disclosure statement that reads:
103+
104+
"DeepFace and RetinaFace provide wrappers to trained models in face recognition and emotion detection. Age, gender and race/ethnicity models were trained on the backbone of VGG-Face with transfer learning.
105+
106+
ETHICAL DISCLOSURE STATEMENT:
107+
108+
The Emotion Detector uses DeepFace and RetinaFace to probabilistically assess the gender, age and race of the detected faces. Such assessments may not reflect how the individuals identify. Additionally, the classification is carried out in simplistic categories and contains only the most basic classes (for example, “male” and “female” for gender, and seven non-overlapping categories for ethnicity). To access these probabilistic assessments, you must therefore agree with the following statement: “I understand the ethical and privacy implications such assessments have for the interpretation of the results and that this analysis may result in personal and possibly sensitive data, and I wish to proceed.”
109+
110+
This disclosure statement is included as a separate line of code early in the flow of the Emotion Detector. Once the user has agreed with the statement, further data analyses will also include these assessments.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)