Attention center人類注意力預(yù)測(cè)模型
Attention center 是一個(gè)機(jī)器學(xué)習(xí)模型,這個(gè)倉(cāng)庫(kù)包含:
- 一個(gè) TensorFlow Lite 模型,可用于預(yù)測(cè)圖像的注意中心,即圖像中最突出的部分所在的區(qū)域
- 一個(gè) Python 腳本,可用于使用注意力中心對(duì)圖像進(jìn)行批量編碼。這可以和子模塊 libjxl 一起使用,以便創(chuàng)建 JPEG XL 圖像,這樣解碼圖像將從由模型決定的注意中心開(kāi)始。
Google Attention center 模型的一些預(yù)測(cè)實(shí)例,其中綠點(diǎn)是模型預(yù)測(cè)的圖像注意力中心點(diǎn)。
如何使用
請(qǐng)確保你已經(jīng)安裝了 Python 和 Tensorflow:
- 從 GitHub 上克隆它,包括子模塊
- 構(gòu)建 libjxl,按照 libjxl repo 中給出的說(shuō)明
- 運(yùn)行 encode_with_centers.py 腳本。
git clone https://github.com/google/attention-center --recursive --shallow-submodules cd attention-center/libjxl mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF .. cmake --build . -- -j$(nproc) cd ../../ python encode_with_centers.py --lite_model_file=./model/center.tflite \ --image_dir="${INPUT_IMAGE_DIR}" --output_dir="${OUTPUT_IMAGE_DIR}"
有以下標(biāo)志:
--[no]dry_run: If true, only do a dry run, do not write files.
(default: 'false')
--encoder: Location of th encoder binary.
--image_dir: Name of the directory of input images.
(default: './libjxl/build/tools/cjxl')
--lite_model_file: Path to the corresponding TFLite model.
--new_suffix: File extension of the compressed file.
(default: 'jxl')
--output_dir: Name of the directory of the output images.
--[no]verbose: If true, prints info about the commands executed.
(default: 'true')
評(píng)論
圖片
表情
